title: Get current QNetworkInterface active and connected to the internet
body: <p>I would like get the current network interface active and connected to the internet.</p>
  
  <p>Actually, I can check if a network is up and if is not a loop back network.</p>
  
  <pre><code>  foreach(QNetworkInterface interface, QNetworkInterface::allInterfaces())
      {
          if (interface.flags().testFlag(QNetworkInterface::IsUp) &amp;&amp; !interface.flags().testFlag(QNetworkInterface::IsLoopBack))
              foreach (QNetworkAddressEntry entry, interface.addressEntries())
              {
              if ( interface.hardwareAddress() != "00:00:00:00:00:00" &amp;&amp; entry.ip().toString().contains("."))
                  items &lt;&lt; interface.name() + " "+ entry.ip().toString() +" " + interface.hardwareAddress();
          }
  </code></pre>
  
  <p>Results:</p>
  
  <pre><code>"en1 3.3.3.52 D4:9A:20:61:1F:72" 
  "vmnet1 192.168.169.1 00:50:56:C0:00:01" 
  "vmnet8 192.168.210.1 00:50:56:C0:00:08"
  </code></pre>
  
  <p>In fact it works but I found also VM interfaces.
  And I want to only select WLAN interfaces and Ethernet interfaces.</p>