diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2025-09-26 14:56:39 +0200 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2025-10-01 16:04:42 +0200 |
| commit | 60d5a5b05041e05556becbf1ce6efada6e477421 (patch) | |
| tree | 694958029de8b97c03a8a907ff8a3f4c1e649846 /sources/pyside6/libpysideremoteobjects/pysidedynamicclass.cpp | |
| parent | d2f9814c62ee6904cdcbc66c03fdde3f476fa34b (diff) | |
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 <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/pyside6/libpysideremoteobjects/pysidedynamicclass.cpp')
| -rw-r--r-- | sources/pyside6/libpysideremoteobjects/pysidedynamicclass.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
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<initproc>(PyType_GetSlot(getSbkType(), - Py_tp_init)); + static initproc initFunc = + reinterpret_cast<initproc>(PyType_GetSlot(PySide::qObjectType(), Py_tp_init)); int res = initFunc(self, args, kwds); if (res < 0) { PyErr_Print(); |
