From b70496888c41cefc4a6d33843512f35232b0bb7b Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Mon, 11 Dec 2023 11:17:20 +0100 Subject: [PATCH] tests: skip tst_QShortcut::applicationShortcut() on Wayland Task-number: QTBUG-120334 Change-Id: I0c71c6f474f1a0f31bc823579a54556a3e64bda2 Reviewed-by: Axel Spoerl (cherry picked from commit d14a1ceffb87b6b62b6a79625be190d40ca9630d) Reviewed-by: Qt Cherry-pick Bot --- tests/auto/gui/kernel/qshortcut/CMakeLists.txt | 1 + tests/auto/gui/kernel/qshortcut/tst_qshortcut.cpp | 6 ++++++ 2 files changed, 7 insertions(+) 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);