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

Single character shortcuts are invalid

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Invalid
    • Affects Version/s: 5.12
    • Fix Version/s: None
    • Component/s: Quick: Controls 2
    • Labels:
      None
    • Environment:
      windows Qt5.12
    • Platform/s:
      Windows

      Description

      • When the TextField has focus, Shortcut does not work.
        I need a shortcut key for a single character.
      //代码占位符
      Rectangle{
           signal retrunSignal()
           Shortcut { 
               sequence: "Z"; 
               context: Qt.ApplicationShortcut ;
               autoRepeat: true; 
               onActivated: returnButton.clicked(); 
               enabled: returnButton.visible ; 
           }
         TextField {
              focus: true
               validator: RegExpValidator{ regExp: /^[0-9]+$/ ;}
         }
           Button{
              id:returnButton
                onClicked: {
                      retrunSignal()
                  }
           }
      
      }
      

        Attachments

        1. main.cpp
          0.6 kB
        2. main.qml
          1 kB
        3. qml.qrc
          0.1 kB
        4. ShortcutFailure.pro
          1 kB
        5. ShortcutFailure.pro.user
          22 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            liaqi Liang Qi
            Reporter:
            tohn tohn
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes