diff options
Diffstat (limited to 'sources/pyside6/tests/QtCore/qslot_object_test.py')
-rw-r--r-- | sources/pyside6/tests/QtCore/qslot_object_test.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/sources/pyside6/tests/QtCore/qslot_object_test.py b/sources/pyside6/tests/QtCore/qslot_object_test.py index 56cd462ee..ebde10387 100644 --- a/sources/pyside6/tests/QtCore/qslot_object_test.py +++ b/sources/pyside6/tests/QtCore/qslot_object_test.py @@ -36,17 +36,18 @@ from pathlib import Path sys.path.append(os.fspath(Path(__file__).resolve().parents[1])) from init_paths import init_test_paths init_test_paths(False) -from PySide6 import QtCore + +from PySide6.QtCore import QCoreApplication, QObject, QTimer, SIGNAL, SLOT """ This is a simple slot test that was updated to use the qApp "macro". It is implicitly in builtins and does not need an import. """ -class objTest(QtCore.QObject): +class objTest(QObject): def __init__(self, parent=None): - QtCore.QObject.__init__(self, parent) + super().__init__(parent) self.ok = False @@ -60,20 +61,20 @@ class slotTest(unittest.TestCase): qApp.quit() def testBasic(self): - timer = QtCore.QTimer() + timer = QTimer() timer.setInterval(100) my_obj = objTest() - my_slot = QtCore.SLOT("slot()") - QtCore.QObject.connect(timer, QtCore.SIGNAL("timeout()"), my_obj, my_slot) + my_slot = SLOT("slot()") + QObject.connect(timer, SIGNAL("timeout()"), my_obj, my_slot) timer.start(100) - QtCore.QTimer.singleShot(1000, self.quit_app) + QTimer.singleShot(1000, self.quit_app) qApp.exec_() self.assertTrue(my_obj.ok) if __name__ == '__main__': - QtCore.QCoreApplication() + QCoreApplication() unittest.main() |