The ultimate solution similar to QEventLoop: Cannot be used without QApplication appears in the Qt program Release version. cannotdowithout
Recently, I am working on Qt program development. There is no problem in running the program under Debug. After the program is released to the Release version, there are various problems:
Various inexplicable errors are reported. Similar errors include:
QEventLoop:Cannot be used without QApplication
QObject::connect:Cannot connect (null)::aboutToQuit() to
QNativeWifiEngine::closeHandle()
QObject::connect:Cannot connect (null)::aboutToQuit() to QNativeWifiEngine::closeHandle()
QObject:Cannot create children for a parent that is in a different thread.
(Parent is QApplication(0x31f99c), parent's thread is QThread(0x57c058), current thread is QThread(0x598b40)
Etc! These exception information is a headache and cannot be started. Even a simple line of code reports an error.
newQNetworkAccessManager()
QObject: connect: Cannot connect (null): aboutToQuit () to QNativeWifiEngine: closeHandle () Cannot be solved by baidu or google everywhere, A few people have encountered similar problems, but there is no solution. By chance, I found the problem:
The Library link is incorrect. I wrote Qt5Network. lib
Qt5Networkd. lib. After the change, everything will be normal. It's a big pitfall. you have to fill it out by yourself. In order to remember this painful lesson, I wrote this article specially and gave a solution to those who encountered the same problem.
From Weizhi note (Wiz)