aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/tests/QtQml/bug_997.py
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside6/tests/QtQml/bug_997.py')
-rw-r--r--sources/pyside6/tests/QtQml/bug_997.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/sources/pyside6/tests/QtQml/bug_997.py b/sources/pyside6/tests/QtQml/bug_997.py
index 3d77e18e7..ce5ee14db 100644
--- a/sources/pyside6/tests/QtQml/bug_997.py
+++ b/sources/pyside6/tests/QtQml/bug_997.py
@@ -37,25 +37,27 @@ init_test_paths(False)
from helper.helper import quickview_errorstring
from helper.usesqapplication import UsesQApplication
+from PySide6.QtCore import QTimer, QUrl
+from PySide6.QtQml import QQmlPropertyMap
+from PySide6.QtQuick import QQuickView
-from PySide6 import QtCore, QtQml, QtQuick
class TestBug(UsesQApplication):
def testQMLFunctionCall(self):
- ownerData = QtQml.QQmlPropertyMap()
+ ownerData = QQmlPropertyMap()
ownerData.insert('name', 'John Smith')
ownerData.insert('phone', '555-5555')
ownerData.insert('newValue', '')
- view = QtQuick.QQuickView()
+ view = QQuickView()
ctxt = view.rootContext()
ctxt.setContextProperty('owner', ownerData)
file = Path(__file__).resolve().parent / 'bug_997.qml'
self.assertTrue(file.is_file())
- view.setSource(QtCore.QUrl.fromLocalFile(os.fspath(file)))
+ view.setSource(QUrl.fromLocalFile(os.fspath(file)))
self.assertTrue(view.rootObject(), quickview_errorstring(view))
view.show()
- QtCore.QTimer.singleShot(1000, self.app.quit)
+ QTimer.singleShot(1000, self.app.quit)
self.app.exec_()
self.assertEqual(ownerData.value('newName'), ownerData.value('name'))