在析构函数执行完成后引发异常,程序崩溃
造成异常的原因
在布局添加QSpacerItem 引起的异常,使用try...catch无法捕获
cpp
QSpacerItem *spacer = new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Fixed);
QHBoxLayout *hLayout2 = new QHBoxLayout;
hLayout2->addWidget(typeLabel);
hLayout2->addWidget(targetTypeBox);
hLayout2->addSpacerItem(spacer);
hLayout2->addWidget(nameLabel);
hLayout2->addWidget(boomNameBox);
hLayout2->addSpacerItem(spacer);
hLayout2->addWidget(degreeLabel);
hLayout2->addWidget(degreeBox);
hLayout2->addSpacerItem(spacer);
hLayout2->addWidget(editMenuBtn[5]);
hLayout2->addWidget(editMenuBtn[6]);
Tips
还未能搞清楚为啥添加弹簧后会出现这个异常,暂时只能在布局删掉QSpacerItem