From 1c32550827d6dfed7465a984092c527f31d7039f Mon Sep 17 00:00:00 2001 From: Fabian Kosmale Date: Tue, 17 Nov 2020 11:20:29 +0100 Subject: Porting Guide: Mention QQmlListProperty change Change-Id: I173e2ff05b3fc3bbe56df423abcbfc84bdc2a17a Reviewed-by: Ulf Hermann --- src/qml/doc/src/qt6-changes.qdoc | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) 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 *myAtFunction(QQmlListProperty *, int); + + QQmlListProperty myReadOnlyList(containingObject, container, &myCountFunction, + &myAtFunction); + \newcode + qsizetype myCountFunction(QQmlListProperty *); + MyType *myAtFunction(QQmlListProperty *, qsizetype); + + QQmlListProperty 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. -- cgit v1.2.3