diff options
39 files changed, 155 insertions, 154 deletions
diff --git a/examples/qml/referenceexamples/properties/birthdayparty.cpp b/examples/qml/referenceexamples/properties/birthdayparty.cpp index fe6abab3f5..2dc9bd803d 100644 --- a/examples/qml/referenceexamples/properties/birthdayparty.cpp +++ b/examples/qml/referenceexamples/properties/birthdayparty.cpp @@ -81,12 +81,12 @@ void BirthdayParty::appendGuest(Person* p) { } -int BirthdayParty::guestCount() const +qsizetype BirthdayParty::guestCount() const { return m_guests.count(); } -Person *BirthdayParty::guest(int index) const +Person *BirthdayParty::guest(qsizetype index) const { return m_guests.at(index); } @@ -95,7 +95,7 @@ void BirthdayParty::clearGuests() { m_guests.clear(); } -void BirthdayParty::replaceGuest(int index, Person *p) +void BirthdayParty::replaceGuest(qsizetype index, Person *p) { m_guests[index] = p; } @@ -115,7 +115,7 @@ void BirthdayParty::clearGuests(QQmlListProperty<Person>* list) { reinterpret_cast< BirthdayParty* >(list->data)->clearGuests(); } -void BirthdayParty::replaceGuest(QQmlListProperty<Person> *list, int i, Person *p) +void BirthdayParty::replaceGuest(QQmlListProperty<Person> *list, qsizetype i, Person *p) { reinterpret_cast< BirthdayParty* >(list->data)->replaceGuest(i, p); } @@ -125,10 +125,10 @@ void BirthdayParty::removeLastGuest(QQmlListProperty<Person> *list) reinterpret_cast< BirthdayParty* >(list->data)->removeLastGuest(); } -Person* BirthdayParty::guest(QQmlListProperty<Person>* list, int i) { +Person* BirthdayParty::guest(QQmlListProperty<Person>* list, qsizetype i) { return reinterpret_cast< BirthdayParty* >(list->data)->guest(i); } -int BirthdayParty::guestCount(QQmlListProperty<Person>* list) { +qsizetype BirthdayParty::guestCount(QQmlListProperty<Person>* list) { return reinterpret_cast< BirthdayParty* >(list->data)->guestCount(); } diff --git a/examples/qml/referenceexamples/properties/birthdayparty.h b/examples/qml/referenceexamples/properties/birthdayparty.h index 9da5158de2..7e1668add3 100644 --- a/examples/qml/referenceexamples/properties/birthdayparty.h +++ b/examples/qml/referenceexamples/properties/birthdayparty.h @@ -76,18 +76,18 @@ public: QQmlListProperty<Person> guests(); void appendGuest(Person*); - int guestCount() const; - Person *guest(int) const; + qsizetype guestCount() const; + Person *guest(qsizetype) const; void clearGuests(); - void replaceGuest(int, Person*); + void replaceGuest(qsizetype, Person*); void removeLastGuest(); private: static void appendGuest(QQmlListProperty<Person>*, Person*); - static int guestCount(QQmlListProperty<Person>*); - static Person* guest(QQmlListProperty<Person>*, int); + static qsizetype guestCount(QQmlListProperty<Person>*); + static Person* guest(QQmlListProperty<Person>*, qsizetype); static void clearGuests(QQmlListProperty<Person>*); - static void replaceGuest(QQmlListProperty<Person>*, int, Person*); + static void replaceGuest(QQmlListProperty<Person>*, qsizetype, Person*); static void removeLastGuest(QQmlListProperty<Person>*); Person *m_host; diff --git a/src/imports/labsmodels/qqmldelegatecomponent.cpp b/src/imports/labsmodels/qqmldelegatecomponent.cpp index 68c1d3d741..2de6b55045 100644 --- a/src/imports/labsmodels/qqmldelegatecomponent.cpp +++ b/src/imports/labsmodels/qqmldelegatecomponent.cpp @@ -263,13 +263,13 @@ void QQmlDelegateChooser::choices_append(QQmlListProperty<QQmlDelegateChoice> *p q->delegateChanged(); } -int QQmlDelegateChooser::choices_count(QQmlListProperty<QQmlDelegateChoice> *prop) +qsizetype QQmlDelegateChooser::choices_count(QQmlListProperty<QQmlDelegateChoice> *prop) { QQmlDelegateChooser *q = static_cast<QQmlDelegateChooser*>(prop->object); return q->m_choices.count(); } -QQmlDelegateChoice *QQmlDelegateChooser::choices_at(QQmlListProperty<QQmlDelegateChoice> *prop, int index) +QQmlDelegateChoice *QQmlDelegateChooser::choices_at(QQmlListProperty<QQmlDelegateChoice> *prop, qsizetype index) { QQmlDelegateChooser *q = static_cast<QQmlDelegateChooser*>(prop->object); return q->m_choices.at(index); @@ -284,8 +284,8 @@ void QQmlDelegateChooser::choices_clear(QQmlListProperty<QQmlDelegateChoice> *pr q->delegateChanged(); } -void QQmlDelegateChooser::choices_replace(QQmlListProperty<QQmlDelegateChoice> *prop, int index, - QQmlDelegateChoice *choice) +void QQmlDelegateChooser::choices_replace(QQmlListProperty<QQmlDelegateChoice> *prop, + qsizetype index, QQmlDelegateChoice *choice) { QQmlDelegateChooser *q = static_cast<QQmlDelegateChooser *>(prop->object); disconnect(q->m_choices[index], &QQmlDelegateChoice::changed, diff --git a/src/imports/labsmodels/qqmldelegatecomponent_p.h b/src/imports/labsmodels/qqmldelegatecomponent_p.h index 9655d1baf9..ed29f37809 100644 --- a/src/imports/labsmodels/qqmldelegatecomponent_p.h +++ b/src/imports/labsmodels/qqmldelegatecomponent_p.h @@ -116,10 +116,11 @@ public: virtual QQmlListProperty<QQmlDelegateChoice> choices(); static void choices_append(QQmlListProperty<QQmlDelegateChoice> *, QQmlDelegateChoice *); - static int choices_count(QQmlListProperty<QQmlDelegateChoice> *); - static QQmlDelegateChoice *choices_at(QQmlListProperty<QQmlDelegateChoice> *, int); + static qsizetype choices_count(QQmlListProperty<QQmlDelegateChoice> *); + static QQmlDelegateChoice *choices_at(QQmlListProperty<QQmlDelegateChoice> *, qsizetype); static void choices_clear(QQmlListProperty<QQmlDelegateChoice> *); - static void choices_replace(QQmlListProperty<QQmlDelegateChoice> *, int, QQmlDelegateChoice *); + static void choices_replace(QQmlListProperty<QQmlDelegateChoice> *, qsizetype, + QQmlDelegateChoice *); static void choices_removeLast(QQmlListProperty<QQmlDelegateChoice> *); QQmlComponent *delegate(QQmlAdaptorModel *adaptorModel, int row, int column = -1) const override; diff --git a/src/imports/labsmodels/qqmltablemodel.cpp b/src/imports/labsmodels/qqmltablemodel.cpp index c4209baab3..e60c525b0d 100644 --- a/src/imports/labsmodels/qqmltablemodel.cpp +++ b/src/imports/labsmodels/qqmltablemodel.cpp @@ -658,13 +658,13 @@ void QQmlTableModel::columns_append(QQmlListProperty<QQmlTableModelColumn> *prop model->mColumns.append(column); } -int QQmlTableModel::columns_count(QQmlListProperty<QQmlTableModelColumn> *property) +qsizetype QQmlTableModel::columns_count(QQmlListProperty<QQmlTableModelColumn> *property) { const QQmlTableModel *model = static_cast<QQmlTableModel*>(property->object); return model->mColumns.count(); } -QQmlTableModelColumn *QQmlTableModel::columns_at(QQmlListProperty<QQmlTableModelColumn> *property, int index) +QQmlTableModelColumn *QQmlTableModel::columns_at(QQmlListProperty<QQmlTableModelColumn> *property, qsizetype index) { const QQmlTableModel *model = static_cast<QQmlTableModel*>(property->object); return model->mColumns.at(index); @@ -676,7 +676,7 @@ void QQmlTableModel::columns_clear(QQmlListProperty<QQmlTableModelColumn> *prope return model->mColumns.clear(); } -void QQmlTableModel::columns_replace(QQmlListProperty<QQmlTableModelColumn> *property, int index, QQmlTableModelColumn *value) +void QQmlTableModel::columns_replace(QQmlListProperty<QQmlTableModelColumn> *property, qsizetype index, QQmlTableModelColumn *value) { QQmlTableModel *model = static_cast<QQmlTableModel*>(property->object); if (QQmlTableModelColumn *column = qobject_cast<QQmlTableModelColumn*>(value)) diff --git a/src/imports/labsmodels/qqmltablemodel_p.h b/src/imports/labsmodels/qqmltablemodel_p.h index ae46cbe35c..b1a8c90837 100644 --- a/src/imports/labsmodels/qqmltablemodel_p.h +++ b/src/imports/labsmodels/qqmltablemodel_p.h @@ -94,10 +94,10 @@ public: QQmlListProperty<QQmlTableModelColumn> columns(); static void columns_append(QQmlListProperty<QQmlTableModelColumn> *property, QQmlTableModelColumn *value); - static int columns_count(QQmlListProperty<QQmlTableModelColumn> *property); - static QQmlTableModelColumn *columns_at(QQmlListProperty<QQmlTableModelColumn> *property, int index); + static qsizetype columns_count(QQmlListProperty<QQmlTableModelColumn> *property); + static QQmlTableModelColumn *columns_at(QQmlListProperty<QQmlTableModelColumn> *property, qsizetype index); static void columns_clear(QQmlListProperty<QQmlTableModelColumn> *property); - static void columns_replace(QQmlListProperty<QQmlTableModelColumn> *property, int index, QQmlTableModelColumn *value); + static void columns_replace(QQmlListProperty<QQmlTableModelColumn> *property, qsizetype index, QQmlTableModelColumn *value); static void columns_removeLast(QQmlListProperty<QQmlTableModelColumn> *property); QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override; diff --git a/src/qml/qml/qqmlcontext.cpp b/src/qml/qml/qqmlcontext.cpp index 65cf6b3686..c6aab78a63 100644 --- a/src/qml/qml/qqmlcontext.cpp +++ b/src/qml/qml/qqmlcontext.cpp @@ -441,7 +441,7 @@ QUrl QQmlContext::baseUrl() const return d->m_data->baseUrl(); } -int QQmlContextPrivate::context_count(QQmlListProperty<QObject> *prop) +qsizetype QQmlContextPrivate::context_count(QQmlListProperty<QObject> *prop) { QQmlContext *context = static_cast<QQmlContext*>(prop->object); QQmlContextPrivate *d = QQmlContextPrivate::get(context); @@ -453,7 +453,7 @@ int QQmlContextPrivate::context_count(QQmlListProperty<QObject> *prop) return ((const QList<QObject> *)d->propertyValue(contextProperty).constData())->count(); } -QObject *QQmlContextPrivate::context_at(QQmlListProperty<QObject> *prop, int index) +QObject *QQmlContextPrivate::context_at(QQmlListProperty<QObject> *prop, qsizetype index) { QQmlContext *context = static_cast<QQmlContext*>(prop->object); QQmlContextPrivate *d = QQmlContextPrivate::get(context); diff --git a/src/qml/qml/qqmlcontext_p.h b/src/qml/qml/qqmlcontext_p.h index e1b2e9d41d..1c2cb7ff67 100644 --- a/src/qml/qml/qqmlcontext_p.h +++ b/src/qml/qml/qqmlcontext_p.h @@ -78,8 +78,8 @@ public: return static_cast<QQmlContext *>(context->q_func()); } - static int context_count(QQmlListProperty<QObject> *); - static QObject *context_at(QQmlListProperty<QObject> *, int); + static qsizetype context_count(QQmlListProperty<QObject> *); + static QObject *context_at(QQmlListProperty<QObject> *, qsizetype); void dropDestroyedQObject(const QString &name, QObject *destroyed); 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. */ diff --git a/src/qml/qml/qqmllist.h b/src/qml/qml/qqmllist.h index c51a9c7636..7eb6d71670 100644 --- a/src/qml/qml/qqmllist.h +++ b/src/qml/qml/qqmllist.h @@ -60,10 +60,10 @@ template<typename T> class QQmlListProperty { public: using AppendFunction = void (*)(QQmlListProperty<T> *, T *); - using CountFunction = int (*)(QQmlListProperty<T> *); - using AtFunction = T *(*)(QQmlListProperty<T> *, int); + using CountFunction = qsizetype (*)(QQmlListProperty<T> *); + using AtFunction = T *(*)(QQmlListProperty<T> *, qsizetype); using ClearFunction = void (*)(QQmlListProperty<T> *); - using ReplaceFunction = void (*)(QQmlListProperty<T> *, int, T *); + using ReplaceFunction = void (*)(QQmlListProperty<T> *, qsizetype, T *); using RemoveLastFunction = void (*)(QQmlListProperty<T> *); QQmlListProperty() = default; @@ -126,39 +126,39 @@ private: static void qlist_append(QQmlListProperty *p, T *v) { reinterpret_cast<QList<T *> *>(p->data)->append(v); } - static int qlist_count(QQmlListProperty *p) { + static qsizetype qlist_count(QQmlListProperty *p) { return reinterpret_cast<QList<T *> *>(p->data)->count(); } - static T *qlist_at(QQmlListProperty *p, int idx) { + static T *qlist_at(QQmlListProperty *p, qsizetype idx) { return reinterpret_cast<QList<T *> *>(p->data)->at(idx); } static void qlist_clear(QQmlListProperty *p) { return reinterpret_cast<QList<T *> *>(p->data)->clear(); } - static void qlist_replace(QQmlListProperty *p, int idx, T *v) { + static void qlist_replace(QQmlListProperty *p, qsizetype idx, T *v) { return reinterpret_cast<QList<T *> *>(p->data)->replace(idx, v); } static void qlist_removeLast(QQmlListProperty *p) { return reinterpret_cast<QList<T *> *>(p->data)->removeLast(); } - static void qslow_replace(QQmlListProperty<T> *list, int idx, T *v) + static void qslow_replace(QQmlListProperty<T> *list, qsizetype idx, T *v) { - const int length = list->count(list); + const qsizetype length = list->count(list); if (idx < 0 || idx >= length) return; QVector<T *> stash; if (list->clear != qslow_clear) { stash.reserve(length); - for (int i = 0; i < length; ++i) + for (qsizetype i = 0; i < length; ++i) stash.append(i == idx ? v : list->at(list, i)); list->clear(list); for (T *item : qAsConst(stash)) list->append(list, item); } else { stash.reserve(length - idx - 1); - for (int i = length - 1; i > idx; --i) { + for (qsizetype i = length - 1; i > idx; --i) { stash.append(list->at(list, i)); list->removeLast(list); } @@ -171,18 +171,18 @@ private: static void qslow_clear(QQmlListProperty<T> *list) { - for (int i = 0, end = list->count(list); i < end; ++i) + for (qsizetype i = 0, end = list->count(list); i < end; ++i) list->removeLast(list); } static void qslow_removeLast(QQmlListProperty<T> *list) { - const int length = list->count(list) - 1; + const qsizetype length = list->count(list) - 1; if (length < 0) return; QVector<T *> stash; stash.reserve(length); - for (int i = 0; i < length; ++i) + for (qsizetype i = 0; i < length; ++i) stash.append(list->at(list, i)); list->clear(list); for (T *item : qAsConst(stash)) @@ -218,10 +218,10 @@ public: bool isReadable() const; bool append(QObject *) const; - QObject *at(int) const; + QObject *at(qsizetype) const; bool clear() const; - int count() const; - bool replace(int, QObject *) const; + qsizetype count() const; + bool replace(qsizetype, QObject *) const; bool removeLast() const; bool operator==(const QQmlListReference &other) const {return d == other.d;} diff --git a/src/qml/qml/qqmlproperty.cpp b/src/qml/qml/qqmlproperty.cpp index a30314635a..d53e751cb6 100644 --- a/src/qml/qml/qqmlproperty.cpp +++ b/src/qml/qml/qqmlproperty.cpp @@ -1339,7 +1339,7 @@ bool QQmlPropertyPrivate::write( if (variantType == qMetaTypeId<QQmlListReference>()) { QQmlListReference qdlr = value.value<QQmlListReference>(); - for (int ii = 0; ii < qdlr.count(); ++ii) { + for (qsizetype ii = 0; ii < qdlr.count(); ++ii) { QObject *o = qdlr.at(ii); if (o && !QQmlMetaObject::canConvert(o, listType)) o = nullptr; @@ -1348,7 +1348,7 @@ bool QQmlPropertyPrivate::write( } else if (variantType == qMetaTypeId<QList<QObject *> >()) { const QList<QObject *> &list = qvariant_cast<QList<QObject *> >(value); - for (int ii = 0; ii < list.count(); ++ii) { + for (qsizetype ii = 0; ii < list.count(); ++ii) { QObject *o = list.at(ii); if (o && !QQmlMetaObject::canConvert(o, listType)) o = nullptr; diff --git a/src/qml/qml/qqmlvmemetaobject.cpp b/src/qml/qml/qqmlvmemetaobject.cpp index 6919c6dba3..2379f393aa 100644 --- a/src/qml/qml/qqmlvmemetaobject.cpp +++ b/src/qml/qml/qqmlvmemetaobject.cpp @@ -131,12 +131,12 @@ static void list_append(QQmlListProperty<QObject> *prop, QObject *o) resolved.activateSignal(); } -static int list_count(QQmlListProperty<QObject> *prop) +static qsizetype list_count(QQmlListProperty<QObject> *prop) { return ResolvedList(prop).list()->count(); } -static QObject *list_at(QQmlListProperty<QObject> *prop, int index) +static QObject *list_at(QQmlListProperty<QObject> *prop, qsizetype index) { return ResolvedList(prop).list()->at(index); } @@ -148,7 +148,7 @@ static void list_clear(QQmlListProperty<QObject> *prop) resolved.activateSignal(); } -static void list_replace(QQmlListProperty<QObject> *prop, int index, QObject *o) +static void list_replace(QQmlListProperty<QObject> *prop, qsizetype index, QObject *o) { const ResolvedList resolved(prop); resolved.list()->replace(index, o); diff --git a/src/qmlmodels/qqmldelegatemodel.cpp b/src/qmlmodels/qqmldelegatemodel.cpp index 5f6fe93dc8..1a053e2e31 100644 --- a/src/qmlmodels/qqmldelegatemodel.cpp +++ b/src/qmlmodels/qqmldelegatemodel.cpp @@ -697,7 +697,7 @@ void QQmlDelegateModelPrivate::group_append( d->m_groupCount += 1; } -int QQmlDelegateModelPrivate::group_count( +qsizetype QQmlDelegateModelPrivate::group_count( QQmlListProperty<QQmlDelegateModelGroup> *property) { QQmlDelegateModelPrivate *d = static_cast<QQmlDelegateModelPrivate *>(property->data); @@ -705,7 +705,7 @@ int QQmlDelegateModelPrivate::group_count( } QQmlDelegateModelGroup *QQmlDelegateModelPrivate::group_at( - QQmlListProperty<QQmlDelegateModelGroup> *property, int index) + QQmlListProperty<QQmlDelegateModelGroup> *property, qsizetype index) { QQmlDelegateModelPrivate *d = static_cast<QQmlDelegateModelPrivate *>(property->data); return index >= 0 && index < d->m_groupCount - 1 diff --git a/src/qmlmodels/qqmldelegatemodel_p_p.h b/src/qmlmodels/qqmldelegatemodel_p_p.h index 491e8025b8..a1c9e7f583 100644 --- a/src/qmlmodels/qqmldelegatemodel_p_p.h +++ b/src/qmlmodels/qqmldelegatemodel_p_p.h @@ -338,8 +338,8 @@ public: int adaptorModelCount() const; static void group_append(QQmlListProperty<QQmlDelegateModelGroup> *property, QQmlDelegateModelGroup *group); - static int group_count(QQmlListProperty<QQmlDelegateModelGroup> *property); - static QQmlDelegateModelGroup *group_at(QQmlListProperty<QQmlDelegateModelGroup> *property, int index); + static qsizetype group_count(QQmlListProperty<QQmlDelegateModelGroup> *property); + static QQmlDelegateModelGroup *group_at(QQmlListProperty<QQmlDelegateModelGroup> *property, qsizetype index); void releaseIncubator(QQDMIncubationTask *incubationTask); void incubatorStatusChanged(QQDMIncubationTask *incubationTask, QQmlIncubator::Status status); diff --git a/src/qmlmodels/qqmllistaccessor.cpp b/src/qmlmodels/qqmllistaccessor.cpp index 21481b8067..5e3fb86510 100644 --- a/src/qmlmodels/qqmllistaccessor.cpp +++ b/src/qmlmodels/qqmllistaccessor.cpp @@ -115,7 +115,7 @@ void QQmlListAccessor::setList(const QVariant &v, QQmlEngine *engine) } } -int QQmlListAccessor::count() const +qsizetype QQmlListAccessor::count() const { switch(m_type) { case StringList: @@ -136,7 +136,7 @@ int QQmlListAccessor::count() const } } -QVariant QQmlListAccessor::at(int idx) const +QVariant QQmlListAccessor::at(qsizetype idx) const { Q_ASSERT(idx >= 0 && idx < count()); switch(m_type) { diff --git a/src/qmlmodels/qqmllistaccessor_p.h b/src/qmlmodels/qqmllistaccessor_p.h index a57e4173e3..3306396b00 100644 --- a/src/qmlmodels/qqmllistaccessor_p.h +++ b/src/qmlmodels/qqmllistaccessor_p.h @@ -67,8 +67,8 @@ public: bool isValid() const; - int count() const; - QVariant at(int) const; + qsizetype count() const; + QVariant at(qsizetype) const; enum Type { Invalid, StringList, VariantList, ObjectList, ListProperty, Instance, Integer }; Type type() const { return m_type; } 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); } diff --git a/src/qmlmodels/qquickpackage.cpp b/src/qmlmodels/qquickpackage.cpp index 42e7d0e09f..f16cb2381e 100644 --- a/src/qmlmodels/qquickpackage.cpp +++ b/src/qmlmodels/qquickpackage.cpp @@ -107,15 +107,15 @@ public: QList<DataGuard> *list = static_cast<QList<DataGuard> *>(prop->data); list->clear(); } - static QObject *data_at(QQmlListProperty<QObject> *prop, int index) { + static QObject *data_at(QQmlListProperty<QObject> *prop, qsizetype index) { QList<DataGuard> *list = static_cast<QList<DataGuard> *>(prop->data); return list->at(index); } - static int data_count(QQmlListProperty<QObject> *prop) { + static qsizetype data_count(QQmlListProperty<QObject> *prop) { QList<DataGuard> *list = static_cast<QList<DataGuard> *>(prop->data); return list->count(); } - static void data_replace(QQmlListProperty<QObject> *prop, int index, QObject *o) { + static void data_replace(QQmlListProperty<QObject> *prop, qsizetype index, QObject *o) { QList<DataGuard> *list = static_cast<QList<DataGuard> *>(prop->data); list->replace(index, DataGuard(o, list)); } diff --git a/src/quick/designer/qquickdesignersupportitems.cpp b/src/quick/designer/qquickdesignersupportitems.cpp index cec4fa2d7c..1797bd3ccf 100644 --- a/src/quick/designer/qquickdesignersupportitems.cpp +++ b/src/quick/designer/qquickdesignersupportitems.cpp @@ -128,7 +128,7 @@ static void allSubObjects(QObject *object, QObjectList &objectList) && QQmlMetaType::isList(metaProperty.userType())) { QQmlListReference list(object, metaProperty.name()); if (list.canCount() && list.canAt()) { - for (int i = 0; i < list.count(); i++) { + for (qsizetype i = 0; i < list.count(); i++) { QObject *propertyObject = list.at(i); allSubObjects(propertyObject, objectList); diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp index 44b91e5316..960b02ea9c 100644 --- a/src/quick/items/qquickflickable.cpp +++ b/src/quick/items/qquickflickable.cpp @@ -1908,13 +1908,13 @@ void QQuickFlickablePrivate::data_append(QQmlListProperty<QObject> *prop, QObjec } } -int QQuickFlickablePrivate::data_count(QQmlListProperty<QObject> *) +qsizetype QQuickFlickablePrivate::data_count(QQmlListProperty<QObject> *) { // XXX todo return 0; } -QObject *QQuickFlickablePrivate::data_at(QQmlListProperty<QObject> *, int) +QObject *QQuickFlickablePrivate::data_at(QQmlListProperty<QObject> *, qsizetype) { // XXX todo return nullptr; diff --git a/src/quick/items/qquickflickable_p_p.h b/src/quick/items/qquickflickable_p_p.h index 93b78d90de..4d47943702 100644 --- a/src/quick/items/qquickflickable_p_p.h +++ b/src/quick/items/qquickflickable_p_p.h @@ -273,8 +273,8 @@ public: // flickableData property static void data_append(QQmlListProperty<QObject> *, QObject *); - static int data_count(QQmlListProperty<QObject> *); - static QObject *data_at(QQmlListProperty<QObject> *, int); + static qsizetype data_count(QQmlListProperty<QObject> *); + static QObject *data_at(QQmlListProperty<QObject> *, qsizetype); static void data_clear(QQmlListProperty<QObject> *); }; diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index 493b3e1590..547c825502 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -3295,7 +3295,7 @@ void QQuickItemPrivate::data_append(QQmlListProperty<QObject> *prop, QObject *o) automatically assigned to this property. */ -int QQuickItemPrivate::data_count(QQmlListProperty<QObject> *property) +qsizetype QQuickItemPrivate::data_count(QQmlListProperty<QObject> *property) { QQuickItem *item = static_cast<QQuickItem*>(property->object); QQuickItemPrivate *privateItem = QQuickItemPrivate::get(item); @@ -3305,17 +3305,17 @@ int QQuickItemPrivate::data_count(QQmlListProperty<QObject> *property) return resources_count(&resourcesProperty) + children_count(&childrenProperty); } -QObject *QQuickItemPrivate::data_at(QQmlListProperty<QObject> *property, int i) +QObject *QQuickItemPrivate::data_at(QQmlListProperty<QObject> *property, qsizetype i) { QQuickItem *item = static_cast<QQuickItem*>(property->object); QQuickItemPrivate *privateItem = QQuickItemPrivate::get(item); QQmlListProperty<QObject> resourcesProperty = privateItem->resources(); QQmlListProperty<QQuickItem> childrenProperty = privateItem->children(); - int resourcesCount = resources_count(&resourcesProperty); + qsizetype resourcesCount = resources_count(&resourcesProperty); if (i < resourcesCount) return resources_at(&resourcesProperty, i); - const int j = i - resourcesCount; + const qsizetype j = i - resourcesCount; if (j < children_count(&childrenProperty)) return children_at(&childrenProperty, j); return nullptr; @@ -3332,7 +3332,7 @@ void QQuickItemPrivate::data_clear(QQmlListProperty<QObject> *property) children_clear(&childrenProperty); } -QObject *QQuickItemPrivate::resources_at(QQmlListProperty<QObject> *prop, int index) +QObject *QQuickItemPrivate::resources_at(QQmlListProperty<QObject> *prop, qsizetype index) { QQuickItemPrivate *quickItemPrivate = QQuickItemPrivate::get(static_cast<QQuickItem *>(prop->object)); return quickItemPrivate->extra.isAllocated() ? quickItemPrivate->extra->resourcesList.value(index) : 0; @@ -3349,7 +3349,7 @@ void QQuickItemPrivate::resources_append(QQmlListProperty<QObject> *prop, QObjec } } -int QQuickItemPrivate::resources_count(QQmlListProperty<QObject> *prop) +qsizetype QQuickItemPrivate::resources_count(QQmlListProperty<QObject> *prop) { QQuickItemPrivate *quickItemPrivate = QQuickItemPrivate::get(static_cast<QQuickItem *>(prop->object)); return quickItemPrivate->extra.isAllocated() ? quickItemPrivate->extra->resourcesList.count() : 0; @@ -3368,7 +3368,7 @@ void QQuickItemPrivate::resources_clear(QQmlListProperty<QObject> *prop) } } -QQuickItem *QQuickItemPrivate::children_at(QQmlListProperty<QQuickItem> *prop, int index) +QQuickItem *QQuickItemPrivate::children_at(QQmlListProperty<QQuickItem> *prop, qsizetype index) { QQuickItemPrivate *p = QQuickItemPrivate::get(static_cast<QQuickItem *>(prop->object)); if (index >= p->childItems.count() || index < 0) @@ -3389,7 +3389,7 @@ void QQuickItemPrivate::children_append(QQmlListProperty<QQuickItem> *prop, QQui o->setParentItem(that); } -int QQuickItemPrivate::children_count(QQmlListProperty<QQuickItem> *prop) +qsizetype QQuickItemPrivate::children_count(QQmlListProperty<QQuickItem> *prop) { QQuickItemPrivate *p = QQuickItemPrivate::get(static_cast<QQuickItem *>(prop->object)); return p->childItems.count(); @@ -3403,11 +3403,11 @@ void QQuickItemPrivate::children_clear(QQmlListProperty<QQuickItem> *prop) p->childItems.at(0)->setParentItem(nullptr); } -int QQuickItemPrivate::visibleChildren_count(QQmlListProperty<QQuickItem> *prop) +qsizetype QQuickItemPrivate::visibleChildren_count(QQmlListProperty<QQuickItem> *prop) { QQuickItemPrivate *p = QQuickItemPrivate::get(static_cast<QQuickItem *>(prop->object)); - int visibleCount = 0; - int c = p->childItems.count(); + qsizetype visibleCount = 0; + qsizetype c = p->childItems.count(); while (c--) { if (p->childItems.at(c)->isVisible()) visibleCount++; } @@ -3415,22 +3415,22 @@ int QQuickItemPrivate::visibleChildren_count(QQmlListProperty<QQuickItem> *prop) return visibleCount; } -QQuickItem *QQuickItemPrivate::visibleChildren_at(QQmlListProperty<QQuickItem> *prop, int index) +QQuickItem *QQuickItemPrivate::visibleChildren_at(QQmlListProperty<QQuickItem> *prop, qsizetype index) { QQuickItemPrivate *p = QQuickItemPrivate::get(static_cast<QQuickItem *>(prop->object)); - const int childCount = p->childItems.count(); + const qsizetype childCount = p->childItems.count(); if (index >= childCount || index < 0) return nullptr; - int visibleCount = -1; - for (int i = 0; i < childCount; i++) { + qsizetype visibleCount = -1; + for (qsizetype i = 0; i < childCount; i++) { if (p->childItems.at(i)->isVisible()) visibleCount++; if (visibleCount == index) return p->childItems.at(i); } return nullptr; } -int QQuickItemPrivate::transform_count(QQmlListProperty<QQuickTransform> *prop) +qsizetype QQuickItemPrivate::transform_count(QQmlListProperty<QQuickTransform> *prop) { QQuickItem *that = static_cast<QQuickItem *>(prop->object); QQuickItemPrivate *p = QQuickItemPrivate::get(that); @@ -3485,7 +3485,7 @@ void QQuickItemPrivate::transform_append(QQmlListProperty<QQuickTransform> *prop transform->appendToItem(that); } -QQuickTransform *QQuickItemPrivate::transform_at(QQmlListProperty<QQuickTransform> *prop, int idx) +QQuickTransform *QQuickItemPrivate::transform_at(QQmlListProperty<QQuickTransform> *prop, qsizetype idx) { QQuickItem *that = static_cast<QQuickItem *>(prop->object); QQuickItemPrivate *p = QQuickItemPrivate::get(that); @@ -3501,7 +3501,7 @@ void QQuickItemPrivate::transform_clear(QQmlListProperty<QQuickTransform> *prop) QQuickItem *that = static_cast<QQuickItem *>(prop->object); QQuickItemPrivate *p = QQuickItemPrivate::get(that); - for (int ii = 0; ii < p->transforms.count(); ++ii) { + for (qsizetype ii = 0; ii < p->transforms.count(); ++ii) { QQuickTransform *t = p->transforms.at(ii); QQuickTransformPrivate *tp = QQuickTransformPrivate::get(t); tp->items.removeOne(that); diff --git a/src/quick/items/qquickitem_p.h b/src/quick/items/qquickitem_p.h index 68c5d59dfe..1e33eadeac 100644 --- a/src/quick/items/qquickitem_p.h +++ b/src/quick/items/qquickitem_p.h @@ -288,31 +288,31 @@ public: // data property static void data_append(QQmlListProperty<QObject> *, QObject *); - static int data_count(QQmlListProperty<QObject> *); - static QObject *data_at(QQmlListProperty<QObject> *, int); + static qsizetype data_count(QQmlListProperty<QObject> *); + static QObject *data_at(QQmlListProperty<QObject> *, qsizetype); static void data_clear(QQmlListProperty<QObject> *); // resources property - static QObject *resources_at(QQmlListProperty<QObject> *, int); + static QObject *resources_at(QQmlListProperty<QObject> *, qsizetype); static void resources_append(QQmlListProperty<QObject> *, QObject *); - static int resources_count(QQmlListProperty<QObject> *); + static qsizetype resources_count(QQmlListProperty<QObject> *); static void resources_clear(QQmlListProperty<QObject> *); // children property static void children_append(QQmlListProperty<QQuickItem> *, QQuickItem *); - static int children_count(QQmlListProperty<QQuickItem> *); - static QQuickItem *children_at(QQmlListProperty<QQuickItem> *, int); + static qsizetype children_count(QQmlListProperty<QQuickItem> *); + static QQuickItem *children_at(QQmlListProperty<QQuickItem> *, qsizetype); static void children_clear(QQmlListProperty<QQuickItem> *); // visibleChildren property static void visibleChildren_append(QQmlListProperty<QQuickItem> *prop, QQuickItem *o); - static int visibleChildren_count(QQmlListProperty<QQuickItem> *prop); - static QQuickItem *visibleChildren_at(QQmlListProperty<QQuickItem> *prop, int index); + static qsizetype visibleChildren_count(QQmlListProperty<QQuickItem> *prop); + static QQuickItem *visibleChildren_at(QQmlListProperty<QQuickItem> *prop, qsizetype index); // transform property - static int transform_count(QQmlListProperty<QQuickTransform> *list); + static qsizetype transform_count(QQmlListProperty<QQuickTransform> *list); static void transform_append(QQmlListProperty<QQuickTransform> *list, QQuickTransform *); - static QQuickTransform *transform_at(QQmlListProperty<QQuickTransform> *list, int); + static QQuickTransform *transform_at(QQmlListProperty<QQuickTransform> *list, qsizetype); static void transform_clear(QQmlListProperty<QQuickTransform> *list); void _q_resourceObjectDeleted(QObject *); diff --git a/src/quick/items/qquickmultipointtoucharea_p.h b/src/quick/items/qquickmultipointtoucharea_p.h index 16e490adab..7b6426d3ab 100644 --- a/src/quick/items/qquickmultipointtoucharea_p.h +++ b/src/quick/items/qquickmultipointtoucharea_p.h @@ -240,12 +240,12 @@ public: q->addTouchPrototype(touch); } - static int touchPoint_count(QQmlListProperty<QQuickTouchPoint> *list) { + static qsizetype touchPoint_count(QQmlListProperty<QQuickTouchPoint> *list) { QQuickMultiPointTouchArea *q = static_cast<QQuickMultiPointTouchArea*>(list->object); return q->_touchPrototypes.count(); } - static QQuickTouchPoint* touchPoint_at(QQmlListProperty<QQuickTouchPoint> *list, int index) { + static QQuickTouchPoint* touchPoint_at(QQmlListProperty<QQuickTouchPoint> *list, qsizetype index) { QQuickMultiPointTouchArea *q = static_cast<QQuickMultiPointTouchArea*>(list->object); return q->_touchPrototypes.value(index); } diff --git a/src/quick/items/qquickspriteengine_p.h b/src/quick/items/qquickspriteengine_p.h index 5ad33389de..fb7b8e8bf1 100644 --- a/src/quick/items/qquickspriteengine_p.h +++ b/src/quick/items/qquickspriteengine_p.h @@ -314,7 +314,7 @@ inline void spriteAppend(QQmlListProperty<QQuickSprite> *p, QQuickSprite* s) p->object->metaObject()->invokeMethod(p->object, "createEngine"); } -inline QQuickSprite* spriteAt(QQmlListProperty<QQuickSprite> *p, int idx) +inline QQuickSprite* spriteAt(QQmlListProperty<QQuickSprite> *p, qsizetype idx) { return reinterpret_cast<QList<QQuickSprite *> *>(p->data)->at(idx); } @@ -325,12 +325,12 @@ inline void spriteClear(QQmlListProperty<QQuickSprite> *p) p->object->metaObject()->invokeMethod(p->object, "createEngine"); } -inline int spriteCount(QQmlListProperty<QQuickSprite> *p) +inline qsizetype spriteCount(QQmlListProperty<QQuickSprite> *p) { return reinterpret_cast<QList<QQuickSprite *> *>(p->data)->count(); } -inline void spriteReplace(QQmlListProperty<QQuickSprite> *p, int idx, QQuickSprite *s) +inline void spriteReplace(QQmlListProperty<QQuickSprite> *p, qsizetype idx, QQuickSprite *s) { reinterpret_cast<QList<QQuickSprite *> *>(p->data)->replace(idx, s); p->object->metaObject()->invokeMethod(p->object, "createEngine"); diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 384b334e9e..419ad5bb87 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -3378,7 +3378,7 @@ void QQuickWindowPrivate::data_append(QQmlListProperty<QObject> *property, QObje itemProperty.append(&itemProperty, o); } -int QQuickWindowPrivate::data_count(QQmlListProperty<QObject> *property) +qsizetype QQuickWindowPrivate::data_count(QQmlListProperty<QObject> *property) { QQuickWindow *win = static_cast<QQuickWindow*>(property->object); if (!win || !win->contentItem() || !QQuickItemPrivate::get(win->contentItem())->data().count) @@ -3387,7 +3387,7 @@ int QQuickWindowPrivate::data_count(QQmlListProperty<QObject> *property) return itemProperty.count(&itemProperty); } -QObject *QQuickWindowPrivate::data_at(QQmlListProperty<QObject> *property, int i) +QObject *QQuickWindowPrivate::data_at(QQmlListProperty<QObject> *property, qsizetype i) { QQuickWindow *win = static_cast<QQuickWindow*>(property->object); QQmlListProperty<QObject> itemProperty = QQuickItemPrivate::get(win->contentItem())->data(); @@ -3401,7 +3401,7 @@ void QQuickWindowPrivate::data_clear(QQmlListProperty<QObject> *property) itemProperty.clear(&itemProperty); } -void QQuickWindowPrivate::data_replace(QQmlListProperty<QObject> *property, int i, QObject *o) +void QQuickWindowPrivate::data_replace(QQmlListProperty<QObject> *property, qsizetype i, QObject *o) { QQuickWindow *win = static_cast<QQuickWindow*>(property->object); QQmlListProperty<QObject> itemProperty = QQuickItemPrivate::get(win->contentItem())->data(); diff --git a/src/quick/items/qquickwindow_p.h b/src/quick/items/qquickwindow_p.h index 81c0ebef45..62b16513c9 100644 --- a/src/quick/items/qquickwindow_p.h +++ b/src/quick/items/qquickwindow_p.h @@ -330,10 +330,10 @@ public: // data property static void data_append(QQmlListProperty<QObject> *, QObject *); - static int data_count(QQmlListProperty<QObject> *); - static QObject *data_at(QQmlListProperty<QObject> *, int); + static qsizetype data_count(QQmlListProperty<QObject> *); + static QObject *data_at(QQmlListProperty<QObject> *, qsizetype); static void data_clear(QQmlListProperty<QObject> *); - static void data_replace(QQmlListProperty<QObject> *, int, QObject *); + static void data_replace(QQmlListProperty<QObject> *, qsizetype, QObject *); static void data_removeLast(QQmlListProperty<QObject> *); static void rhiCreationFailureMessage(const QString &backendName, diff --git a/src/quick/util/qquickanimation.cpp b/src/quick/util/qquickanimation.cpp index b2fb0a4e1b..cfa8d3a51a 100644 --- a/src/quick/util/qquickanimation.cpp +++ b/src/quick/util/qquickanimation.cpp @@ -1724,14 +1724,14 @@ void QQuickAnimationGroupPrivate::append_animation(QQmlListProperty<QQuickAbstra a->setGroup(q); } -QQuickAbstractAnimation *QQuickAnimationGroupPrivate::at_animation(QQmlListProperty<QQuickAbstractAnimation> *list, int index) +QQuickAbstractAnimation *QQuickAnimationGroupPrivate::at_animation(QQmlListProperty<QQuickAbstractAnimation> *list, qsizetype index) { if (auto q = qmlobject_cast<QQuickAnimationGroup *>(list->object)) return q->d_func()->animations.at(index); return nullptr; } -int QQuickAnimationGroupPrivate::count_animation(QQmlListProperty<QQuickAbstractAnimation> *list) +qsizetype QQuickAnimationGroupPrivate::count_animation(QQmlListProperty<QQuickAbstractAnimation> *list) { if (auto q = qmlobject_cast<QQuickAnimationGroup *>(list->object)) return q->d_func()->animations.count(); @@ -1750,7 +1750,7 @@ void QQuickAnimationGroupPrivate::clear_animation(QQmlListProperty<QQuickAbstrac } void QQuickAnimationGroupPrivate::replace_animation(QQmlListProperty<QQuickAbstractAnimation> *list, - int i, QQuickAbstractAnimation *a) + qsizetype i, QQuickAbstractAnimation *a) { if (auto *q = qmlobject_cast<QQuickAnimationGroup *>(list->object)) { if (QQuickAbstractAnimation *anim = q->d_func()->animations.at(i)) diff --git a/src/quick/util/qquickanimation_p_p.h b/src/quick/util/qquickanimation_p_p.h index 8d23242b68..98d4751d1f 100644 --- a/src/quick/util/qquickanimation_p_p.h +++ b/src/quick/util/qquickanimation_p_p.h @@ -256,10 +256,10 @@ public: : QQuickAbstractAnimationPrivate() {} static void append_animation(QQmlListProperty<QQuickAbstractAnimation> *list, QQuickAbstractAnimation *role); - static QQuickAbstractAnimation *at_animation(QQmlListProperty<QQuickAbstractAnimation> *list, int index); - static int count_animation(QQmlListProperty<QQuickAbstractAnimation> *list); + static QQuickAbstractAnimation *at_animation(QQmlListProperty<QQuickAbstractAnimation> *list, qsizetype index); + static qsizetype count_animation(QQmlListProperty<QQuickAbstractAnimation> *list); static void clear_animation(QQmlListProperty<QQuickAbstractAnimation> *list); - static void replace_animation(QQmlListProperty<QQuickAbstractAnimation> *list, int index, + static void replace_animation(QQmlListProperty<QQuickAbstractAnimation> *list, qsizetype index, QQuickAbstractAnimation *role); static void removeLast_animation(QQmlListProperty<QQuickAbstractAnimation> *list); QList<QQuickAbstractAnimation *> animations; diff --git a/src/quick/util/qquickapplication.cpp b/src/quick/util/qquickapplication.cpp index fef87bd931..1c0522451a 100644 --- a/src/quick/util/qquickapplication.cpp +++ b/src/quick/util/qquickapplication.cpp @@ -113,12 +113,12 @@ void QQuickApplication::setDisplayName(const QString &displayName) return QGuiApplication::setApplicationDisplayName(displayName); } -int screens_count(QQmlListProperty<QQuickScreenInfo> *prop) +qsizetype screens_count(QQmlListProperty<QQuickScreenInfo> *prop) { return static_cast<QVector<QQuickScreenInfo *> *>(prop->data)->count(); } -QQuickScreenInfo *screens_at(QQmlListProperty<QQuickScreenInfo> *prop, int idx) +QQuickScreenInfo *screens_at(QQmlListProperty<QQuickScreenInfo> *prop, qsizetype idx) { return static_cast<QVector<QQuickScreenInfo *> *>(prop->data)->at(idx); } diff --git a/src/quick/util/qquickpath.cpp b/src/quick/util/qquickpath.cpp index 74ee52b1d3..5ac28f45d9 100644 --- a/src/quick/util/qquickpath.cpp +++ b/src/quick/util/qquickpath.cpp @@ -283,7 +283,7 @@ static QQuickPathPrivate *privatePath(QObject *object) return QQuickPathPrivate::get(path); } -QQuickPathElement *QQuickPath::pathElements_at(QQmlListProperty<QQuickPathElement> *property, int index) +QQuickPathElement *QQuickPath::pathElements_at(QQmlListProperty<QQuickPathElement> *property, qsizetype index) { QQuickPathPrivate *d = privatePath(property->object); @@ -315,7 +315,7 @@ void QQuickPath::pathElements_append(QQmlListProperty<QQuickPathElement> *proper } } -int QQuickPath::pathElements_count(QQmlListProperty<QQuickPathElement> *property) +qsizetype QQuickPath::pathElements_count(QQmlListProperty<QQuickPathElement> *property) { QQuickPathPrivate *d = privatePath(property->object); diff --git a/src/quick/util/qquickpath_p.h b/src/quick/util/qquickpath_p.h index 8660537587..51321ce58c 100644 --- a/src/quick/util/qquickpath_p.h +++ b/src/quick/util/qquickpath_p.h @@ -568,9 +568,9 @@ protected: void gatherAttributes(); // pathElements property - static QQuickPathElement *pathElements_at(QQmlListProperty<QQuickPathElement> *, int); + static QQuickPathElement *pathElements_at(QQmlListProperty<QQuickPathElement> *, qsizetype); static void pathElements_append(QQmlListProperty<QQuickPathElement> *, QQuickPathElement *); - static int pathElements_count(QQmlListProperty<QQuickPathElement> *); + static qsizetype pathElements_count(QQmlListProperty<QQuickPathElement> *); static void pathElements_clear(QQmlListProperty<QQuickPathElement> *); private Q_SLOTS: diff --git a/src/quick/util/qquickstate_p_p.h b/src/quick/util/qquickstate_p_p.h index ae4ed291b5..6f9bb180bc 100644 --- a/src/quick/util/qquickstate_p_p.h +++ b/src/quick/util/qquickstate_p_p.h @@ -236,15 +236,15 @@ public: e->setState(nullptr); list->clear(); } - static int operations_count(QQmlListProperty<QQuickStateOperation> *prop) { + static qsizetype operations_count(QQmlListProperty<QQuickStateOperation> *prop) { QList<OperationGuard> *list = static_cast<QList<OperationGuard> *>(prop->data); return list->count(); } - static QQuickStateOperation *operations_at(QQmlListProperty<QQuickStateOperation> *prop, int index) { + static QQuickStateOperation *operations_at(QQmlListProperty<QQuickStateOperation> *prop, qsizetype index) { QList<OperationGuard> *list = static_cast<QList<OperationGuard> *>(prop->data); return list->at(index); } - static void operations_replace(QQmlListProperty<QQuickStateOperation> *prop, int index, + static void operations_replace(QQmlListProperty<QQuickStateOperation> *prop, qsizetype index, QQuickStateOperation *op) { QList<OperationGuard> *list = static_cast<QList<OperationGuard> *>(prop->data); auto &guard = list->at(index); diff --git a/src/quick/util/qquickstategroup.cpp b/src/quick/util/qquickstategroup.cpp index 9cb3e26c04..b86333943c 100644 --- a/src/quick/util/qquickstategroup.cpp +++ b/src/quick/util/qquickstategroup.cpp @@ -67,15 +67,15 @@ public: QQuickState *nullState; static void append_state(QQmlListProperty<QQuickState> *list, QQuickState *state); - static int count_state(QQmlListProperty<QQuickState> *list); - static QQuickState *at_state(QQmlListProperty<QQuickState> *list, int index); + static qsizetype count_state(QQmlListProperty<QQuickState> *list); + static QQuickState *at_state(QQmlListProperty<QQuickState> *list, qsizetype index); static void clear_states(QQmlListProperty<QQuickState> *list); - static void replace_states(QQmlListProperty<QQuickState> *list, int index, QQuickState *state); + static void replace_states(QQmlListProperty<QQuickState> *list, qsizetype index, QQuickState *state); static void removeLast_states(QQmlListProperty<QQuickState> *list); static void append_transition(QQmlListProperty<QQuickTransition> *list, QQuickTransition *state); - static int count_transitions(QQmlListProperty<QQuickTransition> *list); - static QQuickTransition *at_transition(QQmlListProperty<QQuickTransition> *list, int index); + static qsizetype count_transitions(QQmlListProperty<QQuickTransition> *list); + static QQuickTransition *at_transition(QQmlListProperty<QQuickTransition> *list, qsizetype index); static void clear_transitions(QQmlListProperty<QQuickTransition> *list); QList<QQuickState *> states; @@ -184,13 +184,13 @@ void QQuickStateGroupPrivate::append_state(QQmlListProperty<QQuickState> *list, } -int QQuickStateGroupPrivate::count_state(QQmlListProperty<QQuickState> *list) +qsizetype QQuickStateGroupPrivate::count_state(QQmlListProperty<QQuickState> *list) { QQuickStateGroup *_this = static_cast<QQuickStateGroup *>(list->object); return _this->d_func()->states.count(); } -QQuickState *QQuickStateGroupPrivate::at_state(QQmlListProperty<QQuickState> *list, int index) +QQuickState *QQuickStateGroupPrivate::at_state(QQmlListProperty<QQuickState> *list, qsizetype index) { QQuickStateGroup *_this = static_cast<QQuickStateGroup *>(list->object); return _this->d_func()->states.at(index); @@ -200,13 +200,13 @@ void QQuickStateGroupPrivate::clear_states(QQmlListProperty<QQuickState> *list) { QQuickStateGroup *_this = static_cast<QQuickStateGroup *>(list->object); _this->d_func()->setCurrentStateInternal(QString(), true); - for (int i = 0; i < _this->d_func()->states.count(); ++i) { + for (qsizetype i = 0; i < _this->d_func()->states.count(); ++i) { _this->d_func()->states.at(i)->setStateGroup(nullptr); } _this->d_func()->states.clear(); } -void QQuickStateGroupPrivate::replace_states(QQmlListProperty<QQuickState> *list, int index, QQuickState *state) +void QQuickStateGroupPrivate::replace_states(QQmlListProperty<QQuickState> *list, qsizetype index, QQuickState *state) { auto *self = qobject_cast<QQuickStateGroup *>(list->object); auto *d = self->d_func(); @@ -265,13 +265,13 @@ void QQuickStateGroupPrivate::append_transition(QQmlListProperty<QQuickTransitio _this->d_func()->transitions.append(trans); } -int QQuickStateGroupPrivate::count_transitions(QQmlListProperty<QQuickTransition> *list) +qsizetype QQuickStateGroupPrivate::count_transitions(QQmlListProperty<QQuickTransition> *list) { QQuickStateGroup *_this = static_cast<QQuickStateGroup *>(list->object); return _this->d_func()->transitions.count(); } -QQuickTransition *QQuickStateGroupPrivate::at_transition(QQmlListProperty<QQuickTransition> *list, int index) +QQuickTransition *QQuickStateGroupPrivate::at_transition(QQmlListProperty<QQuickTransition> *list, qsizetype index) { QQuickStateGroup *_this = static_cast<QQuickStateGroup *>(list->object); return _this->d_func()->transitions.at(index); diff --git a/src/quick/util/qquicktransition.cpp b/src/quick/util/qquicktransition.cpp index b973309212..2f736e8aca 100644 --- a/src/quick/util/qquicktransition.cpp +++ b/src/quick/util/qquicktransition.cpp @@ -135,8 +135,8 @@ public: protected: static void append_animation(QQmlListProperty<QQuickAbstractAnimation> *list, QQuickAbstractAnimation *a); - static int animation_count(QQmlListProperty<QQuickAbstractAnimation> *list); - static QQuickAbstractAnimation* animation_at(QQmlListProperty<QQuickAbstractAnimation> *list, int pos); + static qsizetype animation_count(QQmlListProperty<QQuickAbstractAnimation> *list); + static QQuickAbstractAnimation* animation_at(QQmlListProperty<QQuickAbstractAnimation> *list, qsizetype pos); static void clear_animations(QQmlListProperty<QQuickAbstractAnimation> *list); QList<QQuickAbstractAnimation *> animations; }; @@ -148,13 +148,13 @@ void QQuickTransitionPrivate::append_animation(QQmlListProperty<QQuickAbstractAn a->setDisableUserControl(); } -int QQuickTransitionPrivate::animation_count(QQmlListProperty<QQuickAbstractAnimation> *list) +qsizetype QQuickTransitionPrivate::animation_count(QQmlListProperty<QQuickAbstractAnimation> *list) { QQuickTransition *q = static_cast<QQuickTransition *>(list->object); return q->d_func()->animations.count(); } -QQuickAbstractAnimation* QQuickTransitionPrivate::animation_at(QQmlListProperty<QQuickAbstractAnimation> *list, int pos) +QQuickAbstractAnimation* QQuickTransitionPrivate::animation_at(QQmlListProperty<QQuickAbstractAnimation> *list, qsizetype pos) { QQuickTransition *q = static_cast<QQuickTransition *>(list->object); return q->d_func()->animations.at(pos); 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<QObject> *prop, QObject } } -int QObjectContainer::children_count(QQmlListProperty<QObject> *prop) +qsizetype QObjectContainer::children_count(QQmlListProperty<QObject> *prop) { return static_cast<QObjectContainer*>(prop->object)->dataChildren.count(); } -QObject *QObjectContainer::children_at(QQmlListProperty<QObject> *prop, int index) +QObject *QObjectContainer::children_at(QQmlListProperty<QObject> *prop, qsizetype index) { return static_cast<QObjectContainer*>(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<QObject> data(); static void children_append(QQmlListProperty<QObject> *prop, QObject *o); - static int children_count(QQmlListProperty<QObject> *prop); - static QObject *children_at(QQmlListProperty<QObject> *prop, int index); + static qsizetype children_count(QQmlListProperty<QObject> *prop); + static QObject *children_at(QQmlListProperty<QObject> *prop, qsizetype index); static void children_clear(QQmlListProperty<QObject> *prop); QList<QObject*> 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<TestType> *p, TestType *v) { reinterpret_cast<QList<TestType *> *>(p->data)->append(v); } - static int count(QQmlListProperty<TestType> *p) { + static qsizetype count(QQmlListProperty<TestType> *p) { return reinterpret_cast<QList<TestType *> *>(p->data)->count(); } - static TestType *at(QQmlListProperty<TestType> *p, int idx) { + static TestType *at(QQmlListProperty<TestType> *p, qsizetype idx) { return reinterpret_cast<QList<TestType *> *>(p->data)->at(idx); } static void clear(QQmlListProperty<TestType> *p) { return reinterpret_cast<QList<TestType *> *>(p->data)->clear(); } - static void replace(QQmlListProperty<TestType> *p, int idx, TestType *v) { + static void replace(QQmlListProperty<TestType> *p, qsizetype idx, TestType *v) { return reinterpret_cast<QList<TestType *> *>(p->data)->replace(idx, v); } static void removeLast(QQmlListProperty<TestType> *p) { diff --git a/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp b/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp index 0c082ed0e7..8bc9700fbe 100644 --- a/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp +++ b/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp @@ -4274,13 +4274,13 @@ public: &ObjectsProvider::listAt); } - static int listLength(QQmlListProperty<QObject> *property) + static qsizetype listLength(QQmlListProperty<QObject> *property) { auto objectsProvider = qobject_cast<ObjectsProvider*>(property->object); return objectsProvider ? objectsProvider->m_objects.length() : 0; } - static QObject* listAt(QQmlListProperty<QObject> *property, int index) + static QObject* listAt(QQmlListProperty<QObject> *property, qsizetype index) { auto objectsProvider = qobject_cast<ObjectsProvider*>(property->object); return objectsProvider ? objectsProvider->m_objects.at(index) : nullptr; |