diff options
author | Christian Tismer <tismer@stackless.com> | 2022-11-21 12:06:18 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-11-29 21:10:22 +0000 |
commit | 1bb1f9b5ce6d1ad656c21768f2393d1bc75845d2 (patch) | |
tree | 9a6e6d9e8524e03c045afc0dd9f8604b4d49900e /sources/pyside6/tests/pysidetest/CMakeLists.txt | |
parent | a2d56c9fb19ab163ace79babe64578c4e1536bb3 (diff) |
__feature__: heavily rework the context switching
The example of the issue shows the qasync.py module which
fails miserably when using snake_case.
The reason:
-----------
Reason is the way how feature switching is implemented.
Modules like qasync get a default switching of "ignore".
This ignores that the qasync module itself imports QtCore,
and feature switching is of course relevant, suggesting
a default setting of "normal" (explicitly no features).
The real problem:
-----------------
Testing the simple approach showed a serious problem with
feature switching: The functions get switched when a certain
function (getattr etc.) is called.
But the switching is sometimes not done due to a caching problem.
This fix removes caching that was wrong. Optimization will
be done in a different step with a different approach.
This Change was not qasync specific, but happens with PySide imports.
Actions done:
- adjust the inline structure
- implement a feature_imported callback
- identify Python functions that use PySide during import
[ChangeLog][PySide6] __feature__ switching now works even with
recursive imports like in the qasync module.
Fixes: PYSIDE-2029
Change-Id: I3340f54f293083a09fb509383688f73bbd9b60ae
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 7377d2b8130ce7290775cd8a343e75c0561fc854)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'sources/pyside6/tests/pysidetest/CMakeLists.txt')
-rw-r--r-- | sources/pyside6/tests/pysidetest/CMakeLists.txt | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sources/pyside6/tests/pysidetest/CMakeLists.txt b/sources/pyside6/tests/pysidetest/CMakeLists.txt index 3965455c9..eaf748517 100644 --- a/sources/pyside6/tests/pysidetest/CMakeLists.txt +++ b/sources/pyside6/tests/pysidetest/CMakeLists.txt @@ -144,6 +144,7 @@ PYSIDE_TEST(new_inherited_functions_test.py) PYSIDE_TEST(notify_id.py) PYSIDE_TEST(properties_test.py) PYSIDE_TEST(property_python_test.py) +PYSIDE_TEST(snake_case_test.py) PYSIDE_TEST(true_property_test.py) PYSIDE_TEST(qapp_like_a_macro_test.py) PYSIDE_TEST(qvariant_test.py) |