aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/tests/QtGui
diff options
context:
space:
mode:
authorFriedemann Kleint <[email protected]>2024-04-30 12:56:17 +0200
committerFriedemann Kleint <[email protected]>2024-05-06 10:57:23 +0200
commit9fcc3066412e23e92eb05d30dcad858f8ca1cd90 (patch)
tree97eb9cc1f12651621b7dbdf4207716317080b4df /sources/pyside6/tests/QtGui
parent4cdaaffbb58560dc1adbcf9de471ff4fb7d7f235 (diff)
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 <[email protected]>
Diffstat (limited to 'sources/pyside6/tests/QtGui')
-rw-r--r--sources/pyside6/tests/QtGui/qbrush_test.py10
1 files changed, 9 insertions, 1 deletions
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()