summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicssceneindex.h
diff options
context:
space:
mode:
authorAlexis Menard <alexis.menard@nokia.com>2009-05-29 12:45:35 (GMT)
committerAlexis Menard <alexis.menard@nokia.com>2009-05-29 12:45:35 (GMT)
commit9281f4c219cec2e6a1e24b43e1edd0feb0fcfce5 (patch)
tree593e1914bf75be9e7f015c54970def18ebbd6429 /src/gui/graphicsview/qgraphicssceneindex.h
parent23a92388505c54155855d2f49d3a9cf81de0e5ea (diff)
downloadQt-9281f4c219cec2e6a1e24b43e1edd0feb0fcfce5.zip
Qt-9281f4c219cec2e6a1e24b43e1edd0feb0fcfce5.tar.gz
Qt-9281f4c219cec2e6a1e24b43e1edd0feb0fcfce5.tar.bz2
First bunch of changes after an very first API review
This basically move some logic from the scene to the index base class. Lot of work need to be done in order to benefits from the device transform. The sorting needs to be move in the BSP tree.
Diffstat (limited to 'src/gui/graphicsview/qgraphicssceneindex.h')
-rw-r--r--src/gui/graphicsview/qgraphicssceneindex.h50
1 files changed, 27 insertions, 23 deletions
diff --git a/src/gui/graphicsview/qgraphicssceneindex.h b/src/gui/graphicsview/qgraphicssceneindex.h
index a782323..da3096e 100644
--- a/src/gui/graphicsview/qgraphicssceneindex.h
+++ b/src/gui/graphicsview/qgraphicssceneindex.h
@@ -44,6 +44,8 @@
#include <QtCore/qnamespace.h>
#include <QtCore/qobject.h>
+#include <QtGui/qtransform.h>
+#include <QtGui/qgraphicsitem.h>
QT_BEGIN_HEADER
@@ -53,7 +55,7 @@ QT_MODULE(Gui)
#if !defined(QT_NO_GRAPHICSVIEW) || (QT_EDITION & QT_MODULE_GRAPHICSVIEW) != QT_MODULE_GRAPHICSVIEW
-class QGraphicsItem;
+class QGraphicsSceneIndexPrivate;
class QGraphicsScene;
class QRectF;
class QPointF;
@@ -67,29 +69,31 @@ public:
QGraphicsSceneIndex(QGraphicsScene *scene = 0);
virtual ~QGraphicsSceneIndex();
- QGraphicsScene* scene() const;
-
- virtual void setRect(const QRectF &rect) = 0;
- virtual QRectF rect() const = 0;
- virtual void clear() = 0;
-
- virtual void insertItem(QGraphicsItem *item) = 0;
- virtual void removeItem(QGraphicsItem *items, bool itemIsAboutToDie) = 0;
- virtual void updateItem(QGraphicsItem *item);
-
- virtual void insertItems(const QList<QGraphicsItem *> &items);
- virtual void removeItems(const QList<QGraphicsItem *> &items, bool itemsAreAboutToDie);
- virtual void updateItems(const QList<QGraphicsItem *> &items);
-
- virtual QList<QGraphicsItem *> items(const QPointF &point) = 0;
- virtual QList<QGraphicsItem *> items(const QRectF &rect) = 0;
-
- virtual QList<QGraphicsItem *> indexedItems() = 0;
-
- virtual void updateIndex();
-
+ QGraphicsScene *scene() const;
+
+ virtual QList<QGraphicsItem *> items() const = 0;
+ virtual QList<QGraphicsItem *> items(const QPointF &pos, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform = QTransform()) const;
+ virtual QList<QGraphicsItem *> items(const QRectF &rect, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform = QTransform()) const;
+ virtual QList<QGraphicsItem *> items(const QPolygonF &polygon, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform = QTransform()) const;
+ virtual QList<QGraphicsItem *> items(const QPainterPath &path, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform = QTransform()) const;
+ virtual QList<QGraphicsItem *> estimateItems(const QPointF &point, Qt::SortOrder order, const QTransform &deviceTransform) const;
+ virtual QList<QGraphicsItem *> estimateItems(const QRectF &rect, Qt::SortOrder order, const QTransform &deviceTransform) const = 0;
+
+protected:
+ virtual void clear();
+ virtual void addItem(QGraphicsItem *item) = 0;
+ virtual void removeItem(QGraphicsItem *item) = 0;
+ virtual void deleteItem(QGraphicsItem *item);
+
+ virtual void itemChanged(const QGraphicsItem *item, QGraphicsItem::GraphicsItemChange, const QVariant &value);
+ virtual void prepareBoundingRectChange(const QGraphicsItem *item);
+ virtual void sceneRectChanged(const QRectF &rect);
+
+ friend class QGraphicsScene;
+ friend class QGraphicsScenePrivate;
+ friend class QGraphicsItem;
private:
- QGraphicsScene *m_scene;
+ Q_DECLARE_PRIVATE(QGraphicsSceneIndex)
};
#endif // QT_NO_GRAPHICSVIEW