From ae08a81739eacb0be86811274ecf9ec786626d1b Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Thu, 4 Jul 2013 10:34:30 -0300 Subject: Fixed the 'hard to grab' Handler, Dive Planner now is very smooth. So, it was on the docs, but I didn't read it before, if the scene has items that ignores transformations, we need to pass the view transform to the method that gets the items in the scene. I also used IntersectsItemBoundingRect instead of IntersectsItemsShape because it's faster, and our items are small, so we don't need an very accurate but slower method. Signed-off-by: Tomaz Canabrava --- qt-ui/diveplanner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index 5de5ffe6b..3e107b10c 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -364,7 +364,7 @@ bool DivePlannerGraphics::isPointOutOfBoundaries(const QPointF& point) void DivePlannerGraphics::mousePressEvent(QMouseEvent* event) { QPointF mappedPos = mapToScene(event->pos()); - Q_FOREACH(QGraphicsItem *item, scene()->items(mappedPos)) { + Q_FOREACH(QGraphicsItem *item, scene()->items(mappedPos, Qt::IntersectsItemBoundingRect, Qt::AscendingOrder, transform())){ if (DiveHandler *h = qgraphicsitem_cast(item)) { activeDraggedHandler = h; activeDraggedHandler->setBrush(Qt::red); -- cgit v1.2.3-70-g09d2