summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicssceneindex_p.h
diff options
context:
space:
mode:
authorAndreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>2009-06-18 12:49:24 (GMT)
committerAndreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>2009-06-18 12:49:24 (GMT)
commitb8ca90d6ca745915455f044f967a345bab7a910e (patch)
tree575eccb64245c9b46f3a4d7bb01c5b34b7f56742 /src/gui/graphicsview/qgraphicssceneindex_p.h
parent0d839e3655d985920aff81882bd444605d97c21c (diff)
downloadQt-b8ca90d6ca745915455f044f967a345bab7a910e.zip
Qt-b8ca90d6ca745915455f044f967a345bab7a910e.tar.gz
Qt-b8ca90d6ca745915455f044f967a345bab7a910e.tar.bz2
Move QGraphicsSceneIndex into private headers (=> _p.h).
We'd like to keep this API private for now. Reviewed-by: Alexis
Diffstat (limited to 'src/gui/graphicsview/qgraphicssceneindex_p.h')
-rw-r--r--src/gui/graphicsview/qgraphicssceneindex_p.h79
1 files changed, 69 insertions, 10 deletions
diff --git a/src/gui/graphicsview/qgraphicssceneindex_p.h b/src/gui/graphicsview/qgraphicssceneindex_p.h
index 576ee98..85a1140 100644
--- a/src/gui/graphicsview/qgraphicssceneindex_p.h
+++ b/src/gui/graphicsview/qgraphicssceneindex_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QGRAPHICSSCENEINDEX_P_H
-#define QGRAPHICSSCENEINDEX_P_H
+#ifndef QGRAPHICSSCENEINDEX_H
+#define QGRAPHICSSCENEINDEX_H
//
// W A R N I N G
@@ -53,20 +53,77 @@
// We mean it.
//
-#include "qgraphicssceneindex.h"
-
-#if !defined(QT_NO_GRAPHICSVIEW) || (QT_EDITION & QT_MODULE_GRAPHICSVIEW) != QT_MODULE_GRAPHICSVIEW
-
+#include <QtCore/qnamespace.h>
+#include <QtCore/qobject.h>
+#include <QtGui/qtransform.h>
+#include <QtGui/qgraphicsitem.h>
#include <private/qobject_p.h>
-#include <private/qgraphicsitem_p.h>
+
+QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
+QT_MODULE(Gui)
+
+#if !defined(QT_NO_GRAPHICSVIEW) || (QT_EDITION & QT_MODULE_GRAPHICSVIEW) != QT_MODULE_GRAPHICSVIEW
+
class QGraphicsScene;
class QGraphicsSceneIndexIntersector;
-class QGraphicsSceneIndexRectIntersector;
class QGraphicsSceneIndexPointIntersector;
+class QGraphicsSceneIndexRectIntersector;
class QGraphicsSceneIndexPathIntersector;
+class QGraphicsSceneIndexPrivate;
+class QPointF;
+class QRectF;
+template<typename T> class QList;
+
+class Q_AUTOTEST_EXPORT QGraphicsSceneIndex : public QObject
+{
+ Q_OBJECT
+
+public:
+ QGraphicsSceneIndex(QGraphicsScene *scene = 0);
+ virtual ~QGraphicsSceneIndex();
+
+ QGraphicsScene *scene() const;
+
+ virtual QRectF indexedRect() const;
+
+ virtual QList<QGraphicsItem *> items(Qt::SortOrder order = Qt::AscendingOrder) 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 itemChange(const QGraphicsItem *item, QGraphicsItem::GraphicsItemChange, const QVariant &value);
+ virtual void prepareBoundingRectChange(const QGraphicsItem *item);
+ virtual void sceneRectChanged(const QRectF &rect);
+
+ QGraphicsSceneIndex(QObjectPrivate &dd, QGraphicsScene *scene);
+
+ friend class QGraphicsScene;
+ friend class QGraphicsScenePrivate;
+ friend class QGraphicsItem;
+ friend class QGraphicsItemPrivate;
+ friend class QGraphicsSceneBspTreeIndex;
+private:
+ Q_DISABLE_COPY(QGraphicsSceneIndex)
+ Q_DECLARE_PRIVATE(QGraphicsSceneIndex)
+};
class QGraphicsSceneIndexPrivate : public QObjectPrivate
{
@@ -96,8 +153,10 @@ public:
const QTransform &transform, const QTransform &deviceTransform) const = 0;
};
+#endif // QT_NO_GRAPHICSVIEW
+
QT_END_NAMESPACE
-#endif // QGRAPHICSSCENEINDEX_P_H
+QT_END_HEADER
-#endif
+#endif // QGRAPHICSSCENEINDEX_H