Reputation: 9701
I am using Qt Designer and a UI form. Targeted version of Qt is the latest PySide2 (Qt 5.x).
I have added a tooltip to my QTabWidget
. In addition I have added tooltip to multiple other components in each tab (aka page). I noticed that whenever my mouse is hovering (for enough time to trigger the tooltip) above an area inside the tab, where no other widget with a tooltip is present, I would get the tooltip of the tab.
The behaviour I am looking for is to show the tab tooltip only when the mouse is hovering the tab's title. Otherwise I end up with weird situations such as the tab's tooltip popping up when I'm hovering let's say a button in that tab without its own tooltip. Ugly at best, confusing for the user at worst.
Is there an easy way to prevent this from happening? I have to admit I have rarely used tooltips in previous projects but now I decided to give that feature more attention.
Upvotes: 3
Views: 1712
Reputation: 120718
You can use QTabWidget.setTabToolTip for this. It will only show the tooltip when hovering over a tab, unlike QTabWidget.setToolTip (which is inherited from QWidget). This property can also be set in Qt Designer, where it's listed under QTabWidget / currentTabToolTip in the Property Editor.
Upvotes: 7