-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstartdialog.cpp
75 lines (59 loc) · 1.24 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#include "startdialog.h"
#include "ui_startdialog.h"
#include <QMessageBox>
#include <QFileDialog>
StartDialog::StartDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::StartDialog)
{
ui->setupUi(this);
this->setModal(true);
}
StartDialog::~StartDialog()
{
delete ui;
}
void StartDialog::accept()
{
this->width = ui->width_spin->value();
this->height = ui->height_spin->value();
this->sceneFile = ui->filename_edit->text();
if(this->sceneFile=="")
QMessageBox::warning(this, "Erro", "Informe uma cena!");
else
QDialog::accept();
}
QString StartDialog::getSceneFile() const
{
return sceneFile;
}
void StartDialog::setSceneFile(const QString &value)
{
sceneFile = value;
}
int StartDialog::getWidth() const
{
return width;
}
void StartDialog::setWidth(int value)
{
width = value;
}
int StartDialog::getHeight() const
{
return height;
}
void StartDialog::setHeight(int value)
{
height = value;
}
void StartDialog::closeEvent(QCloseEvent *e)
{
exit(0);
}
void StartDialog::on_pushButton_clicked()
{
QString selfilter = tr("RT Files (*.rt)");
QString fileName = QFileDialog::getOpenFileName(this,"Abrir cena", "",selfilter);
ui->filename_edit->setText(fileName);
}