summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeitem
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-10-19 03:36:36 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-10-19 03:36:36 (GMT)
commit6f21e34955a5a7f5ac2beb165d7f107183af796f (patch)
tree8ac061883f7174c662d7e2244636e81b7f8f004f /tests/auto/declarative/qdeclarativeitem
parent1c8de8076f611f6514fc85451ef23f2fde2be1ee (diff)
parentfacde29cfb1800d5cdb937420b429a2d1c9d2199 (diff)
downloadQt-6f21e34955a5a7f5ac2beb165d7f107183af796f.zip
Qt-6f21e34955a5a7f5ac2beb165d7f107183af796f.tar.gz
Qt-6f21e34955a5a7f5ac2beb165d7f107183af796f.tar.bz2
Merge branch 'qt-master-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration into master-integration
* 'qt-master-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration: (47 commits) tst_qdeclarativetext: Regenerate the baselines after the merge. Giving Qt a default app server when Avkon is removed TextInput autoscroll now scrolls when the cursor moves Fix samegame tutorial js Make minehunt less cheerful Add new behavior example. Fix autotest on windows Added --remove-destination to qmake_emulator_deployment.flm Fix worker ListModels to property emit countChanged() Update color type docs to mention transparency Update reference bitmaps used in bitmap comparison tests to follow changes in Text painting Fix alignment bugs in Text element Remove debug code added by 650a0078e2cef43eff107fe8d2505f64a0bfedf0 Compile on WinCE Remove obsolete tweak in QFontEngineS60::alphaMapForGlyph Optimize QFontEngineS60::recalcAdvances() Delete qtdemoapps.iby. Added bearer plugin deployment to qt.iby Implement QFontEngineS60::emSquareSize() Remove unnecessary calls to GetHorizBounds() + boundingBox() ...
Diffstat (limited to 'tests/auto/declarative/qdeclarativeitem')
-rw-r--r--tests/auto/declarative/qdeclarativeitem/data/keystest.qml1
-rw-r--r--tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp12
2 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeitem/data/keystest.qml b/tests/auto/declarative/qdeclarativeitem/data/keystest.qml
index 3927f42..9af6e9f 100644
--- a/tests/auto/declarative/qdeclarativeitem/data/keystest.qml
+++ b/tests/auto/declarative/qdeclarativeitem/data/keystest.qml
@@ -17,6 +17,7 @@ Item {
Item {
id: item2
+ visible: forwardeeVisible
Keys.onPressed: keysTestObject.forwardedKey(event.key)
Keys.onReleased: keysTestObject.forwardedKey(event.key)
}
diff --git a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
index bbbf73e..b4903ae 100644
--- a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
+++ b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
@@ -204,6 +204,7 @@ void tst_QDeclarativeItem::keys()
canvas->rootContext()->setContextProperty("keysTestObject", testObject);
canvas->rootContext()->setContextProperty("enableKeyHanding", QVariant(true));
+ canvas->rootContext()->setContextProperty("forwardeeVisible", QVariant(true));
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/keystest.qml"));
canvas->show();
@@ -287,6 +288,17 @@ void tst_QDeclarativeItem::keys()
testObject->reset();
+ canvas->rootContext()->setContextProperty("forwardeeVisible", QVariant(false));
+ key = QKeyEvent(QEvent::KeyPress, Qt::Key_A, Qt::NoModifier, "A", false, 1);
+ QApplication::sendEvent(canvas, &key);
+ QCOMPARE(testObject->mKey, int(Qt::Key_A));
+ QCOMPARE(testObject->mForwardedKey, 0);
+ QCOMPARE(testObject->mText, QLatin1String("A"));
+ QVERIFY(testObject->mModifiers == Qt::NoModifier);
+ QVERIFY(!key.isAccepted());
+
+ testObject->reset();
+
canvas->rootContext()->setContextProperty("enableKeyHanding", QVariant(false));
QCOMPARE(canvas->rootObject()->property("isEnabled").toBool(), false);