From QHostInfo get QHostadress
-
How can I get QHostAdress from QHostInfo?
I have the name of host,how can I find QHostAdress of this host? -
Did you try "this?":http://qt-project.org/doc/qt-5/qhostinfo.html#addresses
-
QList<QHostAddress> QHostInfo::addresses() this? yeah I am now working on it but I think there might be other solution for this
-
Hi,
What solution are you thinking about ?
-
Oh, I solved this problem without using this classes, I just changed my program model :) But I think about solution like this
@
QList<QHostAddress> buff=info.addresses();
for(int i=0;i<buff.size();++i)
{
QHostInfo temp=QHostInfo::fromName(buff[i].toString());
if(name ==temp.hostName()) return buff[i];
}
@
Something like this? Or I didn't understand those classes?