blob: 94b879e5558fdeb076cc67d0a97ff8d4d3f864b8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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;
}
|