Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-7400

Partial gestures propagation in parent hierarchy doesn't work as expected

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 4.7.0
    • 4.6.0
    • Core: Event loop
    • 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);
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            dzyubenk Denis Dzyubenko (Inactive)
            jaakkorp Jaakko Korpela
            Votes:
            3 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes