Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-5315

Mac Cocoa: QEvent::ToolTip not sent to the widget on which mouse operates

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 4.6.0
    • 4.5.3
    • GUI: Window management
    • None
    • macOS

      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.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            richard Richard Moe Gustavsen
            felix Felix Ritter
            Votes:
            3 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes