src/MainWindow.cpp

changeset 15
c58b82549713
parent 6
f8474f2c5db9
child 16
a5d8e783a7b0
--- a/src/MainWindow.cpp	Wed Feb 16 16:29:42 2022 +0100
+++ b/src/MainWindow.cpp	Wed Feb 16 22:11:29 2022 +0100
@@ -17,6 +17,7 @@
 #include "MainWindow.h"
 #include "AboutDialog.h"
 #include "InventorySuppliers.h"
+#include "Setup.h"
 #include "../ui/ui_MainWindow.h"
 #include "config.h"
 
@@ -68,6 +69,24 @@
 }
 
 
+void MainWindow::fromSetup()
+{
+    qDebug() << Q_FUNC_INFO;
+    delete SetupWindow;
+    this->show();
+}
+
+
+void MainWindow::on_actionSetup_triggered()
+{
+    qDebug() << Q_FUNC_INFO;
+    SetupWindow = new Setup(this);
+    QObject::connect(SetupWindow, SIGNAL(firstWindow()), this, SLOT(fromSetup()));
+    this->hide();    // Close the main window
+    SetupWindow->show();  // Show a second window
+}
+
+
 void MainWindow::on_actionAbout_triggered()
 {
     qDebug() << Q_FUNC_INFO;

mercurial