summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsscene_bsp_p.h
diff options
context:
space:
mode:
authorAlexis Menard <alexis.menard@trolltech.com>2009-04-07 18:06:38 (GMT)
committerAlexis Menard <alexis.menard@trolltech.com>2009-04-07 18:06:38 (GMT)
commite2e30d5c0ca99a47cc142465436d5e0a3f616b82 (patch)
treeb9fe22cfc7fa816ff9128a2ea264ca6de020056c /src/gui/graphicsview/qgraphicsscene_bsp_p.h
parent9e5293822b849ed37742054cf1f4c0bb1b1e7156 (diff)
downloadQt-e2e30d5c0ca99a47cc142465436d5e0a3f616b82.zip
Qt-e2e30d5c0ca99a47cc142465436d5e0a3f616b82.tar.gz
Qt-e2e30d5c0ca99a47cc142465436d5e0a3f616b82.tar.bz2
Fixes: Make the bsp tree inherits from the new API
Diffstat (limited to 'src/gui/graphicsview/qgraphicsscene_bsp_p.h')
-rw-r--r--src/gui/graphicsview/qgraphicsscene_bsp_p.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene_bsp_p.h b/src/gui/graphicsview/qgraphicsscene_bsp_p.h
index e6ceb78..4114b3b 100644
--- a/src/gui/graphicsview/qgraphicsscene_bsp_p.h
+++ b/src/gui/graphicsview/qgraphicsscene_bsp_p.h
@@ -60,6 +60,7 @@
#include <QtCore/qrect.h>
#include <QtCore/qset.h>
#include <QtCore/qvector.h>
+#include <QtGui/qgraphicssceneindex.h>
QT_BEGIN_NAMESPACE
@@ -69,7 +70,7 @@ class QGraphicsSceneInsertItemBspTreeVisitor;
class QGraphicsSceneRemoveItemBspTreeVisitor;
class QGraphicsSceneFindItemBspTreeVisitor;
-class QGraphicsSceneBspTree
+class QGraphicsSceneBspTree : public QGraphicsSceneIndex
{
public:
struct Node
@@ -87,10 +88,13 @@ public:
void initialize(const QRectF &rect, int depth);
void clear();
+ QRectF rect() const;
+ void setRect(const QRectF &rect);
- void insertItem(QGraphicsItem *item, const QRectF &rect);
- void removeItem(QGraphicsItem *item, const QRectF &rect);
- void removeItems(const QSet<QGraphicsItem *> &items);
+ void insertItem(QGraphicsItem *item);
+ void insertItems(const QList<QGraphicsItem *> &items);
+ void removeItem(QGraphicsItem *item);
+ void removeItems(const QList<QGraphicsItem *> &items);
QList<QGraphicsItem *> items(const QRectF &rect);
QList<QGraphicsItem *> items(const QPointF &pos);
@@ -116,7 +120,7 @@ private:
QVector<Node> nodes;
QVector<QList<QGraphicsItem *> > leaves;
int leafCnt;
- QRectF rect;
+ QRectF sceneRect;
QGraphicsSceneInsertItemBspTreeVisitor *insertVisitor;
QGraphicsSceneRemoveItemBspTreeVisitor *removeVisitor;
@@ -130,6 +134,8 @@ public:
virtual void visit(QList<QGraphicsItem *> *items) = 0;
};
+Q_DECLARE_TYPEINFO(QGraphicsSceneBspTree::Node, Q_PRIMITIVE_TYPE);
+
QT_END_NAMESPACE
#endif // QT_NO_GRAPHICSVIEW