From 9f746d203b6af51431587c38f81870b83cc3081f Mon Sep 17 00:00:00 2001 From: blue Date: Mon, 4 Apr 2022 23:49:01 +0300 Subject: [PATCH] new tab in About: components --- ui/widgets/about.cpp | 15 +- ui/widgets/about.h | 1 + ui/widgets/about.ui | 317 +++++++++++++++++++++++++++++++++++++------ 3 files changed, 289 insertions(+), 44 deletions(-) diff --git a/ui/widgets/about.cpp b/ui/widgets/about.cpp index 4631065..3366284 100644 --- a/ui/widgets/about.cpp +++ b/ui/widgets/about.cpp @@ -16,13 +16,26 @@ #include "about.h" #include "ui_about.h" +#include + +static const std::string QXMPP_VERSION_PATCH(std::to_string(QXMPP_VERSION & 0xff)); +static const std::string QXMPP_VERSION_MINOR(std::to_string((QXMPP_VERSION & 0xff00) >> 8)); +static const std::string QXMPP_VERSION_MAJOR(std::to_string(QXMPP_VERSION >> 16)); +static const QString QXMPP_VERSION_STRING = QString::fromStdString(QXMPP_VERSION_MAJOR + "." + QXMPP_VERSION_MINOR + "." + QXMPP_VERSION_PATCH); About::About(QWidget* parent): QWidget(parent), - m_ui(new Ui::About) + m_ui(new Ui::About), + license(nullptr) { m_ui->setupUi(this); m_ui->versionValue->setText(QApplication::applicationVersion()); + m_ui->qtVersionValue->setText(qVersion()); + m_ui->qtBuiltAgainstVersion->setText(tr("(built against %1)").arg(QT_VERSION_STR)); + + m_ui->qxmppVersionValue->setText(QXmppVersion()); + m_ui->qxmppBuiltAgainstVersion->setText(tr("(built against %1)").arg(QXMPP_VERSION_STRING)); + setWindowFlag(Qt::Tool); } diff --git a/ui/widgets/about.h b/ui/widgets/about.h index 89d879d..e28b362 100644 --- a/ui/widgets/about.h +++ b/ui/widgets/about.h @@ -38,6 +38,7 @@ public: private: QScopedPointer m_ui; + QWidget* license; }; #endif // ABOUT_H diff --git a/ui/widgets/about.ui b/ui/widgets/about.ui index ab54df5..58c136b 100644 --- a/ui/widgets/about.ui +++ b/ui/widgets/about.ui @@ -6,8 +6,8 @@ 0 0 - 334 - 321 + 354 + 349 @@ -17,6 +17,22 @@ 0 + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 10 + + + + @@ -32,6 +48,28 @@ + + + + + 50 + 50 + + + + + + + :/images/logo.svg + + + true + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + @@ -120,31 +158,239 @@ + + + QFrame::NoFrame + + + Qt::ScrollBarAlwaysOff + + + true + + + Components + + + + + 0 + 0 + 334 + 240 + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 2 + + + 0 + + + + + + true + + + + Version + + + + + + + + true + + + + 0.0.0 + + + + + + + + true + + + + (built against 0.0.0) + + + + + + + + 75 + true + + + + Qt + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + <a href="https://www.qt.io/">www.qt.io</a> + + + true + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 2 + + + 0 + + + + + + true + + + + Version + + + + + + + + true + + + + 0.0.0 + + + + + + + + true + + + + (built against 0.0.0) + + + + + + + + 75 + true + + + + QXmpp + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + <a href="https://github.com/qxmpp-project/qxmpp">github.com/qxmpp-project/qxmpp</a> + + + true + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + - - - - 0.0.0 - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 10 - - - - @@ -155,25 +401,10 @@ - - - - - 50 - 50 - - + + - - - - :/images/logo.svg - - - true - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + 0.0.0