src/MainWindow.cpp

changeset 69
228cb2a01acf
parent 68
abac28effb21
child 70
556b4202c5e7
--- a/src/MainWindow.cpp	Sun Mar 20 15:51:09 2022 +0100
+++ b/src/MainWindow.cpp	Sun Mar 20 16:13:26 2022 +0100
@@ -116,8 +116,11 @@
 void MainWindow::fromInventoryHops()
 {
     qDebug() << Q_FUNC_INFO;
+    ui->mainStack->setCurrentIndex(-1);
+    ui->mainStack->removeWidget(InventoryHopsWindow);
     delete InventoryHopsWindow;
-    this->show();
+    setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) );
+    ui->menuBar->setVisible(true);
 }
 
 
@@ -125,9 +128,11 @@
 {
     qDebug() << Q_FUNC_INFO;
     InventoryHopsWindow = new InventoryHops(this);
-    QObject::connect(InventoryHopsWindow, SIGNAL(firstWindow()), this, SLOT(fromInventoryHops()));
-    this->hide();    // Close the main window
-    InventoryHopsWindow->show();  // Show a second window
+    int index = ui->mainStack->count();
+    ui->mainStack->addWidget(InventoryHopsWindow);
+    ui->mainStack->setCurrentIndex(index);
+    setWindowTitle(QString("BMSapp - %1 - Inventory Hops").arg(VERSIONSTRING));
+    ui->menuBar->setVisible(false);
 }
 
 

mercurial