-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstartdialog.cpp
57 lines (46 loc) · 1.12 KB
/
startdialog.cpp
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include "mainwindow.h"
#include "ui_startdialog.h"
// The constructor
StartDialog::StartDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::StartDialog)
{
ui->setupUi(this);
w = new MainWindow;
w->setAttribute(Qt::WA_DeleteOnClose);
QObject::connect(ui->newButton, SIGNAL(clicked()), w, SLOT(nproject()));
QObject::connect(ui->loadButton, SIGNAL(clicked()), w, SLOT(lproject()));
// Create folder for settings if does not exists.
QDir dir("./settings");
if (!dir.exists())
{
dir.mkpath(".");
}
}
// The destructor.
StartDialog::~StartDialog()
{
delete ui;
}
// Create a new project.
void StartDialog::on_newButton_clicked()
{
w->showMaximized();
this->close();
}
// Load a new project.
void StartDialog::on_loadButton_clicked()
{
w->showMaximized();
this->close();
}
// About dialog.
void StartDialog::on_aboutButton_clicked()
{
AboutDialog *a = new AboutDialog();
a->setAttribute(Qt::WA_DeleteOnClose);
Qt::WindowFlags flags;
flags = (Qt::WindowTitleHint | Qt::WindowCloseButtonHint);
a->setWindowFlags(flags);
a->exec();
}