发布时报 Please instantiate the QApplication object first
在Debug下正常,在relase下时报QCoreApplication::applicationDirPath: Please instantiate the QApplication object first错误
这是有QCoreapplication里面出来的,我的main如下
这是有QCoreapplication里面出来的,我的main如下
int main(int argc, char *argv[])
{
#if _MSC_VER >= 1600
#pragma execution_character_set("utf-8")
#endif
Q_INIT_RESOURCE(images);
QTranslator oTranslator;
oTranslator.load(":/qt_zh_CN");
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}
也没有什么特别的地方
在QCoreApplication.cpp里有个函数检查报出来的
如下
bool QCoreApplicationPrivate::checkInstance(const char *function)
{
bool b = (QCoreApplication::self != 0);
if (!b)
qWarning("QApplication::%s: Please instantiate the QApplication object first", function);
return b;
}
程序里确实使用了很多applicationDirPath(),唯有一个类使用时报这个,把那个类注释掉就不报了,什么意思呢,我是在主窗体的TimerEvent里初始化的那个类。总不能给个Debug版本让别人用吧。
那个类只是有cpp上引用 了#include <QCoreApplication> 后面使用了许多QCoreApplication:: applicationDirPath()
这个用法没什么错呀,怎么解决呢
...全文
相关推荐
nyt-first-said:在纽约时报首次发布文字时发的推文
一个Twitter机器人,用于追踪《纽约时报》历史上首次发布单词的时间。 运行在: 它还为同级机器人,该机器人使用几句话源文本上下文以及指向该文章的链接来回复每条推文。 该代码采取了一些步骤来丢弃一
pcan.zip_The First_pcan
Write to PCAN, with the function PCAN and c.header. please see the header first.
first object XML 编辑器
"first object XML 编辑器"是一款专为XML文件处理设计的专业工具,旨在提供高效、易用的XML文档编辑功能。
The-First-Timers
【标题】:“The-First-Timers”:一个关于幻想足球联赛的项目在这个名为"The-First-Timers"的项目中,我们看到的是一场充满激情的幻想体育活动,特别是聚焦于足球领域的“第一个计时器
dejo-first.zip_The First
这个压缩包名为"dejo-first.zip_The First",暗示了它作为学习C语言系列教程的第一部分,为后续的深入学习奠定了坚实的基础。


