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

Keys.onPressed on TableView called twice

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P4: Low
    • None
    • 5.5.0
    • Quick: Controls 1
    • None
    • Qt 5.5.0 x32
      Debian Linux 8 x32
    • Linux/X11

    Description

      I have unexpected behavior with the code below:

          TableView {
              anchors.fill: parent
              TableViewColumn { title: "column1"; role: "col1" }
              TableViewColumn { title: "column2"; role: "col2" }
              TableViewColumn { title: "column3"; role: "col3" }
              model: ListModel {
                  ListElement { col1: "value1"; col2: "value2"; col3: "value3" }
                  ListElement { col1: "value4"; col2: "value5"; col3: "value6" }
                  ListElement { col1: "value7"; col2: "value8"; col3: "value9" }
              }
              Keys.onPressed: {
                  if(event.isAutoRepeat)
                      return;
                  if(event.key === Qt.Key_Space) {
                      console.log("Space pressed");
                  }
              }
          }
      

      the output

      qml: Space pressed
      qml: Space pressed

      means that Keys.onPressed was called twice instead of only one call.

      Attachments

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

        Activity

          People

            richard Richard Moe Gustavsen
            folibis ruslan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes