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

Provide a way for MouseArea to grab mouse from parent Flickable in QML

    XMLWordPrintable

Details

    • 57676c237992e0aa5a93a4e8fa66b3e7b90c2c90

    Description

      When UI content doesn't fit fully on the view it's often put inside Flickable, which provides a way to scroll the content. For implementing the scrolling behavior, Flickable grabs mouse move events from the content items. This creates problem for implementing dragging use cases inside the content items, use cases like drag&drop item arranging or copy&paste text selection handles. MouseArea's drag.target goes around this by subsequently grabbing the mouse from Flickable when the drag starts. Unfortunately if the drag use case is too complex for drag.target approach there is no way to implement mouse grabbing from QML. QML applications can go around this by disabling Flickables they use by setting Flickable::interactive property to false during dragging, but this is not a solution for QML-based component libraries that don't have access to or knowledge of all Flickables in the parent chain, and even if they did such strong coupling would not be desirable.

      Attachments

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

        Activity

          People

            martjone Martin Jones (closed Nokia identity) (Inactive)
            jpetrell Joona Petrell
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes