Qt5 does not recognize shortcuts if no actions are added to the toolbar

I have a Qt4 application with short-cut menu entries (nothing out of the ordinary, things like Ctrl + O to open Ctrl + S files to save ...). When compiling with Qt5, short cuts do not work, although the actions are tied to the menu bar.

They work again if I add them to the toolbar.

Is there an easy way to make it work? I can also add all these actions to the list of actions attached to the main window, but this is pain and a tendency to error.

+8
c ++ user-interface qt5 keyboard-shortcuts qt-designer
source share
1 answer

I had a problem porting Qt4 to Qt5 on Ubuntu 14.04. The problem is an error in the current version of the appmenu-qt5 package. There seem to be two practical solutions:

  • Add an action to the main main window (in addition to the main window menu). addAction(<actionName>)

  • Remove appmenu-qt5 until it is fixed.

I was happy to live with effects 2, but all users of the application would also have to remove appmenu-qt5.

https://bugs.launchpad.net/ubuntu/+source/appmenu-qt5/+bug/1313248

+2
source share

All Articles