Fix Qt Quick wizards with Default style and Qt 6

The Default style got renamed to 'Basic' style in Qt 6.0. The 'default' is now
to use the style of the system, if available.

This however caused the projects generated by the wizard to not start with Qt6:

  QQmlApplicationEngine failed to load component
  qrc:/main.qml: module "Default" is not installed

Work around this by not hardcoding the 'Default' style if set. It should be the
default for Qt 5, anyhow.

Fixes: QTCREATORBUG-24905
Change-Id: I71aff50b84e3d096b9a87b7e5b49e2df6821f938
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Kai Koehne
2020-12-04 16:13:49 +01:00
parent eb711d7bd6
commit 193becffbb

View File

@@ -1,6 +1,7 @@
; This file can be edited to change the style of the application
; Read "Qt Quick Controls 2 Configuration File" for details:
; http://doc.qt.io/qt-5/qtquickcontrols2-configuration.html
; https://doc.qt.io/qt/qtquickcontrols2-configuration.html
@if '%{QtQuickControlsStyle}' != 'Default'
[Controls]
Style=%{QtQuickControlsStyle}
@@ -21,3 +22,4 @@ Theme=%{QtQuickControlsStyleTheme}
;Foreground=Brown
;Background=Grey
@endif
@endif