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

DragHandler in ListView.header (in conjunction with RowLayout, Repeater) doesn't work anymore

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 5.15.2
    • 5.15.0 Beta1, 5.15.0
    • None
    • Windows 10 Pro, Version 10.0.18362 , QtCreator 4.12.2, Qt 5.15.0
    • Windows
    • 2acb31641fc9c34d24ac29232cdfec2673834629

      When using DragHandler in ListView.header (in conjunction with RowLayout, Repeater, delegate) then DragHandler doesn't emit any signals (e.g. onActiveChanged). 

      Under normal circumstances (not using in delegate) the DragHandler seems to work.

      In the following part an example snippet demonstrates it. This example is based on the example from Qt docs (https://doc-snapshots.qt.io/qt5-5.15/qml-qtquick-draghandler.html).

       Update: The dragging works correctly when clipping=false.

       Whereas in 5.14.1 the example works correctly.

      ListView {
          id: root
          clip: true
          headerPositioning: ListView.OverlayHeader
          ListModel {
              id: listModel
              ListElement {
                  name: "Bill Smith"
                  number: "555 3264"
              }
              ListElement {
                  name: "John Brown"
                  number: "555 8426"
              }
              ListElement {
                  name: "Sam Wise"
                  number: "555 0473"
              }
          }
          header: Item {
              width: parent.width
              height: 200
              RowLayout {
                  width: parent.width
                  height: parent.height
                  Repeater {
                      model: listModel
                      delegate: Item {
                          width: 200
                          height: 200
                          DragHandler {
                              id: handler
                              target: null
                          }
                          Text {
                              color: handler.active ? "darkgreen" : "black"
                              text: handler.centroid.position.x.toFixed(1) + "," + handler.centroid.position.y.toFixed(1)
                              x: 30 + handler.centroid.position.x - width / 2
                              y: 30 + handler.centroid.position.y - height
                          }
                      }
                  }
              }
          }
      }
      

        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
            codezeug codezeug
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes