summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsview.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2009-03-27 21:17:10 (GMT)
committerAndreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>2009-04-06 11:49:52 (GMT)
commit30d01c387179160c8c418ecedfb4506a55d282e8 (patch)
treea2480d95b94c6f07f962d279542854dfbc2178c3 /src/gui/graphicsview/qgraphicsview.cpp
parent73ce29e6bc09651a4e70b5e61c36d56e568905c7 (diff)
downloadQt-30d01c387179160c8c418ecedfb4506a55d282e8.zip
Qt-30d01c387179160c8c418ecedfb4506a55d282e8.tar.gz
Qt-30d01c387179160c8c418ecedfb4506a55d282e8.tar.bz2
Optimise QGraphicsScene/View::items(const QPointF &pos)
Implement specialized (and more efficient versions) of item_helper() and child_helper() that test for QPointF in the scene.
Diffstat (limited to 'src/gui/graphicsview/qgraphicsview.cpp')
-rw-r--r--src/gui/graphicsview/qgraphicsview.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp
index f0d360a..ba9cdbf 100644
--- a/src/gui/graphicsview/qgraphicsview.cpp
+++ b/src/gui/graphicsview/qgraphicsview.cpp
@@ -2251,9 +2251,9 @@ QList<QGraphicsItem *> QGraphicsView::items(const QPoint &pos) const
if (d->scene->d_func()->largestUntransformableItem.isNull()) {
if ((d->identityMatrix || d->matrix.type() <= QTransform::TxScale)) {
QTransform xinv = viewportTransform().inverted();
- return d->scene->items(xinv.mapRect(QRectF(pos.x(), pos.y(), 1, 1)));
+ return d->scene->items(xinv.map(pos));
}
- return d->scene->items(mapToScene(pos.x(), pos.y(), 2, 2));
+ return d->scene->items(mapToScene(pos));
}
QPainterPath path;