Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Help with QNetworkConfigurationManager!
QtWS25 Last Chance

Help with QNetworkConfigurationManager!

Scheduled Pinned Locked Moved General and Desktop
3 Posts 1 Posters 2.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tzqdo
    wrote on last edited by
    #1

    @QNetworkConfigurationManager *mgr = new QNetworkConfigurationManager(this);

    //mgr->updateConfigurations();
    
    QList<QNetworkConfiguration> activeConfigs = mgr->allConfigurations(QNetworkConfiguration::Active);
    
    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);
    
    }@
    

    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()));
    loop.exec();@

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tzqdo
      wrote on last edited by
      #2

      Any one else come up against the problem?

      1 Reply Last reply
      0
      • T Offline
        T Offline
        tzqdo
        wrote on last edited by
        #3

        dig it.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved