From 60d5a5b05041e05556becbf1ce6efada6e477421 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 26 Sep 2025 14:56:39 +0200 Subject: libpyside: Add qobjectType() to return the Python type QObject Set it directly instead of looking it up via converters, which is a step towards decoupling the converters from the per-interpreter types and saves dict lookups. Task-number: PYSIDE-3155 Change-Id: I31a71d1a9d02f1247e04c57de2c2901746221b4f Reviewed-by: Cristian Maureira-Fredes --- .../pyside6/libpysideremoteobjects/pysidedynamicclass.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'sources/pyside6/libpysideremoteobjects/pysidedynamicclass.cpp') diff --git a/sources/pyside6/libpysideremoteobjects/pysidedynamicclass.cpp b/sources/pyside6/libpysideremoteobjects/pysidedynamicclass.cpp index d0b2bfb96..30ea9a6d1 100644 --- a/sources/pyside6/libpysideremoteobjects/pysidedynamicclass.cpp +++ b/sources/pyside6/libpysideremoteobjects/pysidedynamicclass.cpp @@ -51,16 +51,9 @@ PyObject *propertiesAttr() struct SourceDefs { - static PyTypeObject *getSbkType() - { - static PyTypeObject *sbkType = - Shiboken::Conversions::getPythonTypeObject("QObject"); - return sbkType; - } - static PyObject *getBases() { - static PyObject *bases = PyTuple_Pack(1, getSbkType()); + static PyObject *bases = PyTuple_Pack(1, PySide::qObjectType()); return bases; } @@ -71,8 +64,8 @@ struct SourceDefs static int tp_init(PyObject *self, PyObject *args, PyObject *kwds) { - static initproc initFunc = reinterpret_cast(PyType_GetSlot(getSbkType(), - Py_tp_init)); + static initproc initFunc = + reinterpret_cast(PyType_GetSlot(PySide::qObjectType(), Py_tp_init)); int res = initFunc(self, args, kwds); if (res < 0) { PyErr_Print(); -- cgit v1.2.3