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 /src/gui/graphicsview/qgraphicsitem.cpp | |
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 'src/gui/graphicsview/qgraphicsitem.cpp')
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index b8ff5b4..4574334 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -5789,7 +5789,7 @@ void QGraphicsItem::addToIndex() return; } if (d_ptr->scene) - d_ptr->scene->d_func()->addToIndex(this); + d_ptr->scene->d_func()->index->insertItem(this); d_ptr->updateHelper(); } @@ -5802,13 +5802,9 @@ void QGraphicsItem::addToIndex() */ void QGraphicsItem::removeFromIndex() { - if (d_ptr->ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren) { - // ### remove from child index only if applicable - return; - } d_ptr->updateHelper(); if (d_ptr->scene) - d_ptr->scene->d_func()->removeFromIndex(this); + d_ptr->scene->d_func()->index->removeItem(this,false); } /*! @@ -5831,7 +5827,7 @@ void QGraphicsItem::prepareGeometryChange() d_ptr->updateHelper(QRectF(), false, /*maybeDirtyClipPath=*/!d_ptr->inSetPosHelper); QGraphicsScenePrivate *scenePrivate = d_ptr->scene->d_func(); - scenePrivate->removeFromIndex(this); + scenePrivate->index->updateItem(this); if (d_ptr->inSetPosHelper) return; |