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

event.matches(StandardKey.Delete) and event.matches(StandardKey.Cut) always received Cut

    XMLWordPrintable

Details

    Description

      KDEBUG-344969 https://bugs.kde.org/show_bug.cgi?id=344969
      REVIEW-128444 https://git.reviewboard.kde.org/r/128444/

      qmlscene test-shortcut1.qml, if pressed Ctrl+X, it printed:

      qml: Press Ctrl+X
      

      but pressed Shift+Delete, it still print:

      qml: Press Ctrl+X
      

      qmlscene test-shortcut*2*.qml workaround:

      if (event.modifiers & Qt.ShiftModifier) {                       
          if (event.key == Qt.Key_Delete) {                                  
              console.log("Press Shift+Delete to delete file");              
          }                                                                  
      } else if (event.modifiers & Qt.ControlModifier) {                     
          if (event.key == Qt.Key_X) {                                       
              console.log("Press Ctrl+X to cut");                            
          }                                                                  
      }
      

      Attachments

        1. test-shortcut1.qml
          1 kB
          Leslie Zhai
        2. test-shortcut2.qml
          1 kB
          Leslie Zhai

        Activity

          People

            srutledg Shawn Rutledge
            lesliezhai Leslie Zhai
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: