Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-21048

Qt Designer doesn't addAction to the widget automatically.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Invalid
    • Affects Version/s: Qt Creator 4.7.0
    • Fix Version/s: None
    • Component/s: Widget Designer
    • Labels:
      None
    • Environment:
      OS: Windows10
      Qt Compiler: Qt 5.11.1 MinGW 32bit
      Qt Creator: 4.7.0
    • Platform/s:
      Windows

      Description

      Problem

      When creating a Qt Widgets Application by Qt Creator, I created a new action with some shortcut by embedded Qt Designer, and didn't add it to toolbar or menubar.

      I wished to trigger it by shortcut.

      But I failed to trigger it by shortcut.

       

      I check the builded `ui_*.h` and find it not be added (there is no function `addAction`) to the widget at all.

      I can add it manually in my code. But in my opinion, Qt Designer should add it automatically, not doing that is an unexpected behavior.

      Briefly, Qt Designer doesn't add action to the widget automatically.

      MWE Reproduce

      1. Create a new Qt Widgets Application by Qt Creator.
      2. Edit the `*.ui` file by embedded Qt Designer
      3. add an action with some shortcut by Action Editor
      4. connect the signal `triggered` of the action to the slot `close` of the main widget by Signal Slots Editor.
      5. Build and run. Try the shortcut and find it not work.
      6. Check `ui_*.h` and find the action isn't added.

      Attachment

      I attach a mwe reproduced by the steps above.

        Attachments

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

          Activity

            People

            • Assignee:
              kleint Friedemann Kleint
              Reporter:
              ta 兴宇 谢
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes