summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicssceneindex.cpp
diff options
context:
space:
mode:
authorAlexis Menard <alexis.menard@trolltech.com>2009-04-07 18:42:53 (GMT)
committerAlexis Menard <alexis.menard@trolltech.com>2009-04-07 18:42:53 (GMT)
commit226baa99f53eeeff2489148c9187c19f5bc86f0e (patch)
tree9dae513b7d8da6667d7a2f86a5334326a6c29e34 /src/gui/graphicsview/qgraphicssceneindex.cpp
parenta779817905ae66de9333fbe3896b0ff1c3990581 (diff)
downloadQt-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/qgraphicssceneindex.cpp')
-rw-r--r--src/gui/graphicsview/qgraphicssceneindex.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/gui/graphicsview/qgraphicssceneindex.cpp b/src/gui/graphicsview/qgraphicssceneindex.cpp
index 904e0af..7360bed 100644
--- a/src/gui/graphicsview/qgraphicssceneindex.cpp
+++ b/src/gui/graphicsview/qgraphicssceneindex.cpp
@@ -49,7 +49,7 @@ QT_BEGIN_NAMESPACE
/*!
Constructs an abstract scene index.
*/
-QGraphicsSceneIndex::QGraphicsSceneIndex(QObject *parent): QObject(parent)
+QGraphicsSceneIndex::QGraphicsSceneIndex(QGraphicsScene *scene): QObject(scene), m_scene(scene)
{
}
@@ -108,7 +108,7 @@ QGraphicsSceneIndex::~QGraphicsSceneIndex()
*/
QGraphicsScene* QGraphicsSceneIndex::scene()
{
- return mscene;
+ return m_scene;
}
/*!
@@ -121,7 +121,7 @@ QGraphicsScene* QGraphicsSceneIndex::scene()
*/
void QGraphicsSceneIndex::updateItem(QGraphicsItem *item)
{
- removeItem(item);
+ removeItem(item,false);
insertItem(item);
}
@@ -145,10 +145,10 @@ void QGraphicsSceneIndex::insertItems(const QList<QGraphicsItem *> &items)
\sa removeItem(), removeItems(), updateItems()
*/
-void QGraphicsSceneIndex::removeItems(const QList<QGraphicsItem *> &items)
+void QGraphicsSceneIndex::removeItems(const QList<QGraphicsItem *> &items, bool itemsAreAboutToDie)
{
foreach (QGraphicsItem *item, items)
- removeItem(item);
+ removeItem(item,itemsAreAboutToDie);
}
/*!
@@ -164,6 +164,10 @@ void QGraphicsSceneIndex::updateItems(const QList<QGraphicsItem *> &items)
updateItem(item);
}
+void QGraphicsSceneIndex::updateIndex()
+{
+}
+
QT_END_NAMESPACE
#include "moc_qgraphicssceneindex.cpp"