Re: QNetworkInterface get IP
Quote:
Originally Posted by
pdoria
Since this is my first post... HI ALL!
Hi and welcome!
Quote:
Originally Posted by
pdoria
I simply want to extract the IP from a network interface.
Try something like this:
Code:
QList<QNetworkAddressEntry> entries = iface.addressEntries();
if (!entries.isEmpty())
{
...
}
Re: QNetworkInterface get IP
Thank you JPN!
That did it!
This is how the function ended up to be:
Code:
QList<QNetworkAddressEntry> entries = iface.addressEntries();
if (!entries.isEmpty()) {
return ip;
}
}