src/MainWindow.cpp

changeset 6
f8474f2c5db9
parent 4
fe106c497b75
child 15
c58b82549713
--- 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 <QApplication>
 #include <QCloseEvent>
@@ -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();

mercurial