From 74d0a4a6f634010db71d05536cffef15bfb1edd9 Mon Sep 17 00:00:00 2001 From: Stefan Suhren Date: Sun, 29 Mar 2015 19:11:23 +0200 Subject: Initial Commit --- mainwindow.cpp | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 mainwindow.cpp (limited to 'mainwindow.cpp') 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; +} -- cgit v1.2.3-70-g09d2