diff options
author | Ulf Hermann <[email protected]> | 2020-11-09 10:46:07 +0100 |
---|---|---|
committer | Ulf Hermann <[email protected]> | 2020-11-09 18:09:30 +0100 |
commit | d7008c79d4ec023527ebfc118ad47f40075f244d (patch) | |
tree | ce4e1b3e4148820fd5682ee1877a7626274cdb59 /src/qmlmodels/qqmlobjectmodel.cpp | |
parent | 5824283a7804e7975140c17731329786045ef432 (diff) |
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 <[email protected]>
Diffstat (limited to 'src/qmlmodels/qqmlobjectmodel.cpp')
-rw-r--r-- | src/qmlmodels/qqmlobjectmodel.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/qmlmodels/qqmlobjectmodel.cpp b/src/qmlmodels/qqmlobjectmodel.cpp index b498f3567d..19aaaae88e 100644 --- a/src/qmlmodels/qqmlobjectmodel.cpp +++ b/src/qmlmodels/qqmlobjectmodel.cpp @@ -75,15 +75,15 @@ public: QQmlObjectModelPrivate() : QObjectPrivate(), moveId(0) {} static void children_append(QQmlListProperty<QObject> *prop, QObject *item) { - int index = static_cast<QQmlObjectModelPrivate *>(prop->data)->children.count(); + qsizetype index = static_cast<QQmlObjectModelPrivate *>(prop->data)->children.count(); static_cast<QQmlObjectModelPrivate *>(prop->data)->insert(index, item); } - static int children_count(QQmlListProperty<QObject> *prop) { + static qsizetype children_count(QQmlListProperty<QObject> *prop) { return static_cast<QQmlObjectModelPrivate *>(prop->data)->children.count(); } - static QObject *children_at(QQmlListProperty<QObject> *prop, int index) { + static QObject *children_at(QQmlListProperty<QObject> *prop, qsizetype index) { return static_cast<QQmlObjectModelPrivate *>(prop->data)->children.at(index).item; } @@ -91,7 +91,7 @@ public: static_cast<QQmlObjectModelPrivate *>(prop->data)->clear(); } - static void children_replace(QQmlListProperty<QObject> *prop, int index, QObject *item) { + static void children_replace(QQmlListProperty<QObject> *prop, qsizetype index, QObject *item) { static_cast<QQmlObjectModelPrivate *>(prop->data)->replace(index, item); } |