aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/tests/QtQml/bug_456.py
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside6/tests/QtQml/bug_456.py')
-rw-r--r--sources/pyside6/tests/QtQml/bug_456.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/sources/pyside6/tests/QtQml/bug_456.py b/sources/pyside6/tests/QtQml/bug_456.py
index 17028a902..ddb9819df 100644
--- a/sources/pyside6/tests/QtQml/bug_456.py
+++ b/sources/pyside6/tests/QtQml/bug_456.py
@@ -37,14 +37,15 @@ init_test_paths(False)
from helper.helper import quickview_errorstring
from helper.timedqapplication import TimedQApplication
+from PySide6.QtCore import QObject, QTimer, QUrl, Property, Slot
+from PySide6.QtQuick import QQuickView
-from PySide6 import QtCore, QtGui, QtQuick
-class RotateValue(QtCore.QObject):
+class RotateValue(QObject):
def __init__(self):
super(RotateValue,self).__init__()
- @QtCore.Slot(result=int)
+ @Slot(result=int)
def val(self):
return 100
@@ -54,25 +55,25 @@ class RotateValue(QtCore.QObject):
def getRotation(self):
return self._rotation
- rotation = QtCore.Property(int, getRotation, setRotation)
+ rotation = Property(int, getRotation, setRotation)
class TestConnectionWithInvalidSignature(TimedQApplication):
def testSlotRetur(self):
- view = QtQuick.QQuickView()
+ view = QQuickView()
rotatevalue = RotateValue()
- timer = QtCore.QTimer()
+ timer = QTimer()
timer.start(2000)
context = view.rootContext()
context.setContextProperty("rotatevalue", rotatevalue)
file = Path(__file__).resolve().parent / 'bug_456.qml'
self.assertTrue(file.is_file())
- view.setSource(QtCore.QUrl.fromLocalFile(os.fspath(file)))
+ view.setSource(QUrl.fromLocalFile(os.fspath(file)))
root = view.rootObject()
self.assertTrue(root, quickview_errorstring(view))
- button = root.findChild(QtCore.QObject, "buttonMouseArea")
+ button = root.findChild(QObject, "buttonMouseArea")
view.show()
button.entered.emit()
self.assertEqual(rotatevalue.rotation, 100)