diff --git a/src/widgets/about.cpp b/src/widgets/about.cpp index 5f06450..36269ad 100644 --- a/src/widgets/about.cpp +++ b/src/widgets/about.cpp @@ -1,72 +1,67 @@ /* AtCore Test Client Copyright (C) <2017> Authors: Chris Rizzitello This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include #include #include #include #include #include #include "about.h" About::About(QWidget *parent) : QDialog(parent) { setWindowTitle(QStringLiteral("About Atcore")); setWindowIcon(QIcon::fromTheme(QStringLiteral("help-about"), style()->standardIcon(QStyle::SP_MessageBoxInformation))); - QLabel *lbl_version = new QLabel(tr("Version: %1").arg(QCoreApplication::applicationVersion())); - QLabel *lbl_qt_version = new QLabel(tr("Using Qt: %1").arg(QString::fromLatin1(qVersion()))); - QLabel *lbl_authors = new QLabel(tr("Authors:\n" - " Chris Rizzitello \n" - " Patrick José Pereira \n" - " Lays Rodrigues \n" - " Tomaz Canabrava " - "")); + auto lbl_version = new QLabel(tr("Version: %1").arg(QCoreApplication::applicationVersion()), this); + auto lbl_qt_version = new QLabel(tr("Using Qt: %1").arg(QString::fromLatin1(qVersion())), this); + auto lbl_authors = new QLabel(tr("Authors:\n" + " Chris Rizzitello \n" + " Patrick José Pereira \n" + " Lays Rodrigues \n" + " Tomaz Canabrava " + ""), this); - QLabel *lbl_icon = new QLabel(); + auto lbl_icon = new QLabel(this); lbl_icon->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); lbl_icon->setScaledContents(true); lbl_icon->setPixmap(QPixmap(QStringLiteral(":/icon/atcore"))); - QPushButton *btn_close = new QPushButton(tr("Close")); + auto btn_close = new QPushButton(tr("Close"), this); connect(btn_close, &QPushButton::clicked, this, &QDialog::close); - QVBoxLayout *versionInfo = new QVBoxLayout; + auto versionInfo = new QVBoxLayout; versionInfo->addWidget(lbl_version); versionInfo->addWidget(lbl_qt_version); - QVBoxLayout *topLayout = new QVBoxLayout; + auto topLayout = new QVBoxLayout; topLayout->setContentsMargins(0, 0, 0, 0); topLayout->addWidget(lbl_icon); topLayout->addItem(versionInfo); - QVBoxLayout *mainLayout = new QVBoxLayout; + auto mainLayout = new QVBoxLayout; mainLayout->addItem(topLayout); mainLayout->addWidget(lbl_authors); mainLayout->addWidget(btn_close); setLayout(mainLayout); } - -About::~About() -{ - -} diff --git a/src/widgets/about.h b/src/widgets/about.h index c6d6b32..e6b8be3 100644 --- a/src/widgets/about.h +++ b/src/widgets/about.h @@ -1,39 +1,39 @@ /* AtCore Test Client Copyright (C) <2017> Authors: Chris Rizzitello This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifndef ABOUT_H #define ABOUT_H #include #include "atcorewidgets_export.h" /** * @brief An About AtCore dialog. */ class ATCOREWIDGETS_EXPORT About : public QDialog { Q_OBJECT public: explicit About(QWidget *parent = 0); - ~About(); + ~About() = default; }; #endif // ABOUT_H