src/MainWindow.cpp

changeset 71
5bd0d7be0167
parent 70
556b4202c5e7
child 72
7992c686e349
--- a/src/MainWindow.cpp	Sun Mar 20 16:49:50 2022 +0100
+++ b/src/MainWindow.cpp	Sun Mar 20 17:22:27 2022 +0100
@@ -162,8 +162,11 @@
 void MainWindow::fromInventoryMiscs()
 {
     qDebug() << Q_FUNC_INFO;
+    ui->mainStack->setCurrentIndex(-1);
+    ui->mainStack->removeWidget(InventoryMiscsWindow);
     delete InventoryMiscsWindow;
-    this->show();
+    setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) );
+    ui->menuBar->setVisible(true);
 }
 
 
@@ -171,9 +174,11 @@
 {
     qDebug() << Q_FUNC_INFO;
     InventoryMiscsWindow = new InventoryMiscs(this);
-    QObject::connect(InventoryMiscsWindow, SIGNAL(firstWindow()), this, SLOT(fromInventoryMiscs()));
-    this->hide();    // Close the main window
-    InventoryMiscsWindow->show();  // Show a second window
+    int index = ui->mainStack->count();
+    ui->mainStack->addWidget(InventoryMiscsWindow);
+    ui->mainStack->setCurrentIndex(index);
+    setWindowTitle(QString("BMSapp - %1 - Inventory Yeasts").arg(VERSIONSTRING));
+    ui->menuBar->setVisible(false);
 }
 
 

mercurial