aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/tests/samplebinding/enumfromremovednamespace_test.py
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2022-05-23 12:33:29 +0200
committerChristian Tismer <tismer@stackless.com>2022-06-21 11:06:37 +0200
commit304582e59e63f7620f221d3a9748118479ede099 (patch)
tree52e516c29b8f7eb12036fcc374b90941db9314dd /sources/shiboken6/tests/samplebinding/enumfromremovednamespace_test.py
parent7eb12e4cd3be60b4aaf18530d0c927bef386e913 (diff)
PyEnum: Remove the old duplication of Enums in the enclosing scope
When implementing Python enums, the behavior of old Qt enums was copied: Every enum was also inserted into the enclosing scope. This patch removes that for two reasons: - it is inconsequent to keep an old quirk when we have all enums renewed so much - It is more consistent compared to our competitor - it is a prerequisite to implement efficient lazy initialization PROBLEM: Many constants (about 110) are no longer recognized, for instance `Qt.AlignLeft` should be `Qt.AlignmentFlag.AlignLeft`. The question is if that can be fixed easily in C++, or if the file mapping.py should get ~100 new fixes? SOLUTION: We allow the old enums, but tell nobody that they continue to work. They also are not advertized in the PYI files. [ChangeLog][PySide6] The duplication of enum values into the enclosing scope, allowing to write Qt.AlignLeft instead of Qt.Alignment.AlignLeft, is still implemented but no longer advertized in PYI files or line completion. Task-number: PYSIDE-1735 Change-Id: I79a90d08f2a5a3a069fa551e60d609ecad718239 Pick-to: 6.3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/shiboken6/tests/samplebinding/enumfromremovednamespace_test.py')
-rw-r--r--sources/shiboken6/tests/samplebinding/enumfromremovednamespace_test.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/sources/shiboken6/tests/samplebinding/enumfromremovednamespace_test.py b/sources/shiboken6/tests/samplebinding/enumfromremovednamespace_test.py
index 8cf21d4ff..f70621c59 100644
--- a/sources/shiboken6/tests/samplebinding/enumfromremovednamespace_test.py
+++ b/sources/shiboken6/tests/samplebinding/enumfromremovednamespace_test.py
@@ -21,6 +21,8 @@ from shibokensupport.signature import get_signature
class TestEnumFromRemovedNamespace(unittest.TestCase):
+
+ @unittest.skipIf(sys.pyside63_option_python_enum, "Makes no sense with strict Enums")
def testEnumPromotedToGlobal(self):
sample.RemovedNamespace1_Enum
self.assertEqual(sample.RemovedNamespace1_Enum_Value0, 0)