Qt6.4.3, QNetworkInformation not working
-
Please run with QT_DEBUG_PLUGINS=1 and make sure that <QTDIR>/plugins/networkinformation/ contains a valid plugin.
-
#include <QCoreApplication> #include<QNetworkInformation> #include<QDebug> int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); qInfo()<<QNetworkInformation::availableBackends(); qInfo()<<QNetworkInformation::loadDefaultBackend(); return a.exec(); }
-
Please run with QT_DEBUG_PLUGINS=1 and make sure that <QTDIR>/plugins/networkinformation/ contains a valid plugin.
-
Hi,
Beside the good hint of @Christian-Ehrlicher, can you say exactly what does not work ?
The compilation ?
At run time ?If the former, are you using qmake or CMake ?
Did you include the Network module in your project ? -
@Christian-Ehrlicher Thanks it worked. When building with MSVC2019 code works fine. It doesnot works when building with MinGW.
So, I checked and found that directory <QTDIR>\6.4.3\msvc2019_64\plugins contains networkinformation plugin but <QTDIR>\6.4.3\mingw_64\plugins doesnot have networkinformation plugin.
Should I copy networkinformation plugin from msvc2019_64\plugins to mingw_64\plugins, for it to work with mingw?
-
-
@Christian-Ehrlicher Hi
Could you please help me to solve the problem on embedded linux system?
Here is the information for you:the plugin could be found but it couldn't be load by
QNetworkInformation::loadBackendByName(QString("networkmanager"))
orQNetworkInformation::loadDefaultBackend()
Let me know if you want to get other information for you.
System: Yocto Linux 5.15 with Qt 6.4.2