summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsscenelinearindex_p.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/qgraphicsscenelinearindex_p.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/qgraphicsscenelinearindex_p.h')
-rw-r--r--src/gui/graphicsview/qgraphicsscenelinearindex_p.h17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/gui/graphicsview/qgraphicsscenelinearindex_p.h b/src/gui/graphicsview/qgraphicsscenelinearindex_p.h
index 30948d9..dc45a17 100644
--- a/src/gui/graphicsview/qgraphicsscenelinearindex_p.h
+++ b/src/gui/graphicsview/qgraphicsscenelinearindex_p.h
@@ -89,24 +89,15 @@ public:
m_items.clear();
}
- virtual void insertItem(QGraphicsItem *item) {
+ virtual void addItem(QGraphicsItem *item) {
m_items << item;
}
- virtual void removeItem(QGraphicsItem *item, bool itemIsAboutToDie) {
- Q_UNUSED(itemIsAboutToDie);
+ virtual void removeItem(QGraphicsItem *item) {
m_items.removeAll(item);
}
- virtual QList<QGraphicsItem *> items(const QPointF &point) {
- QList<QGraphicsItem*> result;
- foreach (QGraphicsItem *item, m_items)
- if (item->sceneBoundingRect().contains(point))
- result << item;
- return result;
- }
-
- virtual QList<QGraphicsItem *> items(const QRectF &rect) {
+ virtual QList<QGraphicsItem *> estimateItems(const QRectF &rect, Qt::SortOrder order, const QTransform &deviceTransform) const {
QList<QGraphicsItem*> result;
foreach (QGraphicsItem *item, m_items)
if (item->sceneBoundingRect().intersects(rect))
@@ -114,7 +105,7 @@ public:
return result;
}
- QList<QGraphicsItem *> indexedItems() {
+ QList<QGraphicsItem *> items() const {
return m_items;
}
};