The program has unexpectedly finished.解决方法

简介: 一般出现上述错误是因为控件没有进行实例化,错误案例如下:

一般出现上述错误是因为控件没有进行实例化,错误案例如下:

widget.h文件中:

...  
private:
    QLabel *label;
...

widget.cpp 文件中:

...
label->setText(tr("dsadsa"));
...
上述在cpp文件中, label 没有进行实例化,从而导致程序报错,解决方法在 widget.cpp文件中对 label 进行实例化即可;

widget.cpp 文件如下:

...
label = new QLabel(this);
label->setText(tr("dsadsa"));
...

new 一个即可!

相关文章
|
7月前
|
数据库 数据库管理
【异常解决】svn报“Previous operation has not finished; run ‘cleanup‘ if it was interrupted”的错误解决方案
【异常解决】svn报“Previous operation has not finished; run ‘cleanup‘ if it was interrupted”的错误解决方案
182 0
|
6天前
|
NoSQL C语言
vscode出现 ERROR: Unable to start debugging. Unexpected GDB output from command “-exec-run“.
vscode出现 ERROR: Unable to start debugging. Unexpected GDB output from command “-exec-run“.
503 0
|
10月前
|
Android开发
Failed to obtain GLES 2.x extensions striProcess finished with exit code -1073741819 (0xC0000005)
android studio打开虚拟机时报错信息,解决办法之一(我成功的办法,其他方法试了没用), 打开 设备管理器然后找到你的独显,然后禁用设备,然后再次启动设备就行了,最后再启动你的虚拟机就行了。
88 0
|
Python
pychram中提示:Process finished with exit code 0
"Process finished with exit code 0" 是PyCharm中的提示信息,表示程序已经成功地执行完毕并且没有发生任何错误。在PyCharm中,当程序正常终止并返回退出代码0时,这个消息会在控制台中显示。 在PyCharm中运行程序时,它会在一个单独的进程中执行,当程序完成执行后,它会向操作系统返回一个退出代码。退出代码0表示程序成功执行完毕,而非零的退出代码通常表示错误或异常终止。 当出现"Process finished with exit code 0"的提示时,意味着你的程序已经成功地执行完毕,没有发生任何错误或异常情况。你可以通过检查程序输出或任何其他预
1251 0
Error:svn:E155037:Previous operation has not finished; run ‘cleanup‘ if it was interrupted(完美解决)
Error:svn:E155037:Previous operation has not finished; run ‘cleanup‘ if it was interrupted(完美解决)
303 0
Error:svn:E155037:Previous operation has not finished; run ‘cleanup‘ if it was interrupted(完美解决)
|
计算机视觉
Qt 配置好OpenCV运行报错 The process was ended forcefully. exe Crashed.
Qt 配置好OpenCV运行报错 The process was ended forcefully. exe Crashed.
418 0
Qt 配置好OpenCV运行报错 The process was ended forcefully. exe Crashed.
TortoiseSVN报错:“Previous operation has not finished; run 'clean up' if it was interrupted“ 的解决方法
TortoiseSVN报错:“Previous operation has not finished; run 'clean up' if it was interrupted“ 的解决方法
271 0
TortoiseSVN报错:“Previous operation has not finished; run 'clean up' if it was interrupted“ 的解决方法
svn报错:“Previous operation has not finished; run ‘cleanup‘ if it was interrupted“ 的解决办法
svn报错:“Previous operation has not finished; run ‘cleanup‘ if it was interrupted“ 的解决办法
224 0
svn报错:“Previous operation has not finished; run ‘cleanup‘ if it was interrupted“ 的解决办法