Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.5.2
-
None
Description
In some cases (I could not find a 100% deterministic way to reproduce the bug), the leaveEvent will not be delivered on a widget if that widget has a custom tooltip. This result in the tooltip still being displayed, and the "hover" state stylesheet being active on the main widget.
We have one widget (say, a QLabel) that wants to display a custom tooltip on EnterEvent, and hide it on LeaveEvent.
Sometimes, the LeaveEvent is not received. This results in the Tooltip still being displayed, but also on the "hover" state to remain in the Label looks.
An example for the classes of such a label and custom tooltip are in the attached files.
Then the issue can be reproduced by adding a dozen of LabelWithToolTip in any layout, with the stylesheet
"LabelWithTooltip:hover {background-color: #FF0000;}"
and quickly passing the mouse cursor over them. Not all of them are going to display the issue, but on the dozens of labels, some are likely to keep their tooltip and hover state.
The tooltip does get a leaveEvent though. It's just that the parent label never gets one. So the issue of the tooltip still being displayed is easy enough to fix, by adding an eventFilter on the tooltip, to catch when that widget gets a leaveEvent. But there is not easy way to end the "hover" state.
This only seems to happen on Mac. We could not reproduce the issue on Windows.