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

Flickable behind MouseArea does not steal first drag event after creation



    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.9.5, 5.12.1, 5.12.8, 5.15.2
    • Fix Version/s: None
    • Labels:
    • Platform/s:
      Linux/X11, Linux/Other display system


       I'm trying to place a MouseArea as a child of a Flickable, with the MouseArea filling and overlayed on top of the Flickable. The MouseArea is supposed to detect when the user begins to drag horizontally while the Flickable scrolls vertically. It is also supposed to let through Clicked events so the items inside the Flickable may act on clicks, so propagateComposedEvents is set to true.

      I'm running into an issue where the first vertical drag on the MouseArea is not stolen by the Flickable as expected. Instead, the drag is registered as a Click event at the point of its release. This is demonstrated by the following minimal code snppet (taken from this StackOverflow question): test.qml

      To test for this issue, run the snippet in qmlscene and perform the following:

      1.  Try to scroll the Flickable vertically by dragging with the mouse
      2. Observe the "clicked" message in the console
      3. Try to scroll by dragging again, which works normally

      After the first complete mouse event (which may be a drag or a click), the Flickable steals mouse events as expected. Before that, the MouseArea holds the event and registers it as a click.

      I've worked around this issue by explicitly denying the first Pressed event on my MouseArea: https://github.com/ubports/unity8/pull/116/files. The StackOverflow asker worked around it by setting propagateComposedEvents to false. Either option disables some behavior that is potentially useful, at least for the first mouse event after the program starts.


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



            qt.team.quick.subscriptions Qt Quick and Widgets Team
            universalsuperbox Dalton Durst
            0 Vote for this issue
            1 Start watching this issue



                Gerrit Reviews

                There are no open Gerrit changes