aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2020-11-17 11:20:29 +0100
committerFabian Kosmale <fabian.kosmale@qt.io>2020-11-17 20:11:50 +0100
commit1c32550827d6dfed7465a984092c527f31d7039f (patch)
tree60afaf4632b1356638b4e8d49ff496f42f66898c
parentec4fd8832e5bdecf4cf6dcb40660971f8d294e8a (diff)
Porting Guide: Mention QQmlListProperty change
Change-Id: I173e2ff05b3fc3bbe56df423abcbfc84bdc2a17a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
-rw-r--r--src/qml/doc/src/qt6-changes.qdoc26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/qml/doc/src/qt6-changes.qdoc b/src/qml/doc/src/qt6-changes.qdoc
index c81d64b662..1e958479f6 100644
--- a/src/qml/doc/src/qt6-changes.qdoc
+++ b/src/qml/doc/src/qt6-changes.qdoc
@@ -71,7 +71,31 @@
the engine. As with \c variant properties, code that relied on implicit string conversions need
to use the corresponding functions of the Qt object.
- \section1 Removed API
+ \section1 Source Incompatible API Changes
+
+ \section2 Changed API
+
+ \c QQmlListProperty's \c CountFunction and \c AtFunction have been changed to use \c qsizetype
+ instead of \c int to align with the corresponding changes in Qt's containers.
+
+ \oldcode
+ int myCountFunction(QQmlListProperty<MyType> *);
+ MyType *myAtFunction(QQmlListProperty<MyType> *, int);
+
+ QQmlListProperty<MyType> myReadOnlyList(containingObject, container, &myCountFunction,
+ &myAtFunction);
+ \newcode
+ qsizetype myCountFunction(QQmlListProperty<MyType> *);
+ MyType *myAtFunction(QQmlListProperty<MyType> *, qsizetype);
+
+ QQmlListProperty<MyType> myReadOnlyList(containingObject, container, &myCountFunction,
+ &myAtFunction);
+ \endcode
+
+ Code which needs to supports both Qt 5 and Qt 6 can either use a typedef which is \c int in Qt 5
+ and \c qsizetype in Qt 6, or use \c QList::size_type, which already is such a type alias.
+
+ \section2 Removed API
Various deprecated functions have been removed.