3 AboutDialog::AboutDialog(const char *iconFile, const char *title)
7 QHBoxLayout *mlayout = new QHBoxLayout();
8 QLabel *iconshow = new QLabel();
9 iconshow->setPixmap(QPixmap(iconFile));
11 rlayout = new QVBoxLayout();
12 mlayout->addWidget(iconshow);
13 mlayout->addLayout(rlayout);
17 void AboutDialog::setIntro(const QString &text)
19 // Place to the first item of rlayout
20 if (rlayout->count() == 0) {
21 // No item yet, add one
22 rlayout->addWidget(new QLabel(text));
25 // First item has existed, replace it.
26 QWidget *child = (QWidget *)rlayout->itemAt(0);
27 rlayout->removeWidget(child);
28 rlayout->insertWidget(0, new QLabel(text));
32 void AboutDialog::addAuthor(const QString &name)
34 // Place from the second item of rlayout
35 if (rlayout->count() == 0) {
36 // No first item, add empty one.
37 rlayout->addWidget(new QLabel(""));
39 // Add from the second
40 rlayout->addWidget(new QLabel(name));