aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/tests/QtQml/registersingletontype.py
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside6/tests/QtQml/registersingletontype.py')
-rw-r--r--sources/pyside6/tests/QtQml/registersingletontype.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/sources/pyside6/tests/QtQml/registersingletontype.py b/sources/pyside6/tests/QtQml/registersingletontype.py
index 90846fc43..01b841675 100644
--- a/sources/pyside6/tests/QtQml/registersingletontype.py
+++ b/sources/pyside6/tests/QtQml/registersingletontype.py
@@ -44,8 +44,9 @@ from PySide6.QtQuick import QQuickView
finalResult = 0
+
class SingletonQObject(QObject):
- def __init__(self, parent = None):
+ def __init__(self, parent=None):
QObject.__init__(self, parent)
self._data = 100
@@ -58,14 +59,17 @@ class SingletonQObject(QObject):
data = Property(int, getData, setData)
+
def singletonQObjectCallback(engine):
obj = SingletonQObject()
obj.setData(50)
return obj
+
def singletonQJSValueCallback(engine):
return engine.evaluate("new Object({data: 50})")
+
class TestQmlSupport(unittest.TestCase):
def testIt(self):
app = QGuiApplication([])
@@ -86,5 +90,6 @@ class TestQmlSupport(unittest.TestCase):
app.exec_()
self.assertEqual(finalResult, 200)
+
if __name__ == '__main__':
unittest.main()