diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2010-08-23 12:02:51 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2010-08-23 12:47:05 (GMT) |
commit | 40fef4036007e1b0d69d1f731c591c324bd0c6ec (patch) | |
tree | f15ed4e25e3b5a3d781f2fe50518cd4f0f5cd143 /src | |
parent | b5b6cbb477b50c582d545b0e5e3a04626834e7e2 (diff) | |
download | Qt-40fef4036007e1b0d69d1f731c591c324bd0c6ec.zip Qt-40fef4036007e1b0d69d1f731c591c324bd0c6ec.tar.gz Qt-40fef4036007e1b0d69d1f731c591c324bd0c6ec.tar.bz2 |
Fixed touch event delivery in QGraphicsView.
When a touch event with a second touch pressed is delivered inside
graphicsview, we should combine it with the closest touch point even if the
item under the second touch is not direct ancestor or child of the first
touches' target item.
So adding a second touch inside the item's bounding rect will send a
TouchUpdate event to the item instead or starting a new touch event sequence.
Task-number: QT-3795
Reviewed-by: Bradley T. Hughes
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/graphicsview/qgraphicsscene.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index a98ce6f..a02f3ac 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -5740,16 +5740,11 @@ void QGraphicsScenePrivate::touchEventHandler(QTouchEvent *sceneTouchEvent) } if (sceneTouchEvent->deviceType() == QTouchEvent::TouchScreen) { - // on touch-screens, combine this touch point with the closest one we find if it - // is a a direct descendent or ancestor ( + // on touch-screens, combine this touch point with the closest one we find int closestTouchPointId = findClosestTouchPointId(touchPoint.scenePos()); QGraphicsItem *closestItem = itemForTouchPointId.value(closestTouchPointId); - if (!item - || (closestItem - && (item->isAncestorOf(closestItem) - || closestItem->isAncestorOf(item)))) { + if (!item || (closestItem && cachedItemsUnderMouse.contains(closestItem))) item = closestItem; - } } if (!item) continue; |