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/PySide6/QtCore | |
| 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/PySide6/QtCore')
| -rw-r--r-- | sources/pyside6/PySide6/QtCore/glue/core_snippets.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sources/pyside6/PySide6/QtCore/glue/core_snippets.cpp b/sources/pyside6/PySide6/QtCore/glue/core_snippets.cpp index 3f8172871..c073c8bc1 100644 --- a/sources/pyside6/PySide6/QtCore/glue/core_snippets.cpp +++ b/sources/pyside6/PySide6/QtCore/glue/core_snippets.cpp @@ -45,8 +45,8 @@ QMetaType QVariant_resolveMetaType(PyTypeObject *type) // that has added any python fields or slots to its object layout. // See https://mail.python.org/pipermail/python-list/2009-January/520733.html if (type->tp_bases) { - for (Py_ssize_t i = 0, size = PyTuple_GET_SIZE(type->tp_bases); i < size; ++i) { - auto baseType = reinterpret_cast<PyTypeObject *>(PyTuple_GET_ITEM(type->tp_bases, i)); + for (Py_ssize_t i = 0, size = PyTuple_Size(type->tp_bases); i < size; ++i) { + auto baseType = reinterpret_cast<PyTypeObject *>(PyTuple_GetItem(type->tp_bases, i)); const QMetaType derived = QVariant_resolveMetaType(baseType); if (derived.isValid()) return derived; @@ -224,13 +224,13 @@ void qObjectFindChildren(const QObject *parent, const QRegularExpression &patter QString qObjectTr(PyTypeObject *type, const char *sourceText, const char *disambiguation, int n) { PyObject *mro = type->tp_mro; - auto len = PyTuple_GET_SIZE(mro); + auto len = PyTuple_Size(mro); QString result = QString::fromUtf8(sourceText); QString oldResult = result; static auto *sbkObjectType = reinterpret_cast<PyTypeObject *>(SbkObject_TypeF()); for (Py_ssize_t idx = 0; idx < len - 1; ++idx) { // Skip the last class which is `object`. - auto *type = reinterpret_cast<PyTypeObject *>(PyTuple_GET_ITEM(mro, idx)); + auto *type = reinterpret_cast<PyTypeObject *>(PyTuple_GetItem(mro, idx)); if (type == sbkObjectType) continue; const char *context = type->tp_name; |
