3 AboutDialog::AboutDialog(const char *iconFile, const QString &title)
6 setWindowTitle("About");
7 QHBoxLayout *mlayout = new QHBoxLayout();
8 QLabel *iconshow = new QLabel();
9 iconshow->setPixmap(QPixmap(iconFile));
10 mlayout->addWidget(iconshow);
12 rlayout = new QVBoxLayout();
13 QLabel *tit = new QLabel(title);
14 tit->setStyleSheet("QLabel {font-size: 40px}");
15 rlayout->addWidget(tit);
16 mlayout->addLayout(rlayout);
20 void AboutDialog::setIntro(const QString &text)
22 // Place to the second item of rlayout
23 if (rlayout->count() == 1) {
24 // No item yet, add one
25 rlayout->addWidget(new QLabel(text));
28 // Second item has existed, replace it.
29 QWidget *child = (QWidget *)rlayout->takeAt(0);
31 rlayout->insertWidget(0, new QLabel(text));
35 void AboutDialog::addAuthor(const QString &name)
37 // Place from the third item of rlayout
38 if (rlayout->count() == 1) {
39 // No second item, add empty one.
40 rlayout->addWidget(new QLabel(""));
43 rlayout->addWidget(new QLabel(name));