diff options
| author | Christian Tismer <tismer@stackless.com> | 2021-01-05 18:50:49 +0100 |
|---|---|---|
| committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-01-06 14:22:22 +0000 |
| commit | b9a89e1f3c8d0b80cc91bf1d277ead3b7857dabd (patch) | |
| tree | e557dbe0120f290f169acd10498d08fc7dbcb88f /sources/pyside6/libpyside/pyside.cpp | |
| parent | 09670a8746fa443c4b8271381bf21fc5c993f1bb (diff) | |
feature: Disable selection while creating a type
PySide 6 suddenly has problems with feature switching during
subtype initialization.
We introduce an enable function that can temporarily suppress
switching. This problem is solved so far.
It is the question whether this will break again in another
constellation. It might be considerable for the future to have
something like Python's PyType_Ready function.
Right now this is too much effort.
Change-Id: If0ed786d4761cf2356f01f7478e4a0d750e88d3c
Fixes: PYSIDE-1463
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
(cherry picked from commit b6d1b76b46d7b756f7cb01361037e1cb5efc990a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'sources/pyside6/libpyside/pyside.cpp')
| -rw-r--r-- | sources/pyside6/libpyside/pyside.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sources/pyside6/libpyside/pyside.cpp b/sources/pyside6/libpyside/pyside.cpp index 7cc17f0c6..75b3eb16f 100644 --- a/sources/pyside6/libpyside/pyside.cpp +++ b/sources/pyside6/libpyside/pyside.cpp @@ -50,6 +50,7 @@ #include "pysidemetafunction_p.h" #include "pysidemetafunction.h" #include "dynamicqmetaobject.h" +#include "feature_select.h" #include <autodecref.h> #include <basewrapper.h> @@ -285,7 +286,11 @@ void initQObjectSubType(SbkObjectType *type, PyObject *args, PyObject * /* kwds qWarning("Sub class of QObject not inheriting QObject!? Crash will happen when using %s.", className.constData()); return; } + // PYSIDE-1463: Don't change feature selection durin subtype initialization. + // This behavior is observed with PySide 6. + PySide::Feature::Enable(false); initDynamicMetaObject(type, userData->mo.update(), userData->cppObjSize); + PySide::Feature::Enable(true); } void initQApp() |
