QNetworkInterface * test = new QNetworkInterface();
qDebug() << test->allAddresses();
但编译时提示:
'QNetworkConfigurationManager' was not declared in this scope
解决方法:
修改 .pro 文件 增加网络选项
将
QT += core gui
改为:
QT += core gui network
参考链接:http://www.developer.nokia.com/Community/Discussion/showthread.php?222836-QNetworkConfigurationManager-was-not-declared-in-this-scope
阅读(6271) | 评论(0) | 转发(0) |