test: Qt6: Add workaround for buggy QAction

This commit is contained in:
Sirius Bakke 2023-07-22 20:06:13 +02:00
parent f76af1915d
commit 003d5c2ce8
1 changed files with 9 additions and 0 deletions

View File

@ -331,7 +331,16 @@ void instDialogObjectListTest::openContextMenu(ObjectManipulator *om,
void instDialogObjectListTest::test_compile_1()
{
QAction *compile = mw->findChild<QAction*>("compileAction");
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
compile->activate(QAction::Trigger);
#else
// TODO: This is a workaround. The activate() call above doesn't trigger in Qt6
// Because we're testing the compilation dialog, not QAction, we skip
// the first step (QAction -> metacall -> mw->compile()) and call
// mw->compile() directly. The compile button is tested manually and found working.
mw->compile();
#endif
QTest::qWait(100);
instDialog *dlg = nullptr;
foreach (QWidget *w, app->allWidgets())