diff options
| author | Cristián Maureira-Fredes <cristian.maureira-fredes@qt.io> | 2024-11-06 11:10:03 +0100 |
|---|---|---|
| committer | Cristián Maureira-Fredes <Cristian.Maureira-Fredes@qt.io> | 2024-11-08 14:24:28 +0100 |
| commit | 65a9ae9a853fa68ff997edbe3d6fd4eed022f1a0 (patch) | |
| tree | 735b82851430560a81ec28a848cdd09fdb2c36c0 /sources/pyside6/libpysideqml/pysideqmllistproperty.cpp | |
| parent | c951f11196d0572b7250a74197937c02b74604dd (diff) | |
limited api: Remove PyTuple_GET_ITEM, PyTuple_SET_ITEM, and PyTuple_GET_SIZE macros
Removing old macros for compatibility with the limited api,
and refactoring some of their usages
Change-Id: I33954199d2ef9884c64b963863b97aed851c440f
Pick-to: 6.8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside6/libpysideqml/pysideqmllistproperty.cpp')
| -rw-r--r-- | sources/pyside6/libpysideqml/pysideqmllistproperty.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/sources/pyside6/libpysideqml/pysideqmllistproperty.cpp b/sources/pyside6/libpysideqml/pysideqmllistproperty.cpp index 5722dd441..447d16564 100644 --- a/sources/pyside6/libpysideqml/pysideqmllistproperty.cpp +++ b/sources/pyside6/libpysideqml/pysideqmllistproperty.cpp @@ -139,9 +139,9 @@ void propListAppender(QQmlListProperty<QObject> *propList, QObject *item) Shiboken::AutoDecRef args(PyTuple_New(2)); PyTypeObject *qobjectType = qObjectType(); - PyTuple_SET_ITEM(args, 0, + PyTuple_SetItem(args, 0, Shiboken::Conversions::pointerToPython(qobjectType, propList->object)); - PyTuple_SET_ITEM(args, 1, + PyTuple_SetItem(args, 1, Shiboken::Conversions::pointerToPython(qobjectType, item)); auto *data = reinterpret_cast<QmlListPropertyPrivate *>(propList->data); @@ -157,7 +157,7 @@ qsizetype propListCount(QQmlListProperty<QObject> *propList) Shiboken::GilState state; Shiboken::AutoDecRef args(PyTuple_New(1)); - PyTuple_SET_ITEM(args, 0, + PyTuple_SetItem(args, 0, Shiboken::Conversions::pointerToPython(qObjectType(), propList->object)); auto *data = reinterpret_cast<QmlListPropertyPrivate *>(propList->data); @@ -183,10 +183,10 @@ QObject *propListAt(QQmlListProperty<QObject> *propList, qsizetype index) Shiboken::AutoDecRef args(PyTuple_New(2)); PyTypeObject *qobjectType = qObjectType(); - PyTuple_SET_ITEM(args, 0, + PyTuple_SetItem(args, 0, Shiboken::Conversions::pointerToPython(qobjectType, propList->object)); auto *converter = Shiboken::Conversions::PrimitiveTypeConverter<qsizetype>(); - PyTuple_SET_ITEM(args, 1, + PyTuple_SetItem(args, 1, Shiboken::Conversions::copyToPython(converter, &index)); auto *data = reinterpret_cast<QmlListPropertyPrivate *>(propList->data); @@ -207,7 +207,7 @@ void propListClear(QQmlListProperty<QObject> * propList) Shiboken::AutoDecRef args(PyTuple_New(1)); PyTypeObject *qobjectType = qObjectType(); - PyTuple_SET_ITEM(args, 0, + PyTuple_SetItem(args, 0, Shiboken::Conversions::pointerToPython(qobjectType, propList->object)); auto *data = reinterpret_cast<QmlListPropertyPrivate *>(propList->data); @@ -224,12 +224,12 @@ void propListReplace(QQmlListProperty<QObject> *propList, qsizetype index, QObje Shiboken::AutoDecRef args(PyTuple_New(3)); PyTypeObject *qobjectType = qObjectType(); - PyTuple_SET_ITEM(args, 0, + PyTuple_SetItem(args, 0, Shiboken::Conversions::pointerToPython(qobjectType, propList->object)); auto *converter = Shiboken::Conversions::PrimitiveTypeConverter<qsizetype>(); - PyTuple_SET_ITEM(args, 1, + PyTuple_SetItem(args, 1, Shiboken::Conversions::copyToPython(converter, &index)); - PyTuple_SET_ITEM(args, 2, + PyTuple_SetItem(args, 2, Shiboken::Conversions::pointerToPython(qobjectType, value)); auto *data = reinterpret_cast<QmlListPropertyPrivate *>(propList->data); @@ -246,7 +246,7 @@ void propListRemoveLast(QQmlListProperty<QObject> *propList) Shiboken::AutoDecRef args(PyTuple_New(1)); PyTypeObject *qobjectType = qObjectType(); - PyTuple_SET_ITEM(args, 0, + PyTuple_SetItem(args, 0, Shiboken::Conversions::pointerToPython(qobjectType, propList->object)); auto *data = reinterpret_cast<QmlListPropertyPrivate *>(propList->data); |
