aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-09-21 13:20:36 +0200
committerLiang Qi <liang.qi@qt.io>2017-10-24 11:32:26 +0000
commitd77339875a853266cd043ae9f184a776aa7d2a6d (patch)
tree3b43631b6cd736de2045f3d9b528ea6afb2f7c3c
parentec00272f749972c49d4eaf858a57c38a5bf30c8b (diff)
Return "qnx" for Qt.platform.os when appropriate
[ChangeLog][QtQml] Qt.platform.os returns "qnx" when running on QNX platforms. Task-number: QTBUG-52515 Change-Id: Ie46f235248f7832fff12906cf858e8527e8060b1 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
-rw-r--r--src/qml/qml/qqmlengine.cpp1
-rw-r--r--src/qml/qml/qqmlplatform.cpp2
2 files changed, 3 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index 5a52224208..5efebe28a2 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -445,6 +445,7 @@ The following functions are also on the Qt object.
\li \c "tvos" - tvOS
\li \c "linux" - Linux
\li \c "osx" - \macos
+ \li \c "qnx" - QNX (since Qt 5.9.3)
\li \c "unix" - Other Unix-based OS
\li \c "windows" - Windows
\li \c "winrt" - WinRT / UWP
diff --git a/src/qml/qml/qqmlplatform.cpp b/src/qml/qml/qqmlplatform.cpp
index 165cde5eb3..0d6ab36066 100644
--- a/src/qml/qml/qqmlplatform.cpp
+++ b/src/qml/qml/qqmlplatform.cpp
@@ -71,6 +71,8 @@ QString QQmlPlatform::os()
return QStringLiteral("windows");
#elif defined(Q_OS_LINUX)
return QStringLiteral("linux");
+#elif defined(Q_OS_QNX)
+ return QStringLiteral("qnx");
#elif defined(Q_OS_UNIX)
return QStringLiteral("unix");
#else