X-Git-Url: https://vaikene.ee/gitweb/pswgen09.html?a=blobdiff_plain;ds=sidebyside;f=src%2Fplugins%2FSdiWindow%2Fsdiwindow.cpp;h=aa264de0362658deacd5b22e587cd5f6d56abee5;hb=54f282ee6797c05e60993632218875092362bdf7;hp=aba9ce2041502ac51fed5f2a5aa04d9cc4be01bf;hpb=0957525838e501a4609a15b8d7a765da43362025;p=evaf
diff --git a/src/plugins/SdiWindow/sdiwindow.cpp b/src/plugins/SdiWindow/sdiwindow.cpp
index aba9ce2..aa264de 100644
--- a/src/plugins/SdiWindow/sdiwindow.cpp
+++ b/src/plugins/SdiWindow/sdiwindow.cpp
@@ -106,26 +106,20 @@ void MainWindow::done()
close();
- // Delete all the items added to the main window
- while (mItemsAdded.count() > 0) {
- QWeakPointer item = mItemsAdded.takeAt(0);
- if (!item.isNull())
- delete item.data();
- }
+ // Delete the window
+ if (mWindow)
+ delete mWindow.data();
EVAF_INFO("%s finalized", qPrintable(objectName()));
}
-void MainWindow::addWidget(QWidget * widget)
-{
- mLayout->addWidget(widget);
- mItemsAdded.append(widget);
-}
-
-void MainWindow::addLayout(QLayout * layout)
+void MainWindow::addWindow(Gui::Window * window)
{
- mLayout->addLayout(layout);
- mItemsAdded.append(layout);
+ // Delete the existing window
+ if (mWindow)
+ delete mWindow.data();
+ mLayout->addWidget(window);
+ mWindow = window;
}
void MainWindow::saveSettings()