src/MainWindow.cpp

changeset 64
b0d30697af67
parent 57
75d11cc05ce4
child 65
2ef981980daa
--- a/src/MainWindow.cpp	Sat Mar 19 10:30:56 2022 +0100
+++ b/src/MainWindow.cpp	Sat Mar 19 19:22:58 2022 +0100
@@ -65,8 +65,10 @@
 void MainWindow::fromInventorySuppliers()
 {
     qDebug() << Q_FUNC_INFO;
-    delete InventorySuppliersWindow;
-    this->show();
+//    delete InventorySuppliersWindow;
+    ui->mainStack->setCurrentIndex(0);
+    setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) );
+    qDebug() << "fromInventorySuppliers() done";
 }
 
 
@@ -74,9 +76,11 @@
 {
     qDebug() << Q_FUNC_INFO;
     InventorySuppliersWindow = new InventorySuppliers(this);
-    QObject::connect(InventorySuppliersWindow, SIGNAL(firstWindow()), this, SLOT(fromInventorySuppliers()));
-    this->hide();    // Close the main window
-    InventorySuppliersWindow->show();  // Show a second window
+//    QObject::connect(InventorySuppliersWindow, SIGNAL(firstWindow()), this, SLOT(fromInventorySuppliers()));
+    qDebug() << ui->mainStack->count();
+    ui->mainStack->setCurrentIndex(1);
+//    connect(InventorySuppliersWindow, SIGNAL(firstWindow()), this, SLOT(fromInventorySuppliers()));
+    setWindowTitle( QString("BMSapp - %1 - Inventory Suppliers").arg(VERSIONSTRING));
 }
 
 

mercurial