I'm trying to add ToolTips on MenuBar Items using the tool properties but it didn't work... But on labels, pushbuttons and other widgets it seems to work pretty fine. Can anyone help me with this?
How to include tooltips for menu items in qt
1.5k Views Asked by AudioBubble At
2
There are 2 best solutions below
0

Here is how I make tooltips work by setting the property in Qt Desinger.
Due to the lack of an MCVE, I prepared my own and was able to reproduce the issue of OP. (I tested with Windows/VS2017/Qt 5.13 and in cygwin/X11/Qt 5.9.)
Researching the web, I found a similar Q/A in the Qt Forum:
(Solved) setToolTip in QAction menu.
As I already had an MCVE, I tried that solution and got it working (in Windows/VS2017/Qt 5.13).
testQMenuBarToolTip.cc
:testQMenuBarToolTip.pro
:Output: (Windows 10, VS2017, Qt 5.13)
Built and tested in cygwin64 with:
Output: (cygwin64, X11, g++, Qt 5.9)
Notes:
I applied some fine-tuning to the answer I copied from (e.g. adding missing return statements).
While fiddling with my sample, I realized the same issue with the sub-menu and copy/paste programmed the solution for
QMenu
as well.