diff options
author | Sami Nurmenniemi <sami.nurmenniemi@qt.io> | 2017-11-13 15:37:08 +0200 |
---|---|---|
committer | Sami Nurmenniemi <sami.nurmenniemi@qt.io> | 2017-11-22 10:43:28 +0000 |
commit | 8d7fe0e4b8852a16469a6d0fe910309e8964ab58 (patch) | |
tree | 64362a2f01e22816332f5a0cd397620b54aedf3c | |
parent | 8d03def677ff09f43322f4d38b6d56e6ebf0e1f9 (diff) |
Dynamic version numbers to "About Qt" screen
Task-number: QTBUG-63091
Change-Id: I313e5931e4d694c49eb8bef534279c2b1d5466eb
Reviewed-by: Kari Oikarinen <kari.oikarinen@qt.io>
-rw-r--r-- | qml/AboutQt.qml | 4 | ||||
-rw-r--r-- | src/engine.h | 2 | ||||
-rw-r--r-- | src/main.cpp | 1 | ||||
-rw-r--r-- | startup.pro | 2 |
4 files changed, 6 insertions, 3 deletions
diff --git a/qml/AboutQt.qml b/qml/AboutQt.qml index 7207791..04614f3 100644 --- a/qml/AboutQt.qml +++ b/qml/AboutQt.qml @@ -62,14 +62,14 @@ Item { } Text { - text: qsTr("Qt version: ") + "5.9" + text: qsTr("Qt version: ") + engine.qtVersion color: "white" font.pixelSize: pluginMain.valueFontSize font.family: appFont } Text { - text: qsTr("Demo Launcher application version: ") + "2.0" + text: qsTr("Demo Launcher application version: ") + Qt.application.version color: "white" font.pixelSize: pluginMain.valueFontSize font.family: appFont diff --git a/src/engine.h b/src/engine.h index ac8a202..608f34f 100644 --- a/src/engine.h +++ b/src/engine.h @@ -53,7 +53,7 @@ class Engine : public QQuickItem Q_PROPERTY(bool fpsEnabled READ isFpsEnabled WRITE setFpsEnabled NOTIFY fpsEnabledChanged) Q_PROPERTY(qreal fps READ fps NOTIFY fpsChanged) - Q_PROPERTY(const QString qtVersion READ qtVersion) + Q_PROPERTY(const QString qtVersion READ qtVersion CONSTANT) Q_PROPERTY(bool glAvailable READ glAvailable NOTIFY glAvailableChanged) diff --git a/src/main.cpp b/src/main.cpp index ac9e66b..d2b7ce6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -66,6 +66,7 @@ int main(int argc, char **argv) qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard")); QApplication app(argc, argv); + app.setApplicationVersion(APPLICATION_VERSION); #if defined(USE_QTWEBENGINE) // This is currently needed by all QtWebEngine applications using the HW accelerated QQuickWebView. diff --git a/startup.pro b/startup.pro index 0d6ca11..e91ba10 100644 --- a/startup.pro +++ b/startup.pro @@ -1,6 +1,8 @@ QT += qml quick widgets TARGET = qtlauncher +DEFINES += APPLICATION_VERSION=\\\"2.0.1\\\" + qtHaveModule(webengine) { DEFINES += USE_QTWEBENGINE QT += webengine |