Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt5 doesn't recognised shortcuts unless actions are added to a toolbar

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

They work again if I add them to a toolbar though.

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 a pain and prone to mistake.

like image 546
PierreBdR Avatar asked May 28 '14 16:05

PierreBdR


1 Answers

I had this issue porting from Qt4 to Qt5 on Ubuntu 14.04. The problem is a bug in the current version of the appmenu-qt5 package. There seem to be two practical workarounds:

  1. Add the action to the main Main Window (in addition to the Menu of the Main Window). addAction(<actionName>)

  2. Uninstall appmenu-qt5 until it is fixed.

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

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

like image 169
Adam Smith Avatar answered Oct 29 '22 14:10

Adam Smith