Get current QNetworkInterface active and connected to the internet
问题 I would like get the current network interface active and connected to the internet. Actually, I can check if a network is up and if is not a loop back network. foreach(QNetworkInterface interface, QNetworkInterface::allInterfaces()) { if (interface.flags().testFlag(QNetworkInterface::IsUp) && !interface.flags().testFlag(QNetworkInterface::IsLoopBack)) foreach (QNetworkAddressEntry entry, interface.addressEntries()) { if ( interface.hardwareAddress() != "00:00:00:00:00:00" && entry.ip()