diff options
author | Ariya Hidayat <ariya.hidayat@trolltech.com> | 2009-03-16 12:57:05 (GMT) |
---|---|---|
committer | Alexis Menard <alexis.menard@trolltech.com> | 2009-04-07 18:14:50 (GMT) |
commit | 7b21055e3966ed8620586decaca4c30f9bf0823a (patch) | |
tree | 3826a0bdbace3e15d793879f89522026ab5c2549 /tests/auto/qgraphicssceneindex | |
parent | 14785a965fc475d220ca8592c6ee4a44a0be25f6 (diff) | |
download | Qt-7b21055e3966ed8620586decaca4c30f9bf0823a.zip Qt-7b21055e3966ed8620586decaca4c30f9bf0823a.tar.gz Qt-7b21055e3966ed8620586decaca4c30f9bf0823a.tar.bz2 |
Fixes: Autotest for changing the index method of a scene.
Diffstat (limited to 'tests/auto/qgraphicssceneindex')
-rw-r--r-- | tests/auto/qgraphicssceneindex/tst_qgraphicssceneindex.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/qgraphicssceneindex/tst_qgraphicssceneindex.cpp b/tests/auto/qgraphicssceneindex/tst_qgraphicssceneindex.cpp index f2a2bf1..9372823 100644 --- a/tests/auto/qgraphicssceneindex/tst_qgraphicssceneindex.cpp +++ b/tests/auto/qgraphicssceneindex/tst_qgraphicssceneindex.cpp @@ -41,6 +41,7 @@ #include <QtTest/QtTest> +#include <QtGui/qgraphicsscene.h> #include <QtGui/qgraphicssceneindex.h> #include <private/qgraphicsscene_bsp_p.h> @@ -57,6 +58,8 @@ public slots: private slots: void sceneRect_data(); void sceneRect(); + void customIndex_data(); + void customIndex(); private: void common_data(); @@ -96,5 +99,23 @@ void tst_QGraphicsSceneIndex::sceneRect() QCOMPARE(index->rect(), QRectF(0, 0, 2000, 2000)); } +void tst_QGraphicsSceneIndex::customIndex_data() +{ + common_data(); +} + +void tst_QGraphicsSceneIndex::customIndex() +{ + QFETCH(QString, indexMethod); + QGraphicsSceneIndex *index = createIndex(indexMethod); + + QGraphicsScene scene; + scene.setSceneIndex(index); + + scene.addRect(0, 0, 30, 40); + QCOMPARE(scene.items(QRectF(0, 0, 10, 10)).count(), 1); +} + + QTEST_MAIN(tst_QGraphicsSceneIndex) #include "tst_qgraphicssceneindex.moc" |