From 0a1e4cc7ec7548f6273befff9cdddb0bc7a58961 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 15 Jun 2020 17:53:16 +0200 Subject: Do not resolve URLs when assigning them to a property We don't know in advance if a URL is part of the source code and should be relative to the current element, or if it is part of the application data and should not be touched. [ChangeLog][QtQml][Important Behavior Changes] URLs are not resolved or intercepted anymore when assigning them to a "url" property. Instead they are resolved and possibly intercepted when used to access an actual resource. Fixes: QTBUG-76879 Change-Id: Iaa2385aff2c13aa71a12e57385d9afb5dc60a073 Reviewed-by: Fabian Kosmale --- tests/auto/qmltest/animatedimage/tst_animatedimage.qml | 2 +- tests/auto/qmltest/borderimage/tst_borderimage.qml | 4 ++-- tests/auto/qmltest/image/tst_image.qml | 2 +- tests/auto/qmltest/listview/tst_listview.qml | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'tests/auto/qmltest') diff --git a/tests/auto/qmltest/animatedimage/tst_animatedimage.qml b/tests/auto/qmltest/animatedimage/tst_animatedimage.qml index e1dab54816..c89717b973 100644 --- a/tests/auto/qmltest/animatedimage/tst_animatedimage.qml +++ b/tests/auto/qmltest/animatedimage/tst_animatedimage.qml @@ -227,7 +227,7 @@ Item { } function test_clearSource() { - compare(clearSource.source, Qt.resolvedUrl(srcImage)) + compare(clearSource.source, srcImage) compare(clearSource.width, 160) compare(clearSource.height, 120) diff --git a/tests/auto/qmltest/borderimage/tst_borderimage.qml b/tests/auto/qmltest/borderimage/tst_borderimage.qml index a4e0a66aa2..a8da0ad9a2 100644 --- a/tests/auto/qmltest/borderimage/tst_borderimage.qml +++ b/tests/auto/qmltest/borderimage/tst_borderimage.qml @@ -162,7 +162,7 @@ Item { } function test_clearSource() { - compare(clearSource.source, Qt.resolvedUrl("colors.png")) + compare(clearSource.source, "colors.png") compare(clearSource.width, 120) compare(clearSource.height, 120) @@ -235,7 +235,7 @@ Item { img.source = row.source; } - compare(img.source, Qt.resolvedUrl(row.source)) + compare(img.source, row.source) compare(img.width, 300) compare(img.height, 300) diff --git a/tests/auto/qmltest/image/tst_image.qml b/tests/auto/qmltest/image/tst_image.qml index f8f0e7b53c..3eaa9b902c 100644 --- a/tests/auto/qmltest/image/tst_image.qml +++ b/tests/auto/qmltest/image/tst_image.qml @@ -185,7 +185,7 @@ Item { } function test_clearSource() { - compare(clearSource.source, Qt.resolvedUrl(srcImage)) + compare(clearSource.source, srcImage) compare(clearSource.width, 59) compare(clearSource.height, 71) diff --git a/tests/auto/qmltest/listview/tst_listview.qml b/tests/auto/qmltest/listview/tst_listview.qml index bea6b45c3a..b939cffcd5 100644 --- a/tests/auto/qmltest/listview/tst_listview.qml +++ b/tests/auto/qmltest/listview/tst_listview.qml @@ -380,11 +380,11 @@ Item { function test_multipleDelegates_data() { return [ { y: 25, type: "Rectangle", value: "red" }, - { y: 75, type: "Image", value: Qt.resolvedUrl("data/logo.png") }, + { y: 75, type: "Image", value: "logo.png" }, { y: 125, type: "Text", value: "Hello" }, { y: 175, type: "Text", value: "World" }, { y: 225, type: "Rectangle", value: "green" }, - { y: 275, type: "Image", value: Qt.resolvedUrl("data/logo.png") }, + { y: 275, type: "Image", value: "logo.png" }, { y: 325, type: "Rectangle", value: "blue" }, { y: 375, type: "Item", value: "" } ] -- cgit v1.2.3