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

The delegate item of ListView is not pressed if the boundsBehavior is to set Flickable.StopAtBounds

    XMLWordPrintable

Details

    • 9f9ea6e183 (qt/qtdeclarative/dev) b8dca1f9b9 (qt/qtdeclarative/6.4) b8dca1f9b9 (qt/tqtc-qtdeclarative/6.4) 89e7831f50 (qt/tqtc-qtdeclarative/6.2) f98dc59164 (qt/qtdeclarative/6.3) f98dc59164 (qt/tqtc-qtdeclarative/6.3) 02f5b1a771 (qt/qtdeclarative/6.4)

    Description

      The delegate item of ListView is not pressed if the boundsBehavior is to set Flickable.StopAtBounds.
       

      • Test Codes
        import QtQuick 2.15
        import QtQuick.Controls 2.15
        
        Rectangle {
            id: root
            objectName: "ListViewExample"
            width: 1920 - 400
            height: 720 - 107 - 64
        
            ListView {
                id: exam0
                width: 512 - 84
                height: 720 - 94 - 90
                anchors.left: parent.left
                anchors.leftMargin: 10
                anchors.verticalCenter: parent.verticalCenter
                clip: false
                model: modelTab
        //
        // set boundsBehavior to Flickable.StopAtBounds!!!!!!
        //
                boundsBehavior: Flickable.StopAtBounds
        
                delegate: Component {
                    Button {
                        height: 96
                        width: 428
                        text: name
                        font.pixelSize: 28
        
                        Rectangle {
                            id: buttonArea
                            anchors.fill: parent
                            border.color: "#41cd52"
                            color: "transparent"
                        }
        
                        onPressed: {
                            console.log(text + " is pressed")
                        }
        
                        onReleased: {
                            console.log(text + " is onReleased")
                        }
        
                        onClicked: {
                            console.log(text + " is clicked")
                        }
                    }
                }
            }
        
            ListModel {
                id: modelTab
        
                ListElement {
                    name: "AAAAAAAAAAAA"
                    enable: true
                }
                ListElement {
                    name: "BBBBBBBBBBBB"
                    enable: true
                }
                ListElement {
                    name: "CCCCCCCCCCCC"
                    enable: true
                }
                ListElement {
                    name: "DDDDDDDDDDDD"
                    enable: true
                }
                ListElement {
                    name: "EEEEEEEEEEEE"
                    enable: true
                }
                ListElement {
                    name: "FFFFFFFFFFFF"
                    enable: true
                }
                ListElement {
                    name: "GGGGGGGGGGGG"
                    enable: true
                }
                ListElement {
                    name: "HHHHHHHHHHHH"
                    enable: true
                }
            }
        }
        
      • Steps to reproduce this issue (It's easy to reproduce by using a touch screen)
        1. Select the first delegate item of the ListView
        2. Flick the ListView
        3. Select any delegate item quickly
          • Repeatedly touches the ListView's delegate item, but it is not pressed. (Bug!!!) IMG_1236.mov <----

      Please refer to my analysis it if you need it.

      1. Why is the touch not working?
        The event is filtered in QQuickFlickable::filterMouseEvent, so the touch doesn't seem to work.
        https://code.woboq.org/qt5/qtdeclarative/src/quick/items/qquickflickable.cpp.html#2422
      2. Why is it filtered?
        stealThisEvent(d->stealMouse) is sometimes set to true when entering the filterMouseEvent function.
        https://code.woboq.org/qt5/qtdeclarative/src/quick/items/qquickflickable.cpp.html#2391
      3. Who sets stealMouse to true?
        It seems to be setting stealMouse to true by guessing that the ListView is bouncing(flicking).
        https://code.woboq.org/qt5/qtdeclarative/src/quick/items/qquickflickable.cpp.html#1043

      There is no problem after movementEnding function is called. This is because the vData value is initialized.
      However, The problem occurs before the movementEnding function is called.

      I couldn't come up with solutions, so I just wrote down the issue and analyzed it in my own way.

      Attachments

        1. error.webm
          324 kB
        2. IMG_1236.mov
          14.16 MB

        Issue Links

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

          Activity

            People

              srutledg Shawn Rutledge
              jonghokim Jongho Kim
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: