Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Updating QAction shortcuts text
Forum Updated to NodeBB v4.3 + New Features

Updating QAction shortcuts text

Scheduled Pinned Locked Moved General and Desktop
8 Posts 2 Posters 2.6k Views 1 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.
  • D Offline
    D Offline
    deni123
    wrote on last edited by
    #1

    How to update Action shortcut text after calling @QAction::setShortcut()@

    without restarting app ?

    1 Reply Last reply
    0
    • R Offline
      R Offline
      raaghuu
      wrote on last edited by
      #2

      @QAction::setShortcut(tr("<key-combo>")@

      it updates the text automatically

      1 Reply Last reply
      0
      • D Offline
        D Offline
        deni123
        wrote on last edited by
        #3

        after second call QAction::setShortcuts to update text I must restart app

        1 Reply Last reply
        0
        • R Offline
          R Offline
          raaghuu
          wrote on last edited by
          #4

          well... i tried it... strangely it worked for me... does your app continue to work after the call or does it crash?

          1 Reply Last reply
          0
          • D Offline
            D Offline
            deni123
            wrote on last edited by
            #5

            it does not crash

            1 Reply Last reply
            0
            • R Offline
              R Offline
              raaghuu
              wrote on last edited by
              #6

              what exactly happens then?it just continues to work as if nothing happened? if yes, then probably the call to second setShortcut() is not being reached... you should try using a qDebug() statement to check if the execution actually reaches the second call... if you tried all this and it still doesn't work, then that's strange because it is working for me...the second call automatically updates everything...probably you should try reinstalling

              1 Reply Last reply
              0
              • D Offline
                D Offline
                deni123
                wrote on last edited by
                #7

                it working because when call new shortcut(after setShortcut()) on my keyboard it run, but shortcut text in menu or in other places do not update.

                1 Reply Last reply
                0
                • R Offline
                  R Offline
                  raaghuu
                  wrote on last edited by
                  #8

                  could you give a stripped down version of how exactly you are doing it(in code)? maybe that'll shed some light on what's going on...

                  1 Reply Last reply
                  0

                  • Login

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