src/MainWindow.cpp

changeset 77
86a3277a7317
parent 76
93395c4d6c8d
child 78
3a6cba2dd05d
--- a/src/MainWindow.cpp	Sun Mar 20 21:24:13 2022 +0100
+++ b/src/MainWindow.cpp	Sun Mar 20 21:39:06 2022 +0100
@@ -314,8 +314,11 @@
 void MainWindow::fromProfileFerments()
 {
     qDebug() << Q_FUNC_INFO;
+    ui->mainStack->setCurrentIndex(-1);
+    ui->mainStack->removeWidget(ProfileFermentsWindow);
     delete ProfileFermentsWindow;
-    this->show();
+    setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) );
+    ui->menuBar->setVisible(true);
 }
 
 
@@ -323,9 +326,11 @@
 {
     qDebug() << Q_FUNC_INFO;
     ProfileFermentsWindow = new ProfileFerments(this);
-    QObject::connect(ProfileFermentsWindow, SIGNAL(firstWindow()), this, SLOT(fromProfileFerments()));
-    this->hide();    // Close the main window
-    ProfileFermentsWindow->show();  // Show a second window
+    int index = ui->mainStack->count();
+    ui->mainStack->addWidget(ProfileFermentsWindow);
+    ui->mainStack->setCurrentIndex(index);
+    setWindowTitle(QString("BMSapp - %1 - Fermentation Profiles").arg(VERSIONSTRING));
+    ui->menuBar->setVisible(false);
 }
 
 

mercurial