diff --git a/tests/auto/gui/kernel/qshortcut/CMakeLists.txt b/tests/auto/gui/kernel/qshortcut/CMakeLists.txt index add17a5bfdd..517a4e8a1aa 100644 --- a/tests/auto/gui/kernel/qshortcut/CMakeLists.txt +++ b/tests/auto/gui/kernel/qshortcut/CMakeLists.txt @@ -16,4 +16,5 @@ qt_internal_add_test(tst_qshortcut_kernel tst_qshortcut.cpp LIBRARIES Qt::Gui + Qt::GuiPrivate ) diff --git a/tests/auto/gui/kernel/qshortcut/tst_qshortcut.cpp b/tests/auto/gui/kernel/qshortcut/tst_qshortcut.cpp index 22738107742..7509d584264 100644 --- a/tests/auto/gui/kernel/qshortcut/tst_qshortcut.cpp +++ b/tests/auto/gui/kernel/qshortcut/tst_qshortcut.cpp @@ -7,6 +7,9 @@ #include #include +#include +#include + class tst_QShortcut : public QObject { Q_OBJECT @@ -18,6 +21,9 @@ private slots: void tst_QShortcut::applicationShortcut() { + if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation)) + QSKIP("Window activation is not supported"); + auto *shortcut = new QShortcut(Qt::CTRL | Qt::Key_A, this); shortcut->setContext(Qt::ApplicationShortcut); QSignalSpy activatedSpy(shortcut, &QShortcut::activated);