PD/Tests: Correct TestPartDesignGui for Qt6

This commit is contained in:
Chris Hennes
2024-07-17 23:17:40 -05:00
committed by WandererFan
parent 25c5d09c43
commit 8249b81d93

View File

@@ -39,42 +39,40 @@ class CallableCheckWorkflow:
def __init__(self, test):
self.test = test
def __call__(self):
diag = QApplication.activeModalWidget()
self.test.assertIsNotNone(diag, "Dialog box could not be found")
if (diag is not None):
cbuttons = diag.findChildren(QtGui.QPushButton)
cbutton = cbuttons[1]
dialogcheck = CallableCheckDialog(self.test)
dialog = QApplication.activeModalWidget()
self.test.assertIsNotNone(dialog, "Dialog box could not be found")
if (dialog is not None):
dialogcheck = CallableCheckDialogWasClosed(self.test)
QtCore.QTimer.singleShot(500, dialogcheck)
QtCore.QTimer.singleShot(0, cbutton, QtCore.SLOT('click()'))
QtCore.QTimer.singleShot(0, dialog, QtCore.SLOT('accept()'))
class CallableCheckDialog:
class CallableCheckDialogWasClosed:
def __init__(self, test):
self.test = test
def __call__(self):
diag = QApplication.activeModalWidget()
self.test.assertIsNone(diag, "Dialog box could not be found")
dialog = QApplication.activeModalWidget()
self.test.assertIsNone(dialog, "Dialog box was not closed by accept()")
class CallableCheckWarning:
def __init__(self, test):
self.test = test
def __call__(self):
diag = QApplication.activeModalWidget()
self.test.assertIsNotNone(diag, "Input dialog box could not be found")
if (diag is not None):
QtCore.QTimer.singleShot(0, diag, QtCore.SLOT('accept()'))
dialog = QApplication.activeModalWidget()
self.test.assertIsNotNone(dialog, "Input dialog box could not be found")
if (dialog is not None):
QtCore.QTimer.singleShot(0, dialog, QtCore.SLOT('accept()'))
class CallableComboBox:
def __init__(self, test):
self.test = test
def __call__(self):
diag = QApplication.activeModalWidget()
self.test.assertIsNotNone(diag, "Warning dialog box could not be found")
if (diag is not None):
cbox = diag.findChild(QtGui.QComboBox)
dialog = QApplication.activeModalWidget()
self.test.assertIsNotNone(dialog, "Warning dialog box could not be found")
if (dialog is not None):
cbox = dialog.findChild(QtGui.QComboBox)
self.test.assertIsNotNone(cbox, "ComboBox widget could not be found")
if (cbox is not None):
QtCore.QTimer.singleShot(0, diag, QtCore.SLOT('accept()'))
QtCore.QTimer.singleShot(0, dialog, QtCore.SLOT('accept()'))
App = FreeCAD
Gui = FreeCADGui