aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/tests/QtCore
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2024-04-10 15:46:48 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2024-04-23 10:35:30 +0200
commit9f09e1dda0f167432110a22db6f9a5accf800734 (patch)
tree6ad5495799775fa1a8ac389f9c7073511c05e825 /sources/pyside6/tests/QtCore
parent0e107b7ec39efe4f03b0c2ed586e2e04cdfea0fe (diff)
Lazy Load: Fix polymorphic classes by identifying lazy groups
Classes with a polymorphicIdValue have an expression which may reference a related class. We use that to identify a lazy group, which has to be initialized at once. This is now completely solved. Pick-to: 6.7 Fixes: PYSIDE-2675 Change-Id: I957a1b2b95d37b96cc2e98082fc7f92e601322cb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside6/tests/QtCore')
-rw-r--r--sources/pyside6/tests/QtCore/qobject_event_filter_test.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/sources/pyside6/tests/QtCore/qobject_event_filter_test.py b/sources/pyside6/tests/QtCore/qobject_event_filter_test.py
index 1cf07fbab..ab7a1b6ad 100644
--- a/sources/pyside6/tests/QtCore/qobject_event_filter_test.py
+++ b/sources/pyside6/tests/QtCore/qobject_event_filter_test.py
@@ -63,6 +63,17 @@ class FilteredObject(QObject):
self.app.quit()
+class PolymorphicIdFilterObject(QObject):
+ """PYSIDE-2675: Check whether QChildEvent.added() is accessible via PolymorphicId"""
+ def __init__(self, parent=None):
+ super().__init__(parent)
+ self.added = False
+
+ def event(self, event):
+ self.added = event.added()
+ return False
+
+
class TestQObjectEventFilterPython(UsesQApplication):
'''QObject.eventFilter - Reimplemented in python
Filters 5 TimerEvents and then bypasses the other events to the
@@ -93,6 +104,11 @@ class TestQObjectEventFilterPython(UsesQApplication):
self.assertEqual(filtered.times_called, 5)
self.assertEqual(self.obj_filter.events_handled, 5)
+ def testPolymorphicId(self):
+ testObject = PolymorphicIdFilterObject()
+ t2 = QObject(testObject) # noqa: F841
+ self.assertTrue(testObject.added)
+
@unittest.skipUnless(hasattr(sys, "getrefcount"), f"{sys.implementation.name} has no refcount")
def testInstallEventFilterRefCountAfterDelete(self):
'''Bug 910 - installEventFilter() increments reference count on target object