Cppcheck
aboutdialog.cpp
Go to the documentation of this file.
1 /*
2  * Cppcheck - A tool for static C/C++ code analysis
3  * Copyright (C) 2007-2022 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 
19 #include "aboutdialog.h"
20 
21 #include "ui_about.h"
22 
23 #include <QDialogButtonBox>
24 #include <QLabel>
25 
26 AboutDialog::AboutDialog(const QString &version, const QString &extraVersion, QWidget *parent)
27  : QDialog(parent)
28  , mUI(new Ui::About)
29 {
30  mUI->setupUi(this);
31 
32  QString fmtVersion(version);
33  if (!extraVersion.isEmpty()) {
34  fmtVersion += " (" + extraVersion + ")";
35  }
36  mUI->mVersion->setText(mUI->mVersion->text().arg(fmtVersion));
37  QString date = __DATE__;
38  mUI->mCopyright->setText(mUI->mCopyright->text().arg(date.right(4)));
39  QString url = "<a href=\"https://cppcheck.sourceforge.io/\">https://cppcheck.sourceforge.io/</a>";
40  mUI->mHomepage->setText(mUI->mHomepage->text().arg(url));
41  connect(mUI->mButtons, &QDialogButtonBox::accepted, this, &AboutDialog::accept);
42 }
43 
45 {
46  delete mUI;
47 }
~AboutDialog() override
Definition: aboutdialog.cpp:44
AboutDialog(const QString &version, const QString &extraVersion, QWidget *parent=nullptr)
Definition: aboutdialog.cpp:26
Ui::About * mUI
Definition: aboutdialog.h:48
Definition: aboutdialog.h:27