Nominate our 2022 Qt Champions!

Help with QNetworkConfigurationManager!

  • @QNetworkConfigurationManager *mgr = new QNetworkConfigurationManager(this);

    QList<QNetworkConfiguration> activeConfigs = mgr->allConfigurations(QNetworkConfiguration::Active);
    if (activeConfigs.count() <= 0){
        QMessageBox::warning(this,tr("Connection problems"),
                                  tr("No active ethernet connection found\nPlease check your ethernet wiring"));

    The debug version works properly,but the release version always prompt the warning dialog!

    If I add the following code,It will never exit loop.exec(),regardless of debug or release version.
    @QEventLoop loop;
    QObject::connect(mgr, SIGNAL(updateCompleted()), &loop, SLOT(quit()));

  • Any one else come up against the problem?

  • dig it.

Log in to reply