aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quickcontrols/filesystemexplorer/qml/FileSystemView.qml
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2023-04-11 16:52:16 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2023-04-12 09:36:57 +0200
commit32f6cbe9f09ed80f717ec1836b30e14b60ad2b70 (patch)
tree8ee2bd487fa03b30183096cda80709a5e45926ec /examples/quickcontrols/filesystemexplorer/qml/FileSystemView.qml
parent0230ceaec8b0b2ed9ccf7573d2713aa82272cc2b (diff)
Fix filesystemexplorer example to work in macOS bundles
The FileSystemModule qmldir was explicitly put into the "/" resource prefix, but that prefix is not a default qml import path. That caused the qml module not to be found when building on macOS as an app bundle, which relies only on resources and not the file system to find the module. To ensure the module qmldir is found in the resources, we want it to be placed in the default qml import path ':/qt/qml'. To do that, remove the previously specified RESOURCE_PREFIX option and enable the QTP0001 policy by requiring Qt 6.5+, which will put the module qmldir into :/qt/qml/FileSystemModule/qmldir. Because the policy also changes the resource prefix for other resources (images), adjust all Image source urls to be relative paths (relative to the component), instead of absolute paths. Also adjust the qmake generated qrc file to place the files into the new resource prefix. Amends 213e932e138d460159487a624838aa7d3bcffb4a Fixes: QTBUG-112683 Change-Id: I5205cf6d399a6faaf7cce68d55c71dade37479a7 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Dennis Oberst <dennis.oberst@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Diffstat (limited to 'examples/quickcontrols/filesystemexplorer/qml/FileSystemView.qml')
-rw-r--r--examples/quickcontrols/filesystemexplorer/qml/FileSystemView.qml4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/quickcontrols/filesystemexplorer/qml/FileSystemView.qml b/examples/quickcontrols/filesystemexplorer/qml/FileSystemView.qml
index abcc02b711..ade2e48c1f 100644
--- a/examples/quickcontrols/filesystemexplorer/qml/FileSystemView.qml
+++ b/examples/quickcontrols/filesystemexplorer/qml/FileSystemView.qml
@@ -44,8 +44,8 @@ Rectangle {
x: leftMargin + (depth * indentation)
anchors.verticalCenter: parent.verticalCenter
path: treeDelegate.hasChildren
- ? (treeDelegate.expanded ? "qrc:/icons/folder_open.svg" : "qrc:/icons/folder_closed.svg")
- : "qrc:/icons/generic_file.svg"
+ ? (treeDelegate.expanded ? "../icons/folder_open.svg" : "../icons/folder_closed.svg")
+ : "../icons/generic_file.svg"
iconColor: (treeDelegate.expanded && treeDelegate.hasChildren) ? Colors.color2 : Colors.folder
}
Text {