Merge "Fix tsts_QShortcut::keys on Wayland"
This commit is contained in:
commit
a5573cfbd5
@ -11,5 +11,6 @@ qt_internal_add_test(tst_qshortcut
|
||||
..
|
||||
PUBLIC_LIBRARIES
|
||||
Qt::Gui
|
||||
Qt::GuiPrivate
|
||||
Qt::Widgets
|
||||
)
|
||||
|
@ -45,6 +45,9 @@
|
||||
#include <qshortcut.h>
|
||||
#include <qscreen.h>
|
||||
|
||||
#include <QtGui/private/qguiapplication_p.h>
|
||||
#include <QtGui/qpa/qplatformintegration.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QMainWindow;
|
||||
class QTextEdit;
|
||||
@ -1359,7 +1362,10 @@ void tst_QShortcut::keys()
|
||||
QSignalSpy spy(sc, &QShortcut::activated);
|
||||
le.setFocus();
|
||||
le.show();
|
||||
QVERIFY(QTest::qWaitForWindowActive(&le));
|
||||
if (QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation))
|
||||
QVERIFY(QTest::qWaitForWindowActive(&le));
|
||||
else
|
||||
QTRY_VERIFY(le.windowHandle()->isActive());
|
||||
QCOMPARE(QApplication::focusWidget(), &le);
|
||||
|
||||
QTest::keyEvent(QTest::Press, QApplication::focusWidget(), Qt::Key_Enter);
|
||||
|
Loading…
Reference in New Issue
Block a user