aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmllist.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-11-09 10:46:07 +0100
committerUlf Hermann <ulf.hermann@qt.io>2020-11-09 18:09:30 +0100
commitd7008c79d4ec023527ebfc118ad47f40075f244d (patch)
treece4e1b3e4148820fd5682ee1877a7626274cdb59 /src/qml/qml/qqmllist.cpp
parent5824283a7804e7975140c17731329786045ef432 (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 <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/qml/qqmllist.cpp')
-rw-r--r--src/qml/qml/qqmllist.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/qml/qml/qqmllist.cpp b/src/qml/qml/qqmllist.cpp
index 887fe66bc1..51499f816d 100644
--- a/src/qml/qml/qqmllist.cpp
+++ b/src/qml/qml/qqmllist.cpp
@@ -324,7 +324,7 @@ Returns the list element at \a index, or 0 if the operation failed.
\sa canAt()
*/
-QObject *QQmlListReference::at(int index) const
+QObject *QQmlListReference::at(qsizetype index) const
{
if (!canAt()) return nullptr;
@@ -348,7 +348,7 @@ bool QQmlListReference::clear() const
/*!
Returns the number of objects in the list, or 0 if the operation failed.
*/
-int QQmlListReference::count() const
+qsizetype QQmlListReference::count() const
{
if (!canCount()) return 0;
@@ -361,7 +361,7 @@ Returns true if the operation succeeded, otherwise false.
\sa canReplace()
*/
-bool QQmlListReference::replace(int index, QObject *object) const
+bool QQmlListReference::replace(qsizetype index, QObject *object) const
{
if (!canReplace())
return false;
@@ -602,7 +602,7 @@ Append the \a value to the list \a property.
/*!
\typedef QQmlListProperty::CountFunction
-Synonym for \c {int (*)(QQmlListProperty<T> *property)}.
+Synonym for \c {qsizetype (*)(QQmlListProperty<T> *property)}.
Return the number of elements in the list \a property.
*/
@@ -616,7 +616,7 @@ Returns true if this QQmlListProperty is equal to \a other, otherwise false.
/*!
\typedef QQmlListProperty::AtFunction
-Synonym for \c {T *(*)(QQmlListProperty<T> *property, int index)}.
+Synonym for \c {T *(*)(QQmlListProperty<T> *property, qsizetype index)}.
Return the element at position \a index in the list \a property.
*/
@@ -632,7 +632,7 @@ Clear the list \a property.
/*!
\typedef QQmlListProperty::ReplaceFunction
-Synonym for \c {void (*)(QQmlListProperty<T> *property, int index, T *value)}.
+Synonym for \c {void (*)(QQmlListProperty<T> *property, qsizetype index, T *value)}.
Replace the element at position \a index in the list \a property with \a value.
*/