199
|
1 #include "aboutdialog.h" |
|
2 #include <QDebug> |
|
3 #include <QVBoxLayout> |
|
4 #include <QTextEdit> |
|
5 #include <QPushButton> |
|
6 |
|
7 AboutDialog::AboutDialog(QMainWindow *parent) : |
|
8 QDialog(parent) |
|
9 { |
|
10 setupGUI(); |
|
11 } |
|
12 |
|
13 void AboutDialog::setupGUI() |
|
14 { |
|
15 QVBoxLayout *mainLayout = new QVBoxLayout(this); |
|
16 QTextEdit *helpText = new QTextEdit; |
|
17 helpText->setReadOnly(true); |
|
18 helpText->setPlainText(tr("This dialog contains some text about the application")); |
|
19 |
|
20 QHBoxLayout *buttonLayout = new QHBoxLayout; |
|
21 QPushButton *closeButton = new QPushButton(tr("Close")); |
|
22 connect(closeButton, SIGNAL(clicked()), this, SLOT(close())); |
|
23 buttonLayout->insertStretch(0, 10); |
|
24 buttonLayout->addWidget(closeButton); |
|
25 |
|
26 mainLayout->addWidget(helpText); |
|
27 mainLayout->addLayout(buttonLayout); |
|
28 } |