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

Declaring Actions in-place results in the shortcuts not working

    XMLWordPrintable

Details

    Description

      Not sure if this is actually a bug or not, but it could be possible to share the action (have e.g. a button refer to it by id) when it is declared this way, so perhaps it's worth considering.

      import QtQuick 2.9
      import QtQuick.Controls 2.3
      
      import App 1.0
      
      ApplicationWindow {
          width: 800
          height: 800
          visible: true
      
          Action {
              id: fooAction
              shortcut: "1"
              onTriggered: print("top-level MenuItem action triggered")
          }
      
          menuBar: MenuBar {
              Menu {
                  title: "Menu"
      
                  MenuItem {
                      text: "Foo"
      //                action: fooAction
                      action: Action {
                          id: barAction
                          shortcut: "2"
                          // never triggered
                          onTriggered: print("in-place MenuItem action triggered")
                      }
                  }
              }
          }
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            mitch_curtis Mitch Curtis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes