6QHostInfo::lookupHost(
"qt-project.org",
this, &MyWidget::printResults);
9QHostInfo::lookupHost(
"4.2.2.1",
this, &MyWidget::printResults);
19QHostInfo::lookupHost(
"www.kde.org",
this, &MyWidget::lookedUp);
24void MyWidget::lookedUp(
const QHostInfo &host)
26 if (host.error() != QHostInfo::NoError) {
27 qDebug() <<
"Lookup failed:" << host.errorString();
31 const auto addresses = host.addresses();
32 for (
const QHostAddress &address : addresses)
33 qDebug() <<
"Found address:" << address.toString();
39QHostInfo::lookupHost(
"4.2.2.1",
this, &MyWidget::lookedUp);
46if (!info.addresses().isEmpty()) {
47 QHostAddress address = info.addresses().first();