From 003d5c2ce8a57934f2bbf835efe16ad9f3b1f1c4 Mon Sep 17 00:00:00 2001 From: Sirius Bakke Date: Sat, 22 Jul 2023 20:06:13 +0200 Subject: [PATCH] test: Qt6: Add workaround for buggy QAction --- .../instDialogObjectListTest.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/unit_tests/instDialogObjectListTest/instDialogObjectListTest.cpp b/src/unit_tests/instDialogObjectListTest/instDialogObjectListTest.cpp index 915c6df3a..eb247c409 100644 --- a/src/unit_tests/instDialogObjectListTest/instDialogObjectListTest.cpp +++ b/src/unit_tests/instDialogObjectListTest/instDialogObjectListTest.cpp @@ -331,7 +331,16 @@ void instDialogObjectListTest::openContextMenu(ObjectManipulator *om, void instDialogObjectListTest::test_compile_1() { QAction *compile = mw->findChild("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())