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

[Flickable] Add option to disable dragging by mouse

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.2.0, 6.5.3
    • None
    • All

    Description

      Currently QML Flickable and all of its derivatives (ListView, GridView, etc) have no option to disable content dragging by mouse. There is interactive property but it disables both dragging and wheel handling.

      In generally dragging by mouse behaviour looks weird for desktop platforms and user should have an option to disable it.

      Another case when it might be needed - e.g. implementation of multi-selection logic by mouse dragging. Previously (before Qt 6) it was possible by placing MouseArea inside ListView (but under items) and process/filter mouse events before ListView's internal handling.

          ListView {
              MouseArea {
                  anchors.fill: parent
                  preventStealing: true
                  z: -1 // trick
      
                  ...
                  some internal handling to implement items multi-selection logic
                  it was possible to process here all mouse events not accepted by items themselves and do not pass events further to ListView (by accepting them)
              }
          }
      

      Since Qt 6 this trick doesn't work anymore, and because ListView eats all mouse events I don't see how such logic can be reimplemented now.

      Attachments

        Issue Links

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

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              studiosus Vladimir Belyavsky
              Votes:
              13 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes