Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Remove shortcut set to QAction
Qt 6.12 LTS is out! See what's new in the release blog

Remove shortcut set to QAction

Scheduled Pinned Locked Moved General and Desktop
5 Posts 5 Posters 3.9k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TheKodz
    wrote on last edited by
    #1

    I have QT application developed with many QAction's (Menu & Toolbar). While creating this QAction's, shortcut key is associated with it. I want to allow user to remove the shortcut so that it can be used with other action as per his choice. But there is no API in QAction class to remove the shortcut.

    Is it doable?

    Thanks a lot.

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

      hi
      http://doc.qt.io/qt-5.5/qaction.html#shortcut-prop
      cannot be used ?

      Joel BodenmannJ 1 Reply Last reply
      0
      • mrjjM mrjj

        hi
        http://doc.qt.io/qt-5.5/qaction.html#shortcut-prop
        cannot be used ?

        Joel BodenmannJ Offline
        Joel BodenmannJ Offline
        Joel Bodenmann
        wrote on last edited by
        #3

        @mrjj When I understand the documentation correctly you just have to do QAction::setShortcut(QKeySequence()) to remove a currently assigned keyboard shortcut

        Industrial process automation software: https://simulton.com
        Embedded Graphics & GUI library: https://ugfx.io

        K 1 Reply Last reply
        0
        • Joel BodenmannJ Joel Bodenmann

          @mrjj When I understand the documentation correctly you just have to do QAction::setShortcut(QKeySequence()) to remove a currently assigned keyboard shortcut

          K Offline
          K Offline
          Kapitan Papiroveho Lodstva
          wrote on last edited by
          #4

          @Joel-Bodenmann This does not seem to be correct. (at least not anymore).

          Tested it right now. While debuging it seems to remove the item from shortcut map, but the shortcut still works. :(

          SGaistS 1 Reply Last reply
          0
          • K Kapitan Papiroveho Lodstva

            @Joel-Bodenmann This does not seem to be correct. (at least not anymore).

            Tested it right now. While debuging it seems to remove the item from shortcut map, but the shortcut still works. :(

            SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @Kapitan-Papiroveho-Lodstva hi,

            Which version of Qt are you using ?
            Can you provide a minimal compilable example that shows the behavior ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            1

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt
            • Unsolved