title: How to detect internet connection state with Qt 5.4 on OS X Yosemite 10.10.3?
body: <p>I'm trying to check the internet connection state with Qt 5.4 on OS X Yosemite 10.10.3, but every time I run the code the result is connected, although I'm not connected to anything.</p>
  
  <pre><code>bool NetworkAccessManager::currentConnectivityStatus()
  {
      QNetworkAccessManager *namanager = new QNetworkAccessManager(this);
      switch (namanager-&gt;networkAccessible()) {
      case QNetworkAccessManager::UnknownAccessibility:
          kdebug() &lt;&lt; Q_FUNC_INFO &lt;&lt; "QNetworkAccessManager::UnknownAccessibility";
          break;
      case QNetworkAccessManager::NotAccessible:
          kdebug() &lt;&lt; Q_FUNC_INFO &lt;&lt; "QNetworkAccessManager::NotAccessible";
          break;
      case QNetworkAccessManager::Accessible:
          kdebug() &lt;&lt; Q_FUNC_INFO &lt;&lt; "QNetworkAccessManager::Accessible";
          break;
      default:
          break;
      }
  
      QNetworkConfigurationManager manager;
          kdebug()&lt;&lt; Q_FUNC_INFO &lt;&lt; " network connection " &lt;&lt; manager.isOnline();
  
      QNetworkConfiguration cfg = manager.defaultConfiguration();
      QNetworkSession *session = new QNetworkSession(cfg);
      session-&gt;open();
      session-&gt;waitForOpened();
  
      if(session-&gt;isOpen())
      {
          switch (session-&gt;state()) {
          case QNetworkSession::Connected:
              kdebug() &lt;&lt; Q_FUNC_INFO &lt;&lt; "QNetworkSession::Connected";
              break;
          case QNetworkSession::Disconnected:
              kdebug() &lt;&lt; Q_FUNC_INFO &lt;&lt; "QNetworkSession::disconnect";
              break;
          default:
              break;
          }
      }
  }
  </code></pre>
  
  <p>And here is the result for all the above when i disconnect everything</p>
  
  <pre><code>DEBUG 2015-04-25T16:00:59.560 bool NetworkAccessManager::currentConnectivityStatus() QNetworkAccessManager::Accessible 
  DEBUG 2015-04-25T16:00:59.560 bool NetworkAccessManager::currentConnectivityStatus()  network connection OK  true 
  DEBUG 2015-04-25T16:00:59.560 bool NetworkAccessManager::currentConnectivityStatus() QNetworkSession::Connected 
  </code></pre>