zoukankan      html  css  js  c++  java
  • Qt程序Release版出现 类似 QEventLoop: Cannot be used without QApplication 问题的终极解决方案

    最近在做Qt程序开发,程序在Debug下跑是没有问题的,发布到Release版本后,出现各种问题:

    报各种莫名其妙的错误,类似的错误有:
     
    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)
    等!
     
     
    这些异常信息看着很让人头疼,也无从下手,我甚至一行简单的代码都会报错
     
    1. newQNetworkAccessManager()
    会报错QObject::connect: Cannot connect (null)::aboutToQuit() to QNativeWifiEngine::closeHandle()
     
    到处baidu、google都没有解决办法,也有少数的人遇到类似的问题,但是都没有解决办法。
     
    一次偶然的机会,我找到了问题所在:就是库链接错了,我把Qt5Network.lib写成Qt5Networkd.lib了
    改回来之后,一切就都正常了。
     
    真是大坑啊,自己挖的坑,还是得自己填。
    为了记住这个惨痛的教训,特意写下这篇文章,同时也给那些遇到同样问题的人一个解决方法。
  • 相关阅读:
    要看的博客
    sleep(0)的妙用
    Spring Cloud:Eureka的多网卡IP选择问题
    SpringBoot整合swagger
    springboot整合redis(注解形式)
    RSA非对称加密
    java split(regex,limit) 使用记录
    windows git支持arc命令
    eclipse安装反编译插件
    使用@Validated分组遇到的坑
  • 原文地址:https://www.cnblogs.com/huomiao/p/5049281.html
Copyright © 2011-2022 走看看