summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview
diff options
context:
space:
mode:
authorBjoern Erik Nilsen <bjorn.nilsen@nokia.com>2009-04-01 09:25:01 (GMT)
committerAndreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>2009-04-06 11:49:54 (GMT)
commit79799ec4788692d44862832d85f80953d386cb27 (patch)
tree42ef5cd25ed896540f5ea0d7ff12c0058c291db2 /src/gui/graphicsview
parentd516e5fbed3a7eac20229ead34221c732f85cdb6 (diff)
downloadQt-79799ec4788692d44862832d85f80953d386cb27.zip
Qt-79799ec4788692d44862832d85f80953d386cb27.tar.gz
Qt-79799ec4788692d44862832d85f80953d386cb27.tar.bz2
Fixes: Partially revert 9b0af2395c84a6895a5ce6368f151d4ec00c8755
RevBy: Andreas AutoTest: tst_QGraphicsView::itemAt2 pass again Details: A QPoint in the view has to be mapped to a pixel in the scene, otherwise it won't be possible to e.g. click on items that are smaller than a pixel. So...we have to optimize the hit-testing code in another way
Diffstat (limited to 'src/gui/graphicsview')
-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 ba9cdbf..f0d360a 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.map(pos));
+ return d->scene->items(xinv.mapRect(QRectF(pos.x(), pos.y(), 1, 1)));
}
- return d->scene->items(mapToScene(pos));
+ return d->scene->items(mapToScene(pos.x(), pos.y(), 2, 2));
}
QPainterPath path;