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

Single character shortcuts are invalid

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.12
    • Quick: Controls 2
    • None
    • windows Qt5.12
    • 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. ShortcutFailure.pro.user
          22 kB
        2. ShortcutFailure.pro
          1 kB
        3. qml.qrc
          0.1 kB
        4. main.qml
          1 kB
        5. main.cpp
          0.6 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            liaqi Liang Qi
            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