- QNetworkConfigurationManager mgr;
- mgr.updateConfigurations();
- QList<QNetworkConfiguration> activeConfigs = mgr.allConfigurations(QNetworkConfiguration::Defined);
- if (activeConfigs.count() <= 0){
- qDebug()<<"activeConfigs:"<<activeConfigs.count();
- QMessageBox::warning(this,tr("Connection problems"),
- tr("No active ethernet connection found\nPlease check your ethernet wiring"));
- //exit(0);
- }
上面的代码在release版本下,会提示
没有找到活动连接。。。而在debug下正常,这是为何?