src/MainWindow.cpp

changeset 76
93395c4d6c8d
parent 75
5f953abbd73c
child 77
86a3277a7317
--- a/src/MainWindow.cpp	Sun Mar 20 20:59:05 2022 +0100
+++ b/src/MainWindow.cpp	Sun Mar 20 21:24:13 2022 +0100
@@ -291,8 +291,11 @@
 void MainWindow::fromProfileStyles()
 {
     qDebug() << Q_FUNC_INFO;
+    ui->mainStack->setCurrentIndex(-1);
+    ui->mainStack->removeWidget(ProfileStylesWindow);
     delete ProfileStylesWindow;
-    this->show();
+    setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) );
+    ui->menuBar->setVisible(true);
 }
 
 
@@ -300,9 +303,11 @@
 {
     qDebug() << Q_FUNC_INFO;
     ProfileStylesWindow = new ProfileStyles(this);
-    QObject::connect(ProfileStylesWindow, SIGNAL(firstWindow()), this, SLOT(fromProfileStyles()));
-    this->hide();    // Close the main window
-    ProfileStylesWindow->show();  // Show a second window
+    int index = ui->mainStack->count();
+    ui->mainStack->addWidget(ProfileStylesWindow);
+    ui->mainStack->setCurrentIndex(index);
+    setWindowTitle(QString("BMSapp - %1 - Styles Profiles").arg(VERSIONSTRING));
+    ui->menuBar->setVisible(false);
 }
 
 

mercurial