2 * Copyright (C) 2007 Benjamin C. Meyer
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 #include "aboutdialog.h"
23 #include <qapplication.h>
26 AboutDialog::AboutDialog(QWidget
*parent
) : QDialog(parent
) {
27 setWindowTitle(tr("About") + QString(" %1").arg(qApp
->applicationName()));
29 logo
->setPixmap(qApp
->windowIcon().pixmap(128, 128));
30 logo
->setAlignment(Qt::AlignCenter
);
32 name
= new QLabel(qApp
->applicationName());
33 QFont font
= name
->font();
36 name
->setAlignment(Qt::AlignHCenter
);
38 version
= new QLabel();
39 version
->setAlignment(Qt::AlignHCenter
);
41 layout
= new QVBoxLayout();
42 layout
->addWidget(logo
);
43 layout
->addWidget(name
);
44 layout
->addWidget(version
);
46 layout
->insertStretch(-1, 1);
50 void AboutDialog::setVersion(const QString
&versionText
) {
51 version
->setText(versionText
);
54 void AboutDialog::addAuthors(const QStringList
&list
) {
55 for (int i
= list
.count() - 1; i
>= 0; --i
) {
56 QLabel
*author
= new QLabel(list
.at(i
), this);
57 author
->setOpenExternalLinks(true);
58 author
->setTextInteractionFlags(Qt::LinksAccessibleByMouse
);
59 author
->setAlignment(Qt::AlignHCenter
);
60 layout
->insertWidget(3, author
);