diff -r 22baafbf770d -r f8474f2c5db9 src/MainWindow.cpp --- a/src/MainWindow.cpp Fri Feb 11 16:00:06 2022 +0100 +++ b/src/MainWindow.cpp Sat Feb 12 21:24:43 2022 +0100 @@ -16,7 +16,9 @@ */ #include "MainWindow.h" #include "AboutDialog.h" +#include "InventorySuppliers.h" #include "../ui/ui_MainWindow.h" +#include "config.h" #include #include @@ -27,24 +29,48 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { + qDebug() << Q_FUNC_INFO; ui->setupUi(this); + + setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) ); } MainWindow::~MainWindow() { + qDebug() << Q_FUNC_INFO; delete ui; } void MainWindow::on_actionExit_triggered() { + qDebug() << Q_FUNC_INFO; this->close(); } +void MainWindow::fromInventorySuppliers() +{ + qDebug() << Q_FUNC_INFO; + delete InventorySuppliersWindow; + this->show(); +} + + +void MainWindow::on_actionSuppliers_triggered() +{ + 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 +} + + void MainWindow::on_actionAbout_triggered() { + qDebug() << Q_FUNC_INFO; AboutDialog dialog(this); dialog.setModal(true); dialog.exec();