aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/tests/QtCore/snake_prop_feature_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside6/tests/QtCore/snake_prop_feature_test.py')
-rw-r--r--sources/pyside6/tests/QtCore/snake_prop_feature_test.py22
1 files changed, 21 insertions, 1 deletions
diff --git a/sources/pyside6/tests/QtCore/snake_prop_feature_test.py b/sources/pyside6/tests/QtCore/snake_prop_feature_test.py
index 18a5e4058..61e0b5d63 100644
--- a/sources/pyside6/tests/QtCore/snake_prop_feature_test.py
+++ b/sources/pyside6/tests/QtCore/snake_prop_feature_test.py
@@ -46,7 +46,8 @@ sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
-from PySide6.QtWidgets import QApplication, QWidget
+from PySide6.QtCore import Property, QSize
+from PySide6.QtWidgets import QApplication, QMainWindow, QWidget
from PySide6.support import __feature__
"""
@@ -150,6 +151,25 @@ class FeatureTest(unittest.TestCase):
self.assertTrue(isinstance(UserClass.someFunc2, FunctionType))
self.assertTrue(isinstance(UserClass.add_action, MethodDescriptorType))
+ def testTrueProperyCanOverride(self):
+ from __feature__ import true_property
+
+ class CustomWidget(QWidget):
+ global prop_result
+ prop_result = None
+
+ @Property(QSize)
+ def minimumSizeHint(self):
+ global prop_result
+ print("called")
+ prop_result = super().minimumSizeHint
+ return prop_result
+
+ window = QMainWindow()
+ window.setCentralWidget(CustomWidget(window))
+ window.show()
+ self.assertTrue(isinstance(prop_result, QSize))
+
if __name__ == '__main__':
unittest.main()