summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2011-08-30 08:03:32 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2011-08-30 08:03:32 (GMT)
commita1b2be3c8a64aee832c648c6dcdff003f22318a3 (patch)
tree4f37cb82b96ebcf119fe987f9f0ab2fcadcbad3c /tests/auto/declarative
parentd6e19d1ecd9f8a26bbd2c3f38083da98c97d599e (diff)
downloadQt-a1b2be3c8a64aee832c648c6dcdff003f22318a3.zip
Qt-a1b2be3c8a64aee832c648c6dcdff003f22318a3.tar.gz
Qt-a1b2be3c8a64aee832c648c6dcdff003f22318a3.tar.bz2
QDeclarative::hasActiveFocus should return false for hidden items
In graphics view you can be the focus item without being visible, but you still won't receive events. QML should hide these distinctions. Task-number: QTBUG-21045
Diffstat (limited to 'tests/auto/declarative')
-rw-r--r--tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
index 362a8ff..2fdeb71 100644
--- a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
+++ b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
@@ -90,6 +90,7 @@ private slots:
void testQtQuick11Attributes();
void testQtQuick11Attributes_data();
void qtbug_16871();
+ void qtbug_21045();
private:
QDeclarativeEngine engine;
};
@@ -1238,6 +1239,18 @@ void tst_QDeclarativeItem::qtbug_16871()
delete o;
}
+void tst_QDeclarativeItem::qtbug_21045()
+{
+ QDeclarativeComponent component(&engine);
+ QGraphicsScene scene;
+ component.setData("import QtQuick 1.1\nItem{visible: false; focus: true}", QUrl::fromLocalFile("file:"));
+ QObject *o = component.create();
+ QDeclarativeItem* i = qobject_cast<QDeclarativeItem*>(o);
+ QVERIFY(i);
+ scene.addItem(i);
+ QVERIFY(!i->hasActiveFocus());
+}
+
QTEST_MAIN(tst_QDeclarativeItem)
#include "tst_qdeclarativeitem.moc"