summaryrefslogtreecommitdiff
path: root/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/quick/qquickitem2/tst_qquickitem.cpp')
-rw-r--r--tests/auto/quick/qquickitem2/tst_qquickitem.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
index 9f3de8292f..f3351fcc4e 100644
--- a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
+++ b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
@@ -2089,10 +2089,14 @@ void tst_QQuickItem::keyNavigation_focusReason()
QVERIFY(key.isAccepted());
QCOMPARE(focusEventFilter.lastFocusReason, Qt::BacktabFocusReason);
- // some arbitrary cursor key
+ // right - it's also one kind of key navigation
key = QKeyEvent(QEvent::KeyPress, Qt::Key_Right, Qt::NoModifier, "", false, 1);
QGuiApplication::sendEvent(window, &key);
QVERIFY(key.isAccepted());
+ QCOMPARE(focusEventFilter.lastFocusReason, Qt::TabFocusReason);
+
+ item->setFocus(true, Qt::OtherFocusReason);
+ QVERIFY(item->hasActiveFocus());
QCOMPARE(focusEventFilter.lastFocusReason, Qt::OtherFocusReason);
delete window;