diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-01-12 12:11:20 +0100 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-01-16 11:20:58 +0100 |
| commit | 15fe017be6eb8b3aaf32d06eb21c61bd7eb3907e (patch) | |
| tree | 7208cfd73e38ce3cc78e67eb88fa3d301719c79d /sources/pyside6/PySide6/QtQml/pysideqmlvolatilebool.cpp | |
| parent | a136723223b06169321296cd6cbc4c4c694e5153 (diff) | |
Use PyType_GetSlot() instead of accessing PyTypeObject's slots in library code
Using PepType_GetSlot() as is requires adding ugly casts. To work
around, add a new file with convenience helper functions in C++
linkage. This also allows for using templates for tp_alloc.
Task-number: PYSIDE-560
Change-Id: Ia50a226f5b545861f885d600445b91b4e11713c5
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/pyside6/PySide6/QtQml/pysideqmlvolatilebool.cpp')
| -rw-r--r-- | sources/pyside6/PySide6/QtQml/pysideqmlvolatilebool.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sources/pyside6/PySide6/QtQml/pysideqmlvolatilebool.cpp b/sources/pyside6/PySide6/QtQml/pysideqmlvolatilebool.cpp index e92e13aaf..6e403ab72 100644 --- a/sources/pyside6/PySide6/QtQml/pysideqmlvolatilebool.cpp +++ b/sources/pyside6/PySide6/QtQml/pysideqmlvolatilebool.cpp @@ -3,6 +3,7 @@ #include "pysideqmlvolatilebool.h" +#include <pep384ext.h> #include <signature.h> #include <QtCore/QDebug> @@ -30,8 +31,7 @@ QtQml_VolatileBoolObject_new(PyTypeObject *type, PyObject *args, PyObject *kwds) if (ok < 0) return nullptr; - QtQml_VolatileBoolObject *self - = reinterpret_cast<QtQml_VolatileBoolObject *>(type->tp_alloc(type, 0)); + auto *self = PepExt_TypeCallAlloc<QtQml_VolatileBoolObject>(type, 0); if (self != nullptr) self->flag = new AtomicBool(ok); |
