X-Git-Url: https://vaikene.ee/gitweb/pswgen10.html?a=blobdiff_plain;f=src%2Fplugins%2FSdiWindow%2Fsdiwindow.cpp;h=4be6efe4f333b9b075db4e6dbdd6e2f52a38ccf5;hb=1cac301bb12de664bd7e7ec59b78e7dfaf04f6d1;hp=a804dfc14cc64dc70a8739612dc8decf3a0636a7;hpb=fc85345abea9becdd9aedfb1e0cf66d8843528fd;p=evaf
diff --git a/src/plugins/SdiWindow/sdiwindow.cpp b/src/plugins/SdiWindow/sdiwindow.cpp
index a804dfc..4be6efe 100644
--- a/src/plugins/SdiWindow/sdiwindow.cpp
+++ b/src/plugins/SdiWindow/sdiwindow.cpp
@@ -63,6 +63,10 @@ MainWindow::MainWindow(QWidget * parent, Qt::WindowFlags flags)
// Apply the size specified in a) properties; or b) on the command line
setWindowSize();
+ // Create the default layout
+ mLayout = new QVBoxLayout;
+ setLayout(mLayout);
+
EVAF_INFO("%s created", qPrintable(objectName()));
}
@@ -89,9 +93,25 @@ void MainWindow::done()
{
close();
+ // Delete all the items added to the main window
+ while (mItemsAdded.count() > 0)
+ delete mItemsAdded.takeAt(0);
+
EVAF_INFO("%s finalized", qPrintable(objectName()));
}
+void MainWindow::addWidget(QWidget * widget)
+{
+ mLayout->addWidget(widget);
+ mItemsAdded.append(widget);
+}
+
+void MainWindow::addLayout(QLayout * layout)
+{
+ mLayout->addLayout(layout);
+ mItemsAdded.append(layout);
+}
+
void MainWindow::saveSettings()
{
static int ver[4] = {VER_FILE_VERSION};