From 9fcc3066412e23e92eb05d30dcad858f8ca1cd90 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 30 Apr 2024 12:56:17 +0200 Subject: Fix polymorphic discovery to work without names In newObjectWithHeuristics(), try the type discovery graph check for the inherited class also in case the typeName is identical to the base name (which means typeid() was not able to do resolution based on virtual tables). Change-Id: Ia8912a4860a580418438f659b7a854647657ab9a Reviewed-by: Cristian Maureira-Fredes --- sources/pyside6/tests/QtGui/qbrush_test.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'sources/pyside6/tests/QtGui') diff --git a/sources/pyside6/tests/QtGui/qbrush_test.py b/sources/pyside6/tests/QtGui/qbrush_test.py index 800e6f072..69262328b 100644 --- a/sources/pyside6/tests/QtGui/qbrush_test.py +++ b/sources/pyside6/tests/QtGui/qbrush_test.py @@ -13,7 +13,7 @@ from init_paths import init_test_paths init_test_paths(False) from PySide6.QtCore import Qt -from PySide6.QtGui import QColor, QBrush +from PySide6.QtGui import QColor, QBrush, QConicalGradient from helper.usesqapplication import UsesQApplication @@ -30,6 +30,14 @@ class Constructor(UsesQApplication): obj = QBrush(Qt.blue) self.assertEqual(obj.color(), Qt.blue) + def testGradient(self): + """Test type discovery on class hierarchies with non-virtual + destructors by specifying a polymorphic-id-expression without + polymorphic-name-function.""" + gradient = QConicalGradient() + brush = QBrush(gradient) + self.assertEqual(type(brush.gradient()), type(gradient)) + if __name__ == '__main__': unittest.main() -- cgit v1.2.3