1、界面假死在继承Qwidget的界面添加:
void showEvent(QShowEvent *event)
{
this->setAttribute(Qt::WA_Mapped);
QWidget::showEvent(event);
QSize oldSize = this->size();
resize(oldSize + QSize(10, 10));
resize(oldSize);
}
2、主窗口关闭子窗口也关闭,子界面添加:
setAttribute(Qt::WA_QuitOnClose, false);