new tab in About: components

This commit is contained in:
Blue 2022-04-04 23:49:01 +03:00
parent 27377e0ec5
commit 9f746d203b
Signed by untrusted user: blue
GPG Key ID: 9B203B252A63EE38
3 changed files with 289 additions and 44 deletions

View File

@ -16,13 +16,26 @@
#include "about.h"
#include "ui_about.h"
#include <QXmppGlobal.h>
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);
}

View File

@ -38,6 +38,7 @@ public:
private:
QScopedPointer<Ui::About> m_ui;
QWidget* license;
};
#endif // ABOUT_H

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>334</width>
<height>321</height>
<width>354</width>
<height>349</height>
</rect>
</property>
<property name="windowTitle">
@ -17,6 +17,22 @@
<property name="verticalSpacing">
<number>0</number>
</property>
<item row="2" column="0" colspan="4">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1" colspan="2">
<widget class="QLabel" name="header">
<property name="font">
@ -32,6 +48,28 @@
</property>
</widget>
</item>
<item row="0" column="0" rowspan="2">
<widget class="QLabel" name="squawkIcon">
<property name="maximumSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../../resources/resources.qrc">:/images/logo.svg</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
<item row="0" column="3" rowspan="2">
<spacer name="horizontalSpacer">
<property name="orientation">
@ -120,31 +158,239 @@
</item>
</layout>
</widget>
<widget class="QScrollArea" name="componentsTab">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<attribute name="title">
<string>Components</string>
</attribute>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>334</width>
<height>240</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_1">
<item>
<widget class="QWidget" name="widget" native="true">
<layout class="QGridLayout" name="gridLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="horizontalSpacing">
<number>2</number>
</property>
<property name="verticalSpacing">
<number>0</number>
</property>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Version</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="versionValue">
<item row="1" column="1">
<widget class="QLabel" name="qtVersionValue">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>0.0.0</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="qtBuiltAgainstVersion">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string notr="true">(built against 0.0.0)</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="3">
<widget class="QLabel" name="label">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string notr="true">Qt</string>
</property>
</widget>
</item>
<item row="0" column="3" rowspan="2">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0" colspan="4">
<spacer name="verticalSpacer">
<widget class="QLabel" name="label_3">
<property name="text">
<string notr="true">&lt;a href=&quot;https://www.qt.io/&quot;&gt;www.qt.io&lt;/a&gt;</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_2" native="true">
<layout class="QGridLayout" name="gridLayout_3">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="horizontalSpacing">
<number>2</number>
</property>
<property name="verticalSpacing">
<number>0</number>
</property>
<item row="1" column="0">
<widget class="QLabel" name="label_4">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Version</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="qxmppVersionValue">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>0.0.0</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="qxmppBuiltAgainstVersion">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string notr="true">(built against 0.0.0)</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="3">
<widget class="QLabel" name="label_5">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string notr="true">QXmpp</string>
</property>
</widget>
</item>
<item row="0" column="3" rowspan="2">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0" colspan="4">
<widget class="QLabel" name="label_6">
<property name="text">
<string notr="true">&lt;a href=&quot;https://github.com/qxmpp-project/qxmpp&quot;&gt;github.com/qxmpp-project/qxmpp&lt;/a&gt;</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="versionLabel">
<property name="text">
@ -155,25 +401,10 @@
</property>
</widget>
</item>
<item row="0" column="0" rowspan="2">
<widget class="QLabel" name="squawkIcon">
<property name="maximumSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
<item row="1" column="2">
<widget class="QLabel" name="versionValue">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../../resources/resources.qrc">:/images/logo.svg</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
<string>0.0.0</string>
</property>
</widget>
</item>