src/MainWindow.cpp

changeset 6
f8474f2c5db9
parent 4
fe106c497b75
child 15
c58b82549713
equal deleted inserted replaced
5:22baafbf770d 6:f8474f2c5db9
14 * You should have received a copy of the GNU General Public License 14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>. 15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */ 16 */
17 #include "MainWindow.h" 17 #include "MainWindow.h"
18 #include "AboutDialog.h" 18 #include "AboutDialog.h"
19 #include "InventorySuppliers.h"
19 #include "../ui/ui_MainWindow.h" 20 #include "../ui/ui_MainWindow.h"
21 #include "config.h"
20 22
21 #include <QApplication> 23 #include <QApplication>
22 #include <QCloseEvent> 24 #include <QCloseEvent>
23 #include <QDebug> 25 #include <QDebug>
24 #include <QStandardItem> 26 #include <QStandardItem>
25 #include <QWidget> 27 #include <QWidget>
26 28
27 29
28 MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) 30 MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow)
29 { 31 {
32 qDebug() << Q_FUNC_INFO;
30 ui->setupUi(this); 33 ui->setupUi(this);
34
35 setWindowTitle( QString("BMSapp - %1").arg(VERSIONSTRING) );
31 } 36 }
32 37
33 38
34 MainWindow::~MainWindow() 39 MainWindow::~MainWindow()
35 { 40 {
41 qDebug() << Q_FUNC_INFO;
36 delete ui; 42 delete ui;
37 } 43 }
38 44
39 45
40 void MainWindow::on_actionExit_triggered() 46 void MainWindow::on_actionExit_triggered()
41 { 47 {
48 qDebug() << Q_FUNC_INFO;
42 this->close(); 49 this->close();
50 }
51
52
53 void MainWindow::fromInventorySuppliers()
54 {
55 qDebug() << Q_FUNC_INFO;
56 delete InventorySuppliersWindow;
57 this->show();
58 }
59
60
61 void MainWindow::on_actionSuppliers_triggered()
62 {
63 qDebug() << Q_FUNC_INFO;
64 InventorySuppliersWindow = new InventorySuppliers(this);
65 QObject::connect(InventorySuppliersWindow, SIGNAL(firstWindow()), this, SLOT(fromInventorySuppliers()));
66 this->hide(); // Close the main window
67 InventorySuppliersWindow->show(); // Show a second window
43 } 68 }
44 69
45 70
46 void MainWindow::on_actionAbout_triggered() 71 void MainWindow::on_actionAbout_triggered()
47 { 72 {
73 qDebug() << Q_FUNC_INFO;
48 AboutDialog dialog(this); 74 AboutDialog dialog(this);
49 dialog.setModal(true); 75 dialog.setModal(true);
50 dialog.exec(); 76 dialog.exec();
51 } 77 }
52 78

mercurial