diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2020-11-26 12:12:22 +0100 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2020-11-30 10:21:47 +0000 |
commit | 3f74ef5f41a24dc1ee91cca876d29777cf636fa2 (patch) | |
tree | d632b26f4759472a57dd6d0e27708dca847c62f5 | |
parent | 949ad29539b29feb12001f7d5e5997c6f3a43fed (diff) |
Default to Basic controls style if not already set
In Qt 6, the Default style was renamed to Basic, and the style that is
used by default now depends on which platform the application is run
on.
Previously the Default (now Basic) style was used by default.
So, restore the Basic style as the default. This ensures consistent
results should the default ever change again.
Task-number: QTBUG-88672
Change-Id: If96dd9cccd5fd05256221991bfacb4ae7bd3a1c1
Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
-rw-r--r-- | src/main.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index f641f3d..0e1f920 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -393,6 +393,10 @@ int main(int argc, char **argv) // GL context. setupDefaultSurfaceFormat(argc, argv); + // If it's not set, set the Qt Quick Controls style to Basic to ensure consistent results. + const QByteArray controlsStyle = qgetenv("QT_QUICK_CONTROLS_STYLE"); + if (controlsStyle.isEmpty()) + qputenv("QT_QUICK_CONTROLS_STYLE", "Basic"); qmlRegisterAnonymousType<QQuickView>("QmlBench", 1); qmlRegisterType(QUrl("qrc:/Benchmark.qml"), "QmlBench", 1, 0, "Benchmark"); |