aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/doc/src
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2020-11-27 14:08:31 +0100
committerFabian Kosmale <fabian.kosmale@qt.io>2020-11-30 17:16:26 +0000
commite2a74579850d89d229dad918404a8d8ecebb80b3 (patch)
tree48c477a41bf49815d045984c312964989783542b /src/qml/doc/src
parentf7adf698693379ceee99d49b9b89d47cc7267f03 (diff)
Porting guide: Document URL resolution change
Task-number: QTBUG-88965 Pick-to: 6.0 Change-Id: Ib62082935ddba7bf5b359a32712e6799b3242091 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'src/qml/doc/src')
-rw-r--r--src/qml/doc/src/qt6-changes.qdoc22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/qml/doc/src/qt6-changes.qdoc b/src/qml/doc/src/qt6-changes.qdoc
index ee9525ae5c..087c500ab2 100644
--- a/src/qml/doc/src/qt6-changes.qdoc
+++ b/src/qml/doc/src/qt6-changes.qdoc
@@ -43,6 +43,28 @@
\section1 QML language
+ \section2 URL resolution
+
+ In Qt 5, relative urls were often, albeit inconsistently, directly resolved, especially when
+ assigned to an url property. In Qt 6 this is no longer the case.
+
+ If you had a QML file stored under "/home/qml/example.qml", and "example.qml" contained
+ \begincode
+ property url imageFolder: "./images"
+ \oldcode
+ then the url property would store the URL "/home/qml/images". This made it impossible to use
+ relative URLs in QML in this way, so in Qt 6, the URL stays relative, and only gets resolved
+ when this is required (e.g. when it is used as the source of an Image component).
+ If you depend on the old behavior, you can use \c Qt.resolvedUrl
+ \oldcode
+ property url imageFolder: "./images"
+ \newcode
+ property url imageFolder: Qt.resolvedUrl("./images")
+ \endcode
+ Qt.resolvedUrl can be used in both Qt 5 and 6.
+
+ \section2 Variant Properties
+
\c variant properties, which have been marked as obsolete since Qt 5, are now treated in exactly
the same way as \c var properties.
Code that relied on implicit string conversion triggered on assignment to variant properties