aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quickcontrols2/chattutorial
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2020-08-27 13:28:07 +0200
committerMitch Curtis <mitch.curtis@qt.io>2020-09-10 12:31:45 +0200
commitbb333700054e4c1e699d907e67f4e6be498968a1 (patch)
tree79a3b2da09a0be44390c431c58cdec5fbbfcb28e /examples/quickcontrols2/chattutorial
parentda812ccccea0c7a246bc00bba2df4a54a57cfc96 (diff)
Fix examples' usages of styles
After the type registration changes, importing a style explicitly will cause that style's QML types to be used, so applications should put style-specific code into file-selected directories if they need to support multiple styles. [ChangeLog][Important Behavior Changes] Due to the recent type registration changes, importing a style explicitly (e.g. "import QtQuick.Controls.Material") now registers that style's QML types in addition to making its API (attached, singleton, etc.) available. For this reason, it is now advised to have style-specific code in a separate QML file and use file selectors if your application supports more than one style. If your style only supports one style, importing that style explicitly will work as expected. For example, if you use Material.foreground in your QML code and your application supports more than one style, you should refactor the code that uses the binding into its own file; e.g. +Material/MyComponent.qml. Fixes: QTBUG-86263 Change-Id: I38e40ff4f20f61218550ad73945dafb912193466 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'examples/quickcontrols2/chattutorial')
-rw-r--r--examples/quickcontrols2/chattutorial/chapter5-styling/+Material/ChatToolBar.qml (renamed from examples/quickcontrols2/chattutorial/chapter5-styling/+material/ChatToolBar.qml)0
-rw-r--r--examples/quickcontrols2/chattutorial/chapter5-styling/CMakeLists.txt2
-rw-r--r--examples/quickcontrols2/chattutorial/chapter5-styling/qml.qrc2
3 files changed, 2 insertions, 2 deletions
diff --git a/examples/quickcontrols2/chattutorial/chapter5-styling/+material/ChatToolBar.qml b/examples/quickcontrols2/chattutorial/chapter5-styling/+Material/ChatToolBar.qml
index d4a66764..d4a66764 100644
--- a/examples/quickcontrols2/chattutorial/chapter5-styling/+material/ChatToolBar.qml
+++ b/examples/quickcontrols2/chattutorial/chapter5-styling/+Material/ChatToolBar.qml
diff --git a/examples/quickcontrols2/chattutorial/chapter5-styling/CMakeLists.txt b/examples/quickcontrols2/chattutorial/chapter5-styling/CMakeLists.txt
index d63eb4b1..9e3df84d 100644
--- a/examples/quickcontrols2/chattutorial/chapter5-styling/CMakeLists.txt
+++ b/examples/quickcontrols2/chattutorial/chapter5-styling/CMakeLists.txt
@@ -37,7 +37,7 @@ target_link_libraries(chapter5-styling PUBLIC
# Resources:
set(qml_resource_files
- "+material/ChatToolBar.qml"
+ "+Material/ChatToolBar.qml"
"ChatToolBar.qml"
"ContactPage.qml"
"ConversationPage.qml"
diff --git a/examples/quickcontrols2/chattutorial/chapter5-styling/qml.qrc b/examples/quickcontrols2/chattutorial/chapter5-styling/qml.qrc
index 6dcfb073..54cf6d5a 100644
--- a/examples/quickcontrols2/chattutorial/chapter5-styling/qml.qrc
+++ b/examples/quickcontrols2/chattutorial/chapter5-styling/qml.qrc
@@ -5,6 +5,6 @@
<file>ConversationPage.qml</file>
<file>qtquickcontrols2.conf</file>
<file>ChatToolBar.qml</file>
- <file>+material/ChatToolBar.qml</file>
+ <file>+Material/ChatToolBar.qml</file>
</qresource>
</RCC>