guidupas
11th February 2014, 16:52
Hi all!
I am trying to get the host name from a IP inside my LAN using QHostInfo.
This is my code:
bool rede::verificaIP(QString ip)
{
info.setAddresses();
QHostInfo info = QHostInfo::fromName(ip);
qDebug() << "IP:" << info.hostName() << info.addresses();
return false;
}
The ip parameter is 192.168.1.91
But the result is:
IP: "192.168.1.91" (QHostAddress("192.168.1.91") )
The function does not returns the host name
Can anyone help me?
Thanks a lot.
I am trying to get the host name from a IP inside my LAN using QHostInfo.
This is my code:
bool rede::verificaIP(QString ip)
{
info.setAddresses();
QHostInfo info = QHostInfo::fromName(ip);
qDebug() << "IP:" << info.hostName() << info.addresses();
return false;
}
The ip parameter is 192.168.1.91
But the result is:
IP: "192.168.1.91" (QHostAddress("192.168.1.91") )
The function does not returns the host name
Can anyone help me?
Thanks a lot.