summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp')
-rw-r--r--tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
index e9dad6b..bbbf73e 100644
--- a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
+++ b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
@@ -214,6 +214,9 @@ void tst_QDeclarativeItem::keys()
QFocusEvent fe(QEvent::FocusIn);
QApplication::sendEvent(canvas, &fe);
+ QVERIFY(canvas->rootObject());
+ QCOMPARE(canvas->rootObject()->property("isEnabled").toBool(), true);
+
QKeyEvent key(QEvent::KeyPress, Qt::Key_A, Qt::NoModifier, "A", false, 1);
QApplication::sendEvent(canvas, &key);
QCOMPARE(testObject->mKey, int(Qt::Key_A));
@@ -285,6 +288,7 @@ void tst_QDeclarativeItem::keys()
testObject->reset();
canvas->rootContext()->setContextProperty("enableKeyHanding", QVariant(false));
+ QCOMPARE(canvas->rootObject()->property("isEnabled").toBool(), false);
key = QKeyEvent(QEvent::KeyPress, Qt::Key_Return, Qt::NoModifier, "", false, 1);
QApplication::sendEvent(canvas, &key);
@@ -292,6 +296,7 @@ void tst_QDeclarativeItem::keys()
QVERIFY(!key.isAccepted());
canvas->rootContext()->setContextProperty("enableKeyHanding", QVariant(true));
+ QCOMPARE(canvas->rootObject()->property("isEnabled").toBool(), true);
key = QKeyEvent(QEvent::KeyPress, Qt::Key_Return, Qt::NoModifier, "", false, 1);
QApplication::sendEvent(canvas, &key);