【QT】野指针报错The inferior stopped because it received a signal from the Operating System.
运行的时候会崩溃,并提示如下错误:
Signal received
The inferior stopped because it received a signal from the Operating System.
Signal name : SIGSEGV
Signal meaning : Segmentation fault
这个错误说明程序中有野指针,断点以下很容易找出错误。
void PLCTempControl::on_actionHelp_triggered()
{QDialog *dialog = new QDialog();Ui::Dialog ui;ui.setupUi(dialog);dialog->setAttribute(Qt::WA_DeleteOnClose); // 关闭的时候deletedialog->setWindowTitle("通信协议");ui.tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch );// 自适应列宽ui.tableWidget->horizontalHeader()->setSectionResizeMode(2,QHeaderView::ResizeToContents );// 适应单元格内容ui.tableWidget->horizontalHeader()->setSectionResizeMode(3,QHeaderView::ResizeToContents );// 适应单元格内容ui.tableWidget->horizontalHeader()->setSectionResizeMode(4,QHeaderView::ResizeToContents );// 适应单元格内容dialog->show();
}
出错在指针
ui.tableWidget->horizontalHeader();
指针非空,但是调动 “->函数” 时会报错;
因为指针指向的对象是临时变量,临时变量会在其函数结束时即被释放。
故 m_pCurSldRels 变为了一个野指针,在其他调动 “->函数” 时会报错。
改正:不能用指针,就直接定义为对象
在使用信号--槽之前示例化(new)指针也可以解决
【QT】野指针报错The inferior stopped because it received a signal from the Operating System.相关推荐
- Qt 出现空指针错误:The inferior stopped because it received a signal from the Operating System
Qt 出现空指针错误:The inferior stopped because it received a signal from the Operating System 问题 程序运行的时候出现崩 ...
- [QT]The inferior stopped because it received a signal from the operating system 自己解决方法
[QT 编译] QT运行过程中遇到"The inferior stopped because it received a signal from the operating system.& ...
- QT报错:The inferior stopped because it received a signal from the Operating System.
QT运行报错 Signal received The inferior stopped because it received a signal from the Operating System. ...
- Qt ERROR : The inferior stopped because it received a signal from the operating system.
IDE Qt 5.14.1 - Qt Creator 4.11.0 (Community) 错误描述 编译并不报错,运行时程序崩溃(停止工作) 调试时错误提示(截图): 错误原因 通过指向QMenu对 ...
- 【QT】The inferior stopped because it received a signal from the operating system及opencv_gapi模块cmake错误
最近在学习一个使用opencv与qt以及其他一些外部库的项目,项目原本是使用opencv2编写的,项目最近要升级,要利用到opencv4版本以上的一些特性,比如opencv4的dnn模块.但整个从op ...
- Qt发布版本退出时错误处理“The inferior stopped because it received a signal from the operating system.”
Qt程序在debug和release下都可以正常运行:并且发布的release也可以运行:但是在点击关闭按键的时候,MainWindow会进入到析构函数中,然后会蹦出对话框,并提示如下错误: Sign ...
- Qt调试错误:The inferior stopped because it received a signal from the Operating System.SIGSEGV
现象: 调试时弹窗: Signal received The inferior stopped because it received a signal from the Operating Syst ...
- Linux-Qt--2--调试运行终止弹窗问题-The inferior stopped because it received a signal from the Operating System
问题一: The inferior stopped because it received a signal from the Operating System 断点调试: 问题分析:说明程序中有野指 ...
- The inferior stopped because it received a signal from the Operating System.
前景提要:要理解这个错误的根源: -------------- 根源:用户的指针指向了系统的内存区域: 表象:"程序异常结束" ".exe crashed" : ...
最新文章
- 多目标决策问题1.1.1:线性加权法——熵权法确定权重
- UNIX中的Select函数
- python堆排序算法_python 排序 堆排序
- publiccms按照指定显示的日期格式,格式化日期的写法
- c语言编程命令,C语言编程命令
- SQL索引管理器——用于SQL Server和Azure上的索引维护的免费GUI工具
- Xml序列化自引用/循环引用问题2
- 线程同步 互斥量(mutex) Linux函数
- 学习【阿里巴巴Java开发手册-嵩山版】
- 在线教育公司的硬件雄心:1秒查词,网易有道发布词典笔二代
- Codeforces 1299 题解
- python 开源cms内容管理系统_wagtail-基于Django构建的开源内容管理系统
- bpm js 计算 音乐_大量带BPM的跑步歌曲/跑步音乐下载
- 龙蜥操作系统 Anolis OS 8.6 - 来自阿里云的 CentOS 8 100% 兼容发行版
- 最后一天购书优惠!好书必买,不容错过!
- python 日期API
- 椭圆曲线ECC倍点运算forJava
- weka使用训练集分类测试集_技术分享
- FME转换LPK层文件到AUTOCAD报错
- 002数列极限的定义及数列的极限性质
热门文章
- C++常用 math 函数
- 微信停止为苹果服务器,在苹果开发者政策限制下微信终于宣布将在近期为iOS版微信增加暗黑模式-...
- 切换svn地址报错issuer is not trusted
- 网络知识汇总(1)-朗文和牛津英语词典网址
- 掌握生成对抗网络(GANs),召唤专属二次元老婆(老公)不是梦
- 信息化项目WBS实战总结
- COGS 2211. [BZOJ3653]谈笑风生
- margin: 0 auto;的作用
- java8 新特性 ibm_【Java8新特性】Streams(流)
- Zabbix自动发现规则