diff options
author | Alexis Menard <alexis.menard@trolltech.com> | 2009-04-07 18:42:53 (GMT) |
---|---|---|
committer | Alexis Menard <alexis.menard@trolltech.com> | 2009-04-07 18:42:53 (GMT) |
commit | 226baa99f53eeeff2489148c9187c19f5bc86f0e (patch) | |
tree | 9dae513b7d8da6667d7a2f86a5334326a6c29e34 /tests/auto/qgraphicssceneindex | |
parent | a779817905ae66de9333fbe3896b0ff1c3990581 (diff) | |
download | Qt-226baa99f53eeeff2489148c9187c19f5bc86f0e.zip Qt-226baa99f53eeeff2489148c9187c19f5bc86f0e.tar.gz Qt-226baa99f53eeeff2489148c9187c19f5bc86f0e.tar.bz2 |
Remove the indexing (BSP) logic from the scene
We basically add a new index that implement the old BSP logic but in a
separate class instead of living into the QGraphicsScene. It will be
much more easier to add a new index method or for people to use their
own
Conflicts:
src/gui/graphicsview/qgraphicsitem.cpp
src/gui/graphicsview/qgraphicssceneindex.h
Diffstat (limited to 'tests/auto/qgraphicssceneindex')
-rw-r--r-- | tests/auto/qgraphicssceneindex/tst_qgraphicssceneindex.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/auto/qgraphicssceneindex/tst_qgraphicssceneindex.cpp b/tests/auto/qgraphicssceneindex/tst_qgraphicssceneindex.cpp index 955f2d3..3dca152 100644 --- a/tests/auto/qgraphicssceneindex/tst_qgraphicssceneindex.cpp +++ b/tests/auto/qgraphicssceneindex/tst_qgraphicssceneindex.cpp @@ -43,8 +43,8 @@ #include <QtTest/QtTest> #include <QtGui/qgraphicsscene.h> #include <QtGui/qgraphicssceneindex.h> -#include <private/qgraphicsscene_bsp_p.h> -#include <private/qgraphicsscene_linear_p.h> +#include <private/qgraphicsscenebsptreeindex_p.h> +#include <private/qgraphicsscenelinearindex_p.h> //TESTED_CLASS= @@ -88,12 +88,12 @@ void tst_QGraphicsSceneIndex::common_data() QGraphicsSceneIndex *tst_QGraphicsSceneIndex::createIndex(const QString &indexMethod) { QGraphicsSceneIndex *index = 0; - + QGraphicsScene *scene = new QGraphicsScene(); if (indexMethod == "bsp") - index = new QGraphicsSceneBspTree; + index = new QGraphicsSceneBspTreeIndex(scene); if (indexMethod == "linear") - index = new QGraphicsSceneLinearIndex; + index = new QGraphicsSceneLinearIndex(scene); return index; } @@ -104,8 +104,9 @@ void tst_QGraphicsSceneIndex::sceneRect_data() } void tst_QGraphicsSceneIndex::sceneRect() -{ - QGraphicsSceneIndex *index = new QGraphicsSceneBspTree; +{ + QGraphicsScene *scene = new QGraphicsScene(); + QGraphicsSceneIndex *index = new QGraphicsSceneBspTreeIndex(scene); index->setRect(QRectF(0, 0, 2000, 2000)); QCOMPARE(index->rect(), QRectF(0, 0, 2000, 2000)); } |