From d7008c79d4ec023527ebfc118ad47f40075f244d Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 9 Nov 2020 10:46:07 +0100 Subject: QQmlListProperty: Use qsizetype rather than int for sizes [ChangeLog][QtQml] The QQmlListProperty callback functions use qsizetype now as type for the size of a list. This is in line with the containers that you might use to back the list. Fixes: QTBUG-88269 Change-Id: Ia38403cb32f241e6c70e1a580dbeff1d6d694331 Reviewed-by: Fabian Kosmale --- tests/auto/qml/qqmlecmascript/testtypes.cpp | 4 ++-- tests/auto/qml/qqmlecmascript/testtypes.h | 4 ++-- tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'tests/auto/qml') diff --git a/tests/auto/qml/qqmlecmascript/testtypes.cpp b/tests/auto/qml/qqmlecmascript/testtypes.cpp index ec7ae1e9a5..688ed2c946 100644 --- a/tests/auto/qml/qqmlecmascript/testtypes.cpp +++ b/tests/auto/qml/qqmlecmascript/testtypes.cpp @@ -424,12 +424,12 @@ void QObjectContainer::children_append(QQmlListProperty *prop, QObject } } -int QObjectContainer::children_count(QQmlListProperty *prop) +qsizetype QObjectContainer::children_count(QQmlListProperty *prop) { return static_cast(prop->object)->dataChildren.count(); } -QObject *QObjectContainer::children_at(QQmlListProperty *prop, int index) +QObject *QObjectContainer::children_at(QQmlListProperty *prop, qsizetype index) { return static_cast(prop->object)->dataChildren.at(index); } diff --git a/tests/auto/qml/qqmlecmascript/testtypes.h b/tests/auto/qml/qqmlecmascript/testtypes.h index 878dd79466..159038f851 100644 --- a/tests/auto/qml/qqmlecmascript/testtypes.h +++ b/tests/auto/qml/qqmlecmascript/testtypes.h @@ -1687,8 +1687,8 @@ public: QQmlListProperty data(); static void children_append(QQmlListProperty *prop, QObject *o); - static int children_count(QQmlListProperty *prop); - static QObject *children_at(QQmlListProperty *prop, int index); + static qsizetype children_count(QQmlListProperty *prop); + static QObject *children_at(QQmlListProperty *prop, qsizetype index); static void children_clear(QQmlListProperty *prop); QList dataChildren; diff --git a/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp b/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp index 665fcdc9dc..bf5ee92374 100644 --- a/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp +++ b/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp @@ -98,16 +98,16 @@ public: static void append(QQmlListProperty *p, TestType *v) { reinterpret_cast *>(p->data)->append(v); } - static int count(QQmlListProperty *p) { + static qsizetype count(QQmlListProperty *p) { return reinterpret_cast *>(p->data)->count(); } - static TestType *at(QQmlListProperty *p, int idx) { + static TestType *at(QQmlListProperty *p, qsizetype idx) { return reinterpret_cast *>(p->data)->at(idx); } static void clear(QQmlListProperty *p) { return reinterpret_cast *>(p->data)->clear(); } - static void replace(QQmlListProperty *p, int idx, TestType *v) { + static void replace(QQmlListProperty *p, qsizetype idx, TestType *v) { return reinterpret_cast *>(p->data)->replace(idx, v); } static void removeLast(QQmlListProperty *p) { -- cgit v1.2.3