-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnewgame.cpp
38 lines (32 loc) · 993 Bytes
/
newgame.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
#include <QtWidgets>
#include "newgame.h"
NewGame::NewGame(QWidget *parent)
:QDialog(parent)
{
setupUi(this);
mediumRadio->setChecked(true);
columnSpinBox->setRange(2, 99);
columnSpinBox->setValue(4);
rowSpinBox->setRange(2, 99);
rowSpinBox->setValue(4);
secondaryGroupBox->hide();
tertiaryGroupBox->hide();
fileNameLabel->hide();
classicType->setChecked(true);
fileName = QString(":/images/images/classic.png");
connect(browseButton, SIGNAL(clicked()), this, SLOT(imageBrowse()));
connect(columnSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setColumn(int)));
layout()->setSizeConstraint(QLayout::SetFixedSize);
}
void NewGame::imageBrowse()
{
QFileDialog dialog(this);
dialog.setNameFilter(tr("Images (*.png *.jpg *.xpm)"));
if(dialog.exec())
{
QStringList result = dialog.selectedFiles();
fileName = result[0];
fileNameLabel->setText(fileName);
fileNameLabel->show();
}
}