tests: skip tst_QShortcut::applicationShortcut() on Wayland

Task-number: QTBUG-120334
Change-Id: I0c71c6f474f1a0f31bc823579a54556a3e64bda2
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit d14a1ceffb87b6b62b6a79625be190d40ca9630d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Liang Qi 2023-12-11 11:17:20 +01:00 committed by Qt Cherry-pick Bot
parent bfc841f149
commit b70496888c
2 changed files with 7 additions and 0 deletions

View File

@ -16,4 +16,5 @@ qt_internal_add_test(tst_qshortcut_kernel
tst_qshortcut.cpp
LIBRARIES
Qt::Gui
Qt::GuiPrivate
)

View File

@ -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);