]> vaikene.ee Git - evaf/blobdiff - src/apps/PswGen/GUI/gui.cpp
Changed the way how the main window is used.
[evaf] / src / apps / PswGen / GUI / gui.cpp
index f29c4aee6b7620e88ad003474ff4cdbe4ca5bbd6..23a3c881c2591c82d5f3a4f81a0c2051e9d9672f 100644 (file)
@@ -74,8 +74,11 @@ bool Module::init(QString const & args)
     SdiWindow::iSdiWindow * win = evafQueryInterface<SdiWindow::iSdiWindow>("iSdiWindow");
     EVAF_TEST_X(win, "No iSdiWindow interface");
 
+    QWidget * masterWidget = new QWidget;
+    win->addWidget(masterWidget);
+
     QVBoxLayout * v = new QVBoxLayout;
-    win->widget()->setLayout(v);
+    masterWidget->setLayout(v);
 
     QGridLayout * g = new QGridLayout;
     v->addLayout(g);
@@ -105,7 +108,7 @@ bool Module::init(QString const & args)
     }
     connect(wName, SIGNAL(textChanged(QString)), this, SLOT(textChanged(QString)));
     g->addWidget(wName, 1, 1, 1, 2);
-    win->widget()->setFocusProxy(wName);
+    masterWidget->setFocusProxy(wName);
 
     l = new QLabel(tr("&Length of the password:", VER_MODULE_NAME_STR));
     l->setAlignment(Qt::AlignRight);
@@ -143,15 +146,15 @@ bool Module::init(QString const & args)
     connect(wCopy, SIGNAL(clicked()), this, SLOT(copyClicked()));
     h->addWidget(wCopy);
 
-    QAction * a = new QAction(win->widget());
+    QAction * a = new QAction(masterWidget);
     a->setShortcut(Qt::Key_Return);
     connect(a, SIGNAL(triggered()), this, SLOT(generateClicked()));
-    win->widget()->addAction(a);
+    masterWidget->addAction(a);
 
-    a = new QAction(win->widget());
+    a = new QAction(masterWidget);
     a->setShortcut(Qt::Key_Escape);
     connect(a, SIGNAL(triggered()), qApp, SLOT(quit()));
-    win->widget()->addAction(a);
+    masterWidget->addAction(a);
 
     mReady = true;