--- a/src/MainWindow.cpp Sun Mar 20 16:13:26 2022 +0100 +++ b/src/MainWindow.cpp Sun Mar 20 16:49:50 2022 +0100 @@ -139,8 +139,11 @@ void MainWindow::fromInventoryYeasts() { qDebug() << Q_FUNC_INFO; + ui->mainStack->setCurrentIndex(-1); + ui->mainStack->removeWidget(InventoryYeastsWindow); delete InventoryYeastsWindow; - this->show(); + setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) ); + ui->menuBar->setVisible(true); } @@ -148,9 +151,11 @@ { qDebug() << Q_FUNC_INFO; InventoryYeastsWindow = new InventoryYeasts(this); - QObject::connect(InventoryYeastsWindow, SIGNAL(firstWindow()), this, SLOT(fromInventoryYeasts())); - this->hide(); // Close the main window - InventoryYeastsWindow->show(); // Show a second window + int index = ui->mainStack->count(); + ui->mainStack->addWidget(InventoryYeastsWindow); + ui->mainStack->setCurrentIndex(index); + setWindowTitle(QString("BMSapp - %1 - Inventory Yeasts").arg(VERSIONSTRING)); + ui->menuBar->setVisible(false); }