Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/about.cpp
Show All 26 Lines | |||||
27 | #include "about.h" | 27 | #include "about.h" | ||
28 | 28 | | |||
29 | About::About(QWidget *parent) : | 29 | About::About(QWidget *parent) : | ||
30 | QDialog(parent) | 30 | QDialog(parent) | ||
31 | { | 31 | { | ||
32 | setWindowTitle(QStringLiteral("About Atcore")); | 32 | setWindowTitle(QStringLiteral("About Atcore")); | ||
33 | setWindowIcon(QIcon::fromTheme(QStringLiteral("help-about"), style()->standardIcon(QStyle::SP_MessageBoxInformation))); | 33 | setWindowIcon(QIcon::fromTheme(QStringLiteral("help-about"), style()->standardIcon(QStyle::SP_MessageBoxInformation))); | ||
34 | 34 | | |||
35 | QLabel *lbl_version = new QLabel(tr("Version: %1").arg(QCoreApplication::applicationVersion())); | 35 | auto lbl_version = new QLabel(tr("Version: %1").arg(QCoreApplication::applicationVersion()), this); | ||
36 | QLabel *lbl_qt_version = new QLabel(tr("Using Qt: %1").arg(QString::fromLatin1(qVersion()))); | 36 | auto lbl_qt_version = new QLabel(tr("Using Qt: %1").arg(QString::fromLatin1(qVersion())), this); | ||
37 | QLabel *lbl_authors = new QLabel(tr("Authors:\n" | 37 | auto lbl_authors = new QLabel(tr("Authors:\n" | ||
patrickelectric: (str, this) | |||||
38 | " Chris Rizzitello <rizzitello@kde.org>\n" | 38 | " Chris Rizzitello <rizzitello@kde.org>\n" | ||
39 | " Patrick José Pereira <patrickjp@kde.org>\n" | 39 | " Patrick José Pereira <patrickjp@kde.org>\n" | ||
40 | " Lays Rodrigues <lays.rodrigues@kde.org>\n" | 40 | " Lays Rodrigues <lays.rodrigues@kde.org>\n" | ||
41 | " Tomaz Canabrava <tcanabrava@kde.org>" | 41 | " Tomaz Canabrava <tcanabrava@kde.org>" | ||
42 | "")); | 42 | ""), this); | ||
43 | 43 | | |||
44 | QLabel *lbl_icon = new QLabel(); | 44 | auto lbl_icon = new QLabel(this); | ||
45 | lbl_icon->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); | 45 | lbl_icon->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); | ||
46 | lbl_icon->setScaledContents(true); | 46 | lbl_icon->setScaledContents(true); | ||
47 | lbl_icon->setPixmap(QPixmap(QStringLiteral(":/icon/atcore"))); | 47 | lbl_icon->setPixmap(QPixmap(QStringLiteral(":/icon/atcore"))); | ||
48 | 48 | | |||
49 | QPushButton *btn_close = new QPushButton(tr("Close")); | 49 | auto btn_close = new QPushButton(tr("Close"), this); | ||
50 | connect(btn_close, &QPushButton::clicked, this, &QDialog::close); | 50 | connect(btn_close, &QPushButton::clicked, this, &QDialog::close); | ||
51 | 51 | | |||
52 | QVBoxLayout *versionInfo = new QVBoxLayout; | 52 | auto versionInfo = new QVBoxLayout; | ||
53 | versionInfo->addWidget(lbl_version); | 53 | versionInfo->addWidget(lbl_version); | ||
54 | versionInfo->addWidget(lbl_qt_version); | 54 | versionInfo->addWidget(lbl_qt_version); | ||
55 | 55 | | |||
56 | QVBoxLayout *topLayout = new QVBoxLayout; | 56 | auto topLayout = new QVBoxLayout; | ||
patrickelectric: this | |||||
57 | topLayout->setContentsMargins(0, 0, 0, 0); | 57 | topLayout->setContentsMargins(0, 0, 0, 0); | ||
58 | topLayout->addWidget(lbl_icon); | 58 | topLayout->addWidget(lbl_icon); | ||
59 | topLayout->addItem(versionInfo); | 59 | topLayout->addItem(versionInfo); | ||
60 | 60 | | |||
61 | QVBoxLayout *mainLayout = new QVBoxLayout; | 61 | auto mainLayout = new QVBoxLayout; | ||
62 | mainLayout->addItem(topLayout); | 62 | mainLayout->addItem(topLayout); | ||
63 | mainLayout->addWidget(lbl_authors); | 63 | mainLayout->addWidget(lbl_authors); | ||
64 | mainLayout->addWidget(btn_close); | 64 | mainLayout->addWidget(btn_close); | ||
65 | 65 | | |||
66 | setLayout(mainLayout); | 66 | setLayout(mainLayout); | ||
67 | } | 67 | } | ||
68 | | ||||
69 | About::~About() | | |||
70 | { | | |||
71 | | ||||
72 | } | |
(str, this)