Skip to content
Snippets Groups Projects
Commit a1172de0 authored by Andreas Schenk's avatar Andreas Schenk
Browse files

deleting MDI subwindows on closing to avoid having empty MDI subwindow shells floating around

parent 48eb8494
Branches
Tags
No related merge requests found
......@@ -115,10 +115,12 @@ void MainArea::EnableTabbedMode(bool tm)
void MainArea::AddWidget(const QString& title, QWidget* widget)
{
QMdiSubWindow* mdi=new QMdiSubWindow(this);
mdi->setAttribute(Qt::WA_DeleteOnClose);
mdi->setWindowTitle(title);
mdi->setWidget(widget);
widget->setParent(mdi);
this->addSubWindow(mdi);
connect(widget, SIGNAL(destroyed()), mdi, SLOT(close()));
mdi->show();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment