diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-08-30 08:18:02 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-08-30 08:18:02 (GMT) |
commit | 50781a66bd11c3201c7f9c520490dc352e239dac (patch) | |
tree | 75d77ca3aca8fe671c54e74ed191d1938f6db765 /tests | |
parent | 78c5825cfb7702350636b7624bf79311dbd0dbd5 (diff) | |
parent | a1b2be3c8a64aee832c648c6dcdff003f22318a3 (diff) | |
download | Qt-50781a66bd11c3201c7f9c520490dc352e239dac.zip Qt-50781a66bd11c3201c7f9c520490dc352e239dac.tar.gz Qt-50781a66bd11c3201c7f9c520490dc352e239dac.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-qml-staging into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-qml-staging:
QDeclarative::hasActiveFocus should return false for hidden items
FocusScope's focusItem must always be a descendent
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp | 13 | ||||
-rw-r--r-- | tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 32 |
2 files changed, 45 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" diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index 3665b10..9b834d5 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -475,6 +475,7 @@ private slots: void QTBUG_12112_focusItem(); void QTBUG_13473_sceneposchange(); void QTBUG_16374_crashInDestructor(); + void QTBUG_20699_focusScopeCrash(); private: QList<QGraphicsItem *> paintedItems; @@ -11265,5 +11266,36 @@ void tst_QGraphicsItem::QTBUG_16374_crashInDestructor() QTest::qWaitForWindowShown(&view); } +void tst_QGraphicsItem::QTBUG_20699_focusScopeCrash() +{ + QGraphicsScene scene; + QGraphicsView view(&scene); + QGraphicsPixmapItem fs; + fs.setFlags(QGraphicsItem::ItemIsFocusScope | QGraphicsItem::ItemIsFocusable); + scene.addItem(&fs); + QGraphicsPixmapItem* fs2 = new QGraphicsPixmapItem(&fs); + fs2->setFlags(QGraphicsItem::ItemIsFocusScope | QGraphicsItem::ItemIsFocusable); + QGraphicsPixmapItem* fi2 = new QGraphicsPixmapItem(&fs); + fi2->setFlags(QGraphicsItem::ItemIsFocusable); + QGraphicsPixmapItem* fi = new QGraphicsPixmapItem(fs2); + fi->setFlags(QGraphicsItem::ItemIsFocusable); + fs.setFocus(); + fi->setFocus(); + + view.show(); + QTest::qWaitForWindowShown(&view); + + fi->setParentItem(fi2); + fi->setFocus(); + fs.setFocus(); + fi->setParentItem(fs2); + fi->setFocus(); + fs2->setFocus(); + fs.setFocus(); + fi->setParentItem(fi2); + fi->setFocus(); + fs.setFocus(); +} + QTEST_MAIN(tst_QGraphicsItem) #include "tst_qgraphicsitem.moc" |