diff options
Diffstat (limited to 'mainwindow.cpp')
| -rw-r--r-- | mainwindow.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/mainwindow.cpp b/mainwindow.cpp new file mode 100644 index 0000000..94b879e --- /dev/null +++ b/mainwindow.cpp @@ -0,0 +1,39 @@ +#include "mainwindow.h" +#include "ui_mainwindow.h" + +MainWindow::MainWindow(QWidget *parent) : + QMainWindow(parent), + ui(new Ui::MainWindow) +{ + ui->setupUi(this); +} + +MainWindow::~MainWindow() +{ + delete ui; +} + +void MainWindow::on_action_Preferences_triggered() +{ + qDebug() << "Preferences called"; + DlgPreferences *tmp = new DlgPreferences(this); + + tmp->setHeight(size().height()); + tmp->setWidth(size().width()); + + if(tmp->exec()) + { + qDebug() << "DlgPreferences okay clicked."; + + int width = tmp->width(); + int height = tmp->height(); + + if(width >= 100 && width <= 800 && height >= 100 && height <= 800) + { + qDebug() << "Resizing QMainWindow."; + resize(width,height); + } + } + + delete tmp; +} |
