src/MainWindow.cpp

changeset 65
2ef981980daa
parent 64
b0d30697af67
child 66
72386c164f54
--- a/src/MainWindow.cpp	Sat Mar 19 19:22:58 2022 +0100
+++ b/src/MainWindow.cpp	Sat Mar 19 22:59:11 2022 +0100
@@ -37,6 +37,9 @@
 #include <QDebug>
 #include <QStandardItem>
 #include <QWidget>
+#include <QtWidgets/QTableWidget>
+#include <QtWidgets/QGroupBox>
+#include <QtWidgets/QPushButton>
 
 
 MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent),  ui(new Ui::MainWindow)
@@ -65,8 +68,11 @@
 void MainWindow::fromInventorySuppliers()
 {
     qDebug() << Q_FUNC_INFO;
-//    delete InventorySuppliersWindow;
-    ui->mainStack->setCurrentIndex(0);
+    qDebug() << "fromInventorySuppliers() start";
+    ui->mainStack->setCurrentIndex(-1);
+    ui->mainStack->removeWidget(InventorySuppliersWindow);
+    qDebug() << ui->mainStack->count();
+    delete InventorySuppliersWindow;
     setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) );
     qDebug() << "fromInventorySuppliers() done";
 }
@@ -75,11 +81,11 @@
 void MainWindow::on_actionSuppliers_triggered()
 {
     qDebug() << Q_FUNC_INFO;
+
     InventorySuppliersWindow = new InventorySuppliers(this);
-//    QObject::connect(InventorySuppliersWindow, SIGNAL(firstWindow()), this, SLOT(fromInventorySuppliers()));
+    ui->mainStack->addWidget(InventorySuppliersWindow);
     qDebug() << ui->mainStack->count();
-    ui->mainStack->setCurrentIndex(1);
-//    connect(InventorySuppliersWindow, SIGNAL(firstWindow()), this, SLOT(fromInventorySuppliers()));
+    ui->mainStack->setCurrentIndex(2);
     setWindowTitle( QString("BMSapp - %1 - Inventory Suppliers").arg(VERSIONSTRING));
 }
 

mercurial