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

GridView onShurtcutOverride not working for keyNavigation.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 5.10.1, 5.11.2
    • None

      Related: QTBUG-68711

      import QtQuick 2.9
      import QtQuick.Window 2.2
      import QtQuick.Controls 1.4
      
      
      Window {
          id: root
          visible: true
          width: 640
          height: 480
          title: qsTr("Hello World")
      
          Shortcut {
              enabled: true
              sequence: "Right"
              context: Qt.ApplicationShortcut
              onActivated: console.log("press received in shortcut")
          }
      
          GridView {
              id: gridview
              Keys.onShortcutOverride: {
                  console.log("shortcut override")
                  event.accepted = true
              }
              keyNavigationEnabled: true
              keyNavigationWraps: true
              onCurrentIndexChanged: console.log("key received in gridview")
              model: 100
              delegate: Item {}
          }
      
          Component.onCompleted: gridview.forceActiveFocus()
      }
      

      Expected after pressing right-arrow key:
      qml: shortcut override
      qml: key received in gridview

      Actual:
      qml: press received in shortcut

      Key is processed correctly in gridview if shortcut is disabled, or input forwarded to through another item.

        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
            mr.greywater mr.greywater
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes