/
QModeStart.cpp
36 lines (27 loc) · 890 Bytes
/
QModeStart.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
#include "QModeStart.h"
#include <QtGui/QLabel>
#include <QtGui/QPushButton>
QModeStart::QModeStart(QWidget *parent, QString modeTitle) :
QDialog(parent)
{
QVBoxLayout *layout = new QVBoxLayout();
if (modeTitle.length() > 0) {
QLabel *title = new QLabel(tr("<b>%1</b>").arg(modeTitle));
layout->addWidget(title);
}
// user specific middle
m_main = new QVBoxLayout();
layout->addLayout(m_main);
QHBoxLayout *hbox = new QHBoxLayout();
layout->addLayout(hbox);
QPushButton *ok = new QPushButton(tr("Ok"));
hbox->addWidget(ok);
connect(ok, SIGNAL(clicked()), this, SLOT(accept()));
QPushButton *noPlay = new QPushButton(tr("Don't Play"));
hbox->addWidget(noPlay);
connect(noPlay, SIGNAL(clicked()), this, SLOT(reject()));
setLayout(layout);
}
QVBoxLayout *QModeStart::mainLayout() {
return m_main;
}