summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2023-12-11 11:17:20 +0100
committerLiang Qi <liang.qi@qt.io>2024-01-10 17:36:03 +0100
commitd14a1ceffb87b6b62b6a79625be190d40ca9630d (patch)
tree7555971c8b9590656169d6a3bc72b7def5b11678
parent76845e1d31a61735a0f0261fbc15ed7ea5ff71dc (diff)
tests: skip tst_QShortcut::applicationShortcut() on Wayland
Pick-to: 6.7 Task-number: QTBUG-120334 Change-Id: I0c71c6f474f1a0f31bc823579a54556a3e64bda2 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
-rw-r--r--tests/auto/gui/kernel/qshortcut/CMakeLists.txt1
-rw-r--r--tests/auto/gui/kernel/qshortcut/tst_qshortcut.cpp6
2 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/gui/kernel/qshortcut/CMakeLists.txt b/tests/auto/gui/kernel/qshortcut/CMakeLists.txt
index add17a5bfd..517a4e8a1a 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 a0ffaa5854..29954e6dcc 100644
--- a/tests/auto/gui/kernel/qshortcut/tst_qshortcut.cpp
+++ b/tests/auto/gui/kernel/qshortcut/tst_qshortcut.cpp
@@ -7,6 +7,9 @@
#include <QtGui/qwindow.h>
#include <QtTest/qsignalspy.h>
+#include <QtGui/private/qguiapplication_p.h>
+#include <qpa/qplatformintegration.h>
+
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);