aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/tests/QtQml/bug_726.py
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside6/tests/QtQml/bug_726.py')
-rw-r--r--sources/pyside6/tests/QtQml/bug_726.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/sources/pyside6/tests/QtQml/bug_726.py b/sources/pyside6/tests/QtQml/bug_726.py
index aab597675..56712280c 100644
--- a/sources/pyside6/tests/QtQml/bug_726.py
+++ b/sources/pyside6/tests/QtQml/bug_726.py
@@ -37,25 +37,26 @@ init_test_paths(False)
from helper.helper import quickview_errorstring
from helper.timedqapplication import TimedQApplication
+from PySide6.QtCore import QObject, QUrl, Slot
+from PySide6.QtQuick import QQuickView
-from PySide6 import QtCore, QtGui, QtQuick
-class ProxyObject(QtCore.QObject):
+class ProxyObject(QObject):
def __init__(self):
super(ProxyObject,self).__init__()
self._o = None
self._receivedName = ""
- @QtCore.Slot(result='QObject*')
+ @Slot(result='QObject*')
def getObject(self):
if self._o:
return self._o
- self._o = QtCore.QObject()
+ self._o = QObject()
self._o.setObjectName("PySideObject")
return self._o
- @QtCore.Slot(str)
+ @Slot(str)
def receivedObject(self, name):
self._receivedName = name
@@ -63,17 +64,17 @@ class ProxyObject(QtCore.QObject):
class TestConnectionWithInvalidSignature(TimedQApplication):
def testSlotRetur(self):
- view = QtQuick.QQuickView()
+ view = QQuickView()
proxy = ProxyObject()
context = view.rootContext()
context.setContextProperty("proxy", proxy)
file = Path(__file__).resolve().parent / 'bug_726.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(proxy._receivedName, "PySideObject")