|
| 1 | +/* |
| 2 | + * Cppcheck - A tool for static C/C++ code analysis |
| 3 | + * Copyright (C) 2007-2009 Daniel Marjamäki and Cppcheck team. |
| 4 | + * |
| 5 | + * This program is free software: you can redistribute it and/or modify |
| 6 | + * it under the terms of the GNU General Public License as published by |
| 7 | + * the Free Software Foundation, either version 3 of the License, or |
| 8 | + * (at your option) any later version. |
| 9 | + * |
| 10 | + * This program is distributed in the hope that it will be useful, |
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | + * GNU General Public License for more details. |
| 14 | + * |
| 15 | + * You should have received a copy of the GNU General Public License |
| 16 | + * along with this program. If not, see <http://www.gnu.org/licenses/ |
| 17 | + */ |
| 18 | +#include <QDialog> |
| 19 | +#include <QVBoxLayout> |
| 20 | +#include <QHBoxLayout> |
| 21 | +#include <QLabel> |
| 22 | +#include <QPushButton> |
| 23 | +#include "aboutdialog.h" |
| 24 | + |
| 25 | +AboutDialog::AboutDialog(const QString &version, QWidget *parent) |
| 26 | + : QDialog(parent) |
| 27 | + , mVersion(version) |
| 28 | +{ |
| 29 | + setWindowTitle(tr("About cppcheck")); |
| 30 | + QVBoxLayout *mainLayout = new QVBoxLayout(this); |
| 31 | + QHBoxLayout *btnLayout = new QHBoxLayout(this); |
| 32 | + |
| 33 | + QLabel *name = new QLabel(tr("Cppcheck - A tool for static C/C++ code analysis.")); |
| 34 | + QLabel *ver = new QLabel(QString(tr("Version %1")).arg(mVersion)); |
| 35 | + QLabel *copy = new QLabel(("Copyright (C) 2007-2009 Daniel Marjamäki and cppcheck team.")); |
| 36 | + copy->setWordWrap(true); |
| 37 | + QLabel *gpl = new QLabel(tr("This program is licensed under the terms " \ |
| 38 | + "of the GNU General Public License version 3")); |
| 39 | + gpl->setWordWrap(true); |
| 40 | + QPushButton *quit = new QPushButton(tr("Close")); |
| 41 | + |
| 42 | + mainLayout->addWidget(name); |
| 43 | + mainLayout->addWidget(ver); |
| 44 | + mainLayout->addWidget(copy); |
| 45 | + mainLayout->addWidget(gpl); |
| 46 | + mainLayout->addStretch(); |
| 47 | + |
| 48 | + mainLayout->addLayout(btnLayout); |
| 49 | + btnLayout->addStretch(); |
| 50 | + btnLayout->addWidget(quit); |
| 51 | + |
| 52 | + connect(quit, SIGNAL(clicked()), this, SLOT(close())); |
| 53 | +} |
0 commit comments