I would like to have a menu item without children. I have a QMenubar, and in this menubar there is a QMenu. To use it as a menu, I have to put QActions in it, and they will appear if I click on the QMenu. How is it possible, to have only the menu, without any QActions, to do an action just as if it were a QAction?
A workaround would be to have a toolbox and disguise it as a menu, but it raises several problems:
- It's not the cleanest solution
- I have to manually care about highlighting it on mouse hover, and it will not be platform- and user setting independent.
- I can't use it together in a menubar with normal menus with children.
QAction
s seems meaningless to me. However, if you want to trigger only one slot for severalQAction
s, you can use QActionGroup: doc.qt.nokia.com/4.6/qactiongroup.html – Donotalo