aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/libpyside/feature_select.cpp
diff options
context:
space:
mode:
authorChristian Tismer <[email protected]>2021-01-05 18:50:49 +0100
committerChristian Tismer <[email protected]>2021-01-06 14:01:45 +0100
commitb6d1b76b46d7b756f7cb01361037e1cb5efc990a (patch)
tree5f82399ecc57397c79e59caab286f690dbbcbe3c /sources/pyside6/libpyside/feature_select.cpp
parentb62040783613568901e76a26799e130632004a7e (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 Pick-to: 6.0 Pick-to: 5.15 Reviewed-by: Cristian Maureira-Fredes <[email protected]>
Diffstat (limited to 'sources/pyside6/libpyside/feature_select.cpp')
-rw-r--r--sources/pyside6/libpyside/feature_select.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/sources/pyside6/libpyside/feature_select.cpp b/sources/pyside6/libpyside/feature_select.cpp
index 47a7472e1..b87751271 100644
--- a/sources/pyside6/libpyside/feature_select.cpp
+++ b/sources/pyside6/libpyside/feature_select.cpp
@@ -451,11 +451,11 @@ void finalize()
}
static bool patch_property_impl();
+static bool is_initialized = false;
void init()
{
// This function can be called multiple times.
- static bool is_initialized = false;
if (!is_initialized) {
fast_id_array = &_fast_id_array[1];
for (int idx = -1; idx < 256; ++idx)
@@ -472,6 +472,14 @@ void init()
cached_globals = nullptr;
}
+void Enable(bool enable)
+{
+ if (!is_initialized)
+ return;
+ featurePointer = enable ? featureProcArray : nullptr;
+ initSelectableFeature(enable ? SelectFeatureSet : nullptr);
+}
+
//////////////////////////////////////////////////////////////////////////////
//
// PYSIDE-1019: Support switchable extensions