From 001d55e1f0e8676acf4dbd0a309612f4b183f22f Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 25 Oct 2022 12:38:14 +0300 Subject: [PATCH] QmlDesigner: Fix empty texture source after drag to map property FilePath::toUrl() returns an empty url if filepath doesn't have scheme/host set. This seems to be Qt 6.4 issue. Worked around the issue by just assigning the relative path directly without converting to url first, as I don't think there's ever going to be a case where the filepath will have proper scheme/host here. Fixes: QDS-8044 Change-Id: I37ae3875bf4386cffc122fd3b030f2b0bf068269 Reviewed-by: Mahmoud Badri --- .../components/propertyeditor/propertyeditorvalue.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp index 37015295a05..45eb5b69b4c 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp @@ -515,7 +515,7 @@ void PropertyEditorValue::commitDrop(const QString &path) Utils::FilePath imagePath = Utils::FilePath::fromString(path); Utils::FilePath currFilePath = QmlDesigner::DocumentManager::currentFilePath(); QmlDesigner::VariantProperty srcProp = texture.variantProperty("source"); - srcProp.setValue(imagePath.relativePathFrom(currFilePath).toUrl()); + srcProp.setValue(imagePath.relativePathFrom(currFilePath).toString()); // assign the texture to the property setExpressionWithEmit(texture.id());