The ultimate solution similar to QEventLoop: Cannot be used without QApplication appears in the Qt program Release version. cannotdowithout

Source: Internet
Author: User

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:
  1. QEventLoop:Cannot be used without QApplication
  2. QObject::connect:Cannot connect (null)::aboutToQuit() to
  3. QNativeWifiEngine::closeHandle()
 
  1. QObject::connect:Cannot connect (null)::aboutToQuit() to QNativeWifiEngine::closeHandle()
  2. QObject:Cannot create children for a parent that is in a different thread.
  3. (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.
  1. 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)



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.