summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsscenebsptreeindex_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/graphicsview/qgraphicsscenebsptreeindex_p.h')
-rw-r--r--src/gui/graphicsview/qgraphicsscenebsptreeindex_p.h51
1 files changed, 18 insertions, 33 deletions
diff --git a/src/gui/graphicsview/qgraphicsscenebsptreeindex_p.h b/src/gui/graphicsview/qgraphicsscenebsptreeindex_p.h
index 7a6ea0b..b1ea977 100644
--- a/src/gui/graphicsview/qgraphicsscenebsptreeindex_p.h
+++ b/src/gui/graphicsview/qgraphicsscenebsptreeindex_p.h
@@ -56,56 +56,41 @@ QT_BEGIN_NAMESPACE
#include "qgraphicsscene_bsp_p.h"
+class QGraphicsSceneBspTreeIndexPrivate;
class Q_AUTOTEST_EXPORT QGraphicsSceneBspTreeIndex : public QGraphicsSceneIndex
{
Q_OBJECT
public:
QGraphicsSceneBspTreeIndex(QGraphicsScene *scene = 0);
- QRectF indexedRect();
-
- void clear();
-
- void addItem(QGraphicsItem *item);
- void removeItem(QGraphicsItem *item);
- void deleteItem(QGraphicsItem *item);
- void prepareBoundingRectChange(const QGraphicsItem *item);
+ QRectF indexedRect() const;
QList<QGraphicsItem *> estimateItems(const QRectF &rect, Qt::SortOrder order, const QTransform &deviceTransform) const;
- QList<QGraphicsItem *> items() const;
+ QList<QGraphicsItem *> items(Qt::SortOrder order = Qt::AscendingOrder) const;
int bspDepth();
void setBspDepth(int depth);
protected:
bool event(QEvent *event);
- void sceneRectChanged(const QRectF &rect);
+ void clear();
+
+ void addItem(QGraphicsItem *item);
+ void removeItem(QGraphicsItem *item);
+ void deleteItem(QGraphicsItem *item);
+ void prepareBoundingRectChange(const QGraphicsItem *item);
-public slots :
- void _q_updateIndex();
+ void sceneRectChanged(const QRectF &rect);
+ void itemChanged(const QGraphicsItem *item, QGraphicsItem::GraphicsItemChange change, const QVariant &value);
private :
- QGraphicsSceneBspTree bsp;
- QRectF m_sceneRect;
- int bspTreeDepth;
- int indexTimerId;
- bool restartIndexTimer;
- bool regenerateIndex;
- int lastItemCount;
-
- QList<QGraphicsItem *> m_indexedItems;
- QList<QGraphicsItem *> unindexedItems;
- QList<int> freeItemIndexes;
-
- bool purgePending;
- QList<QGraphicsItem *> removedItems;
- void purgeRemovedItems();
-
- void startIndexTimer();
- void resetIndex();
-
- void addToIndex(QGraphicsItem *item);
- void removeFromIndex(QGraphicsItem *item);
+ Q_DECLARE_PRIVATE(QGraphicsSceneBspTreeIndex)
+ Q_DISABLE_COPY(QGraphicsSceneBspTreeIndex)
+ Q_PRIVATE_SLOT(d_func(), void _q_updateSortCache())
+ Q_PRIVATE_SLOT(d_func(), void _q_updateIndex())
+
+ friend class QGraphicsScene;
+ friend class QGraphicsScenePrivate;
};
QT_END_NAMESPACE