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
|
PUBLIC_LIBRARIES
|
||||||
Qt::Gui
|
Qt::Gui
|
||||||
|
Qt::GuiPrivate
|
||||||
Qt::Widgets
|
Qt::Widgets
|
||||||
)
|
)
|
||||||
|
@ -45,6 +45,9 @@
|
|||||||
#include <qshortcut.h>
|
#include <qshortcut.h>
|
||||||
#include <qscreen.h>
|
#include <qscreen.h>
|
||||||
|
|
||||||
|
#include <QtGui/private/qguiapplication_p.h>
|
||||||
|
#include <QtGui/qpa/qplatformintegration.h>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QMainWindow;
|
class QMainWindow;
|
||||||
class QTextEdit;
|
class QTextEdit;
|
||||||
@ -1359,7 +1362,10 @@ void tst_QShortcut::keys()
|
|||||||
QSignalSpy spy(sc, &QShortcut::activated);
|
QSignalSpy spy(sc, &QShortcut::activated);
|
||||||
le.setFocus();
|
le.setFocus();
|
||||||
le.show();
|
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);
|
QCOMPARE(QApplication::focusWidget(), &le);
|
||||||
|
|
||||||
QTest::keyEvent(QTest::Press, QApplication::focusWidget(), Qt::Key_Enter);
|
QTest::keyEvent(QTest::Press, QApplication::focusWidget(), Qt::Key_Enter);
|
||||||
|
Loading…
Reference in New Issue
Block a user