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

QHelpEvent::globalPos() returns frequently a wrong value.

    XMLWordPrintable

Details

    • Linux/X11
    • 0a64a044b6 (qt/qtbase/dev) 0a64a044b6 (qt/tqtc-qtbase/dev) a28fd4e54d (qt/qtbase/6.3) a28fd4e54d (qt/tqtc-qtbase/6.3)

    Description

      QHelpEvent::globalPos() returns frequently the wrong value QPointF(-1,-1). This causes tooltips to appear near the top/left edge of the screen.

      The reason is the call of 'dispatchEnterLeave' in QApplicationPrivate::sendMouseEvent. Before the call, the result of 'event->globalPosition()' is correct. After the call QPointF(-1,-1) is returned.

      To reproduce the bug, add the lines marked with '#if 1' to 'sendMouseEvent' and move the mouse e.g. over the toolbar of Qt Designer.

          } else if (lastMouseReceiver && widgetUnderMouse) {
              #if 1
              auto savedPosition = event->globalPosition();
              #endif
      
              // Dispatch enter/leave if we move:
              // 1) from an alien widget to another alien widget or
              //    from a native widget to an alien widget (first OR case)
              // 2) from an alien widget to a native widget (second OR case)
              if ((alienWidget && alienWidget != lastMouseReceiver)
                  || (isAlien(lastMouseReceiver) && !alienWidget)) {
                  if (activePopupWidget) {
                      if (!QWidget::mouseGrabber())
                          dispatchEnterLeave(alienWidget ? alienWidget : nativeWidget, lastMouseReceiver, event->globalPosition());
                  } else {
                      dispatchEnterLeave(receiver, lastMouseReceiver, event->globalPosition());
                  }
      
              #if 1
              if (event->globalPosition() != savedPosition)
                  qDebug() << event->globalPosition() << savedPosition;
              #endif
              }
          }
      

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-100324
          # Subject Branch Project Status CR V

          Activity

            People

              srutledg Shawn Rutledge
              wschenke Winfried Schenke
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: