/******聊天工具源码中对获取ip的函数进行修改:*************************QStringWidget::getIP()//获取ip地址{QListlist=QNetworkInterface::allAddresses();foreach(QHostAddressaddress,list){if(address.protocol()==QAbstractSocket::IPv4Protocol)//我们使用IPv4地址returnaddress.toString();}