src/MainWindow.cpp

changeset 73
ebd2fc719b1a
parent 72
7992c686e349
child 74
4ac38457a709
--- a/src/MainWindow.cpp	Sun Mar 20 17:33:18 2022 +0100
+++ b/src/MainWindow.cpp	Sun Mar 20 19:44:32 2022 +0100
@@ -208,8 +208,11 @@
 void MainWindow::fromInventoryEquipments()
 {
     qDebug() << Q_FUNC_INFO;
+    ui->mainStack->setCurrentIndex(-1);
+    ui->mainStack->removeWidget(InventoryEquipmentsWindow);
     delete InventoryEquipmentsWindow;
-    this->show();
+    setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) );
+    ui->menuBar->setVisible(true);
 }
 
 
@@ -217,9 +220,11 @@
 {
     qDebug() << Q_FUNC_INFO;
     InventoryEquipmentsWindow = new InventoryEquipments(this);
-    QObject::connect(InventoryEquipmentsWindow, SIGNAL(firstWindow()), this, SLOT(fromInventoryEquipments()));
-    this->hide();    // Close the main window
-    InventoryEquipmentsWindow->show();  // Show a second window
+    int index = ui->mainStack->count();
+    ui->mainStack->addWidget(InventoryEquipmentsWindow);
+    ui->mainStack->setCurrentIndex(index);
+    setWindowTitle(QString("BMSapp - %1 - Inventory Equipments").arg(VERSIONSTRING));
+    ui->menuBar->setVisible(false);
 }
 
 

mercurial