errors qdnslookup



  • Hi i use this code:
    void MainWindow::lookupServers()
    {
    // Create a DNS lookup.
    QDnsLookup dns = new QDnsLookup(this);
    connect(dns, SIGNAL(finished()),
    this, SLOT(handleServers()));

    // Find the XMPP servers for gmail.com
    dns->setType(QDnsLookup::SRV);
    dns->setName("_xmpp-client._tcp.gmail.com");
    dns->lookup();
    }

    Errors:
    error: conversion from 'QDnsLookup*' to non-scalar type 'QDnsLookup' requested
    QDnsLookup dns = new QDnsLookup(this);
    error: no matching function for call to 'MainWindow::connect(QDnsLookup&, const char*, MainWindow* const, const char*)'
    this, SLOT(handleServers()));
    C:\Qt\Qt5.2.0\Tools\QtCreator\bin\qdnslookup\mainw indow.cpp:30: error: base operand of '->' has non-pointer type 'QDnsLookup'
    dns->setType(QDnsLookup::SRV);
    ^



  • "QDnsLookup dns = new QDnsLookup(this)" must be "QDnsLookup *dns = new QDnsLookup(this)"


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.