-
Bug
-
Resolution: Done
-
P2: Important
-
4.5.3
-
None
On Mac Cocoa the QEvent::ToolTip event is not sent to the widget on which the mouse operates. Here is why:
In QApplication::notify(QObject *receiver, QEvent *e) [qapplication.cpp] the current widget, where mouse moves occur, are stored in d->toolTipWidget and the toolTipWakeUp timer is started. In the Cocoa implementation, all widgets have mouse tracking enabled (see - (void)updateTrackingAreas of QCocoaView [qcocoaview_mac.mm]). This poses a problem if some of them overlap (e.g. QGLWidget in QMainview, etc.). The NSTrackingInVisibleRect option performs only very simple visibility tests that are not sufficient here. In effect, d->toolTipWidget will be updated for all overlapping widgets, hence overwriting each other in arbitrary order. If the toolTipWakeUp timer fires d->toolTipWidget may not contain the right widget and the event is sent to a widget not interested in this event at all. (if the right one is picked that's by pure chance and not predicatable). This is a regression from Qt 4.4.3
We use tooltips on a QGLWidget that is the frontmost part of out application widget hierarchy, where QEvent::ToolTip is the only means to provide tooltips to graphics items displayed using OpenGL.