Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.6.0
-
None
-
5119ae6d364a5ac738894d0e60131f21eaf403f2
Description
Create two QGraphicsObjects where one is the parent of the other and holds the child inside its area. Both widgets handle gestures and have set the Qt::ReceivePartialGestures flag. The child item will accept GestureStarted event but will ignore other gesture events so that these events are propagated to the parent. As the parent has set the Qt::ReceivePartialGestures flag it should get the GestureUpdates ignored by the child. This will work as expected if the move events happen within the child's boundaries. But if you move outside the child to the parents area, the parent will not receive GestureUpdates. When you move back to the child's area the parent will once again start receiving GestureUpdates.
That is the current behavior that was done intentional. However it seems that behavior is not what people always want, however we don't want to change the default behavior - by default gesture events should be propagated the same way as touch or mouse events - meaning to all items under a hotspot, ignoring parent/child relationships.
So instead we can add a "propagation policy" option to be able to fine-tune gesture event propagation when a widget subscribes to a gesture.
foo->grabGesture(Qt::PanGesture, Qt::IgnoredGesturesPropagateToParent);