Skip to content

Commit

Permalink
Show Qt version in about dialog of Qt Quick GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
Martchus committed Feb 2, 2025
1 parent afe9b63 commit e68e4cf
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tray/gui/qml/AboutDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 6 additions & 0 deletions tray/gui/quick/app.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <QJsonObject>
#include <QQmlApplicationEngine>
#include <QUrl>
#include <QtVersion>

#ifdef Q_OS_ANDROID
#include <QHash>
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit e68e4cf

Please sign in to comment.