aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/PySide6/QtQml/pysideqmlregistertype.cpp
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2021-09-11 15:51:02 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2021-09-13 19:03:22 +0000
commit009bc0f4bee5a39e08aaae6ef31c17e30f58bf91 (patch)
tree548afa419d4b4d0f4072beb576e29164cd930d52 /sources/pyside6/PySide6/QtQml/pysideqmlregistertype.cpp
parent99a7fe1dac829be9533f2cb9c284401b650a08a1 (diff)
Shiboken: Change type(SbkType_FromSpec) to PyType_Object
This step prepares the transition of type generation to PyPy compatibility. [ChangeLog][shiboken6] SbkType_FromSpec() has been changed to return a PyType_Object *. Task-number: PYSIDE-535 Change-Id: I74e2e527e66a41f1a9f3f911f44d641139371889 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside6/PySide6/QtQml/pysideqmlregistertype.cpp')
-rw-r--r--sources/pyside6/PySide6/QtQml/pysideqmlregistertype.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/sources/pyside6/PySide6/QtQml/pysideqmlregistertype.cpp b/sources/pyside6/PySide6/QtQml/pysideqmlregistertype.cpp
index 82824c77a..aa89579be 100644
--- a/sources/pyside6/PySide6/QtQml/pysideqmlregistertype.cpp
+++ b/sources/pyside6/PySide6/QtQml/pysideqmlregistertype.cpp
@@ -405,12 +405,8 @@ static PyType_Spec PropertyListType_spec = {
PyTypeObject *PropertyListTypeF(void)
{
- static PyTypeObject *type = nullptr;
- if (!type) {
- PyObject *bases = Py_BuildValue("(O)", PySidePropertyTypeF());
- type = (PyTypeObject *)SbkType_FromSpecWithBases(&PropertyListType_spec, bases);
- Py_XDECREF(bases);
- }
+ static Shiboken::AutoDecRef bases(Py_BuildValue("(O)", PySidePropertyTypeF()));
+ static auto *type = SbkType_FromSpecWithBases(&PropertyListType_spec, bases);
return type;
}
@@ -674,8 +670,7 @@ static PyType_Spec QtQml_VolatileBoolType_spec = {
PyTypeObject *QtQml_VolatileBoolTypeF(void)
{
- static PyTypeObject *type = reinterpret_cast<PyTypeObject *>(
- SbkType_FromSpec(&QtQml_VolatileBoolType_spec));
+ static auto *type = SbkType_FromSpec(&QtQml_VolatileBoolType_spec);
return type;
}