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

[Regression] ListView isn't draggable with ListView.OverlayHeader

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.15.2
    • None
    • Tested on iOS/macOS with Qt 5.15.2, probably applicable to all platforms and newer Qt versions.

    Description

      Consider the following ListView with a MouseArea inside the delegate and headerPositioning is ListView.OverlayHeader:

      import QtQuick 2.12
      import QtQuick.Window 2.12
      
      Window {
        width: 640
        height: 480
        visible: true
        title: qsTr("Hello World")
      
        ListView {
          anchors.fill: parent
      
          headerPositioning: ListView.OverlayHeader // removing this line makes the ListView draggable/flickable again
      
          model: 20
          delegate: Rectangle {
            width: parent.width; height: 100
            color: index % 2 ? "blue" : "grey"
      
            MouseArea {
              anchors.fill: parent // MouseArea fills the whole delegate
            }
          }
      
          header: Rectangle {
            color: "red"
            width: parent.width; height: 100
            z: 100
          }
        }
      }
      

      The combination of a header positioning of ListView.OverlayHeader and a MouseArea filling the whole delegate makes it impossible to flick the ListView by dragging. Using the scroll wheel of the mouse works correctly.

      This problem is closely related to

      However, those issues are fixed in Qt 5.15.2. I assume a similar fix is needed for this use case.

      Attachments

        Issue Links

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              m3197d - -
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: