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

Custom key handling in TextArea broken

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P1: Critical P1: Critical
    • None
    • 6.9.2, 6.10.0 Beta3
    • None

      The following example has a global key shortcut "B" (which terminates the application) and two text areas that implement Keys.onTabPressed to participate in the tab focus chain. The expected behavior is that pressing "B" when a text area has the focus insert a "B" in the text area and not invoke the global shortcut. This worked in Qt 6.9.1 but no longer works in 6.9.2 or 6.10.0b3.

      import QtQuick
      import QtQuick.Controls
      
      ApplicationWindow {
          width: 300
          height: 300
          visible: true
      
          Column {
              spacing: 20
      
              TextArea {
                  focus: true
                  placeholderText: "TextArea1"
                  Keys.onTabPressed:
                      nextItemInFocusChain().forceActiveFocus(Qt.TabFocusReason)
              }
              TextArea {
                  placeholderText: "TextArea2"
                  Keys.onTabPressed:
                      nextItemInFocusChain().forceActiveFocus(Qt.TabFocusReason)
              }
          }
          Shortcut {
              sequence: "B"
              onActivated: close()
          }
      }

        For Gerrit Dashboard: QTBUG-139679
        # Subject Branch Project Status CR V

            santhoshkumar Santhosh Kumar Selvaraj
            enz Markus Enzenberger
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                There is 1 open Gerrit change