aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/tests/QtUiTools/bug_392.py
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-07-21 10:03:52 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-07-21 09:32:53 +0000
commitb10e77f3e518979c9bae492d2f7a2f03eff06af2 (patch)
tree681526af730875804efac1c34599f407abfd0ec5 /sources/pyside2/tests/QtUiTools/bug_392.py
parentfb9666f093f09737a0b9b328513d3e468a8b22f8 (diff)
Fix the QtUiTools tests
Import QAction from QtGui. Task-number: PYSIDE-1339 Task-number: PYSIDE-904 Change-Id: I5dadb2dd373ff54002563a63acd9e2c38a6c8b13 Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/pyside2/tests/QtUiTools/bug_392.py')
-rw-r--r--sources/pyside2/tests/QtUiTools/bug_392.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/sources/pyside2/tests/QtUiTools/bug_392.py b/sources/pyside2/tests/QtUiTools/bug_392.py
index 07db9802e..1a049b89e 100644
--- a/sources/pyside2/tests/QtUiTools/bug_392.py
+++ b/sources/pyside2/tests/QtUiTools/bug_392.py
@@ -36,29 +36,31 @@ init_test_paths(False)
from helper.usesqapplication import UsesQApplication
-from PySide2 import QtWidgets
+from PySide2.QtGui import QAction
+from PySide2.QtWidgets import QComboBox, QWidget
from PySide2.QtUiTools import QUiLoader
-class MyWidget(QtWidgets.QComboBox):
+class MyWidget(QComboBox):
def __init__(self, parent=None):
- QtWidgets.QComboBox.__init__(self, parent)
+ QComboBox.__init__(self, parent)
def isPython(self):
return True
class BugTest(UsesQApplication):
def testCase(self):
- w = QtWidgets.QWidget()
+ w = QWidget()
loader = QUiLoader()
filePath = os.path.join(os.path.dirname(__file__), 'action.ui')
result = loader.load(filePath, w)
- self.assertTrue(isinstance(result.actionFoo, QtGui.QAction))
+ self.assertTrue(isinstance(result.actionFoo, QAction))
def testPythonCustomWidgets(self):
- w = QtWidgets.QWidget()
+ w = QWidget()
loader = QUiLoader()
loader.registerCustomWidget(MyWidget)
+ self.assertTrue('MyWidget' in loader.availableWidgets())
filePath = os.path.join(os.path.dirname(__file__), 'pycustomwidget.ui')
result = loader.load(filePath, w)
@@ -66,9 +68,10 @@ class BugTest(UsesQApplication):
self.assertTrue(result.custom.isPython())
def testPythonCustomWidgetsTwice(self):
- w = QtWidgets.QWidget()
+ w = QWidget()
loader = QUiLoader()
loader.registerCustomWidget(MyWidget)
+ self.assertTrue('MyWidget' in loader.availableWidgets())
filePath = os.path.join(os.path.dirname(__file__), 'pycustomwidget2.ui')
result = loader.load(filePath, w)