I have a c++ Qt application where I want to display tooltips for some QActions in a QMenu.
Since Qt 5.1, there's the toolTipsVisible
property, which I set it to true in my .ui file but this doesn't display any tooltips when I run my application (even though the tooltips are displayed when I hover the QActions inside Qt Designer, just not when the application runs).
I couldn't test this on Windows, but I know some widgets behaves differently when used on Windows or on Mac, like QMessageBox not displaying titles on Mac, so maybe this tooltip issue is similar to this ?
Anyway, I then tried to subclass QMenu and reimplement the bool event(QEvent* e)
function to handle tooltips manually. I used code similar to the one of the accepted answer of this question. I promoted my QMenu item to my subclass, but this doesn't work for me either, no tooltips displayed when hovering my QActions.
Is there anything I'm doing wrong here ?
This was tested on 2 setups :
Qt 5.6.1, OS X El Capitan
Qt 5.8.0, macOS Sierra