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

onDoubleClicked signal on listview delegate is not working when pressDelay is set

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.4.0
    • None
    • Windows 7

    Description

      Once I set a pressdelay on Listview, the onDoubleClicked signal of the delegate is not working.

            ListView {
              id: connectionList
              anchors.fill: parent
              currentIndex: -1
              pressDelay: 100
              clip: true
              model: ListModel {
                ListElement {
                  item: "Windows"
                }
                ListElement {
                  item: "Mac"
                }
                ListElement {
                  item: "Linux"
                }
              }
      
              delegate: Rectangle {
                width: parent.width
                height: 50
                color: ListView.currentItem ? "blue" : "transparent"
      
                Text {
                  id: item
                  anchors {
                    left: parent.left
                    leftMargin: 20
                    verticalCenter: parent.verticalCenter
                  }
                  text: model.item
                }
      
                MouseArea {
                  id: mouseArea
                  anchors.fill: parent
                  onDoubleClicked: {
                    console.log("doubleclicked on delegate")
                  }
                  onClicked: {
                    console.log("clicked on delegate")
                    ListView.currentIndex = model.index;
                  }
                }
              }
            }
      

      When I tried doubleclicking the delegate item, it detected two clicks instead.

      Attachments

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

        Activity

          People

            aalpert Alan Alpert
            literA2 Rex Literato
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes