aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/libpyside/feature_select.cpp
diff options
context:
space:
mode:
authorChristian Tismer <[email protected]>2021-07-20 10:55:10 +0200
committerChristian Tismer <[email protected]>2021-07-28 18:41:46 +0200
commit9b5fa60d1fed5025e97c393ba1bab80f81ba833a (patch)
tree4a3e9810b4d46ffa6ae3c8bc88ad9af18d0f2e36 /sources/pyside6/libpyside/feature_select.cpp
parentf0ebbfa8b128be39fe618188cad3320987c89051 (diff)
feature: fix the UIC switching problem
The BindingManager::getOverride function computes the current switch state from information of a type object. But the type object must first be updated in case a switch has happened. The solution was an extra update call at the beginning of the function. This solution _always_ works, with or without inheritance, for Python >= 3.7. [ChangeLog][shiboken6] Coexistence of different feature selections works now, especially for UIC files and inheritance. Fixes: PYSIDE-1626 Pick-to: 6.1 Pick-to: 5.15 Change-Id: I577331cfb2d7511110d1e16e729bed80985340a0 Reviewed-by: Friedemann Kleint <[email protected]>
Diffstat (limited to 'sources/pyside6/libpyside/feature_select.cpp')
-rw-r--r--sources/pyside6/libpyside/feature_select.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/sources/pyside6/libpyside/feature_select.cpp b/sources/pyside6/libpyside/feature_select.cpp
index 7d95034f0..45af38bd7 100644
--- a/sources/pyside6/libpyside/feature_select.cpp
+++ b/sources/pyside6/libpyside/feature_select.cpp
@@ -253,6 +253,7 @@ static bool replaceClassDict(PyTypeObject *type)
// Replace `__dict__` which usually has refcount 1 (but see cyclic_test.py)
Py_DECREF(type->tp_dict);
type->tp_dict = new_dict;
+ setCurrentSelectId(type, select_id.object());
return true;
}
@@ -273,6 +274,7 @@ static bool addNewDict(PyTypeObject *type, PyObject *select_id)
setNextDict(dict, new_dict);
setNextDict(new_dict, next_dict);
type->tp_dict = new_dict;
+ setCurrentSelectId(type, select_id);
return true;
}
@@ -295,6 +297,7 @@ static bool moveToFeatureSet(PyTypeObject *type, PyObject *select_id)
}
} while (dict != initial_dict);
type->tp_dict = initial_dict;
+ setCurrentSelectId(type, getSelectId(initial_dict));
return false;
}