From e68e4cf9e19d52c81d841979021adc44d98d95a4 Mon Sep 17 00:00:00 2001 From: Martchus Date: Sun, 2 Feb 2025 22:24:21 +0100 Subject: [PATCH] Show Qt version in about dialog of Qt Quick GUI --- tray/gui/qml/AboutDialog.qml | 15 +++++++++++++++ tray/gui/quick/app.h | 6 ++++++ 2 files changed, 21 insertions(+) diff --git a/tray/gui/qml/AboutDialog.qml b/tray/gui/qml/AboutDialog.qml index 4fa0e3e0..30d04f4d 100644 --- a/tray/gui/qml/AboutDialog.qml +++ b/tray/gui/qml/AboutDialog.qml @@ -61,6 +61,21 @@ CustomDialog { horizontalAlignment: Qt.AlignHCenter elide: Qt.ElideRight } + Label { + Layout.alignment: Qt.AlignHCenter + Layout.fillWidth: true + text: qsTr("Qt version") + horizontalAlignment: Qt.AlignHCenter + elide: Qt.ElideRight + } + Label { + Layout.alignment: Qt.AlignHCenter + Layout.fillWidth: true + text: App.qtVersion + font.weight: Font.Light + horizontalAlignment: Qt.AlignHCenter + elide: Qt.ElideRight + } } } footer: DialogButtonBox { diff --git a/tray/gui/quick/app.h b/tray/gui/quick/app.h index bad23ad6..e906ad36 100644 --- a/tray/gui/quick/app.h +++ b/tray/gui/quick/app.h @@ -29,6 +29,7 @@ #include #include #include +#include #ifdef Q_OS_ANDROID #include @@ -63,6 +64,7 @@ class App : public QObject { Q_PROPERTY(bool nativePopups READ nativePopups CONSTANT) Q_PROPERTY(QString status READ status NOTIFY statusChanged) Q_PROPERTY(QString syncthingVersion READ syncthingVersion CONSTANT) + Q_PROPERTY(QString qtVersion READ qtVersion CONSTANT) Q_PROPERTY(QString readmeUrl READ readmeUrl CONSTANT) Q_PROPERTY(QString website READ website CONSTANT) Q_PROPERTY(bool hasInternalErrors READ hasInternalErrors NOTIFY hasInternalErrorsChanged) @@ -148,6 +150,10 @@ class App : public QObject { return tr("not available"); #endif } + QString qtVersion() const + { + return QString::fromUtf8(qVersion()); + } QString readmeUrl() const { return QtGui::readmeUrl();