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

QML ToolTip impossible to rely on

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.9.3, 5.10.0 Beta 3
    • 5.9.0, 5.9.1, 5.10.0 Alpha
    • Quick: Controls 2
    • None

    Description

      Hello,

      ToolTip has a main issue: it is a Popup. It means that the following code will lead to different results depending on the situation (with hoverArea, a MouseArea):

      ToolTip {
          id: tooltip
          text: "Hello World!"
          visible: hoverArea.containsMouse
          x: myXPos
          y: myYPos
      }
      

      The two different results are the following:

      1. The tooltip is displayed outside of the hoverArea, it's fine, it works.
      2. The tooltip is displayed under the mouse, i.e. above the hoverArea, and then the hoverArea won't "containMouse" anymore because ToolTip is a Popup, that will steal the mouse. That will lead the ToolTip to immediately disappear => the bug is here.

      I believe the ToolTip should not be a Popup to avoid to steal the mouse events. I can't find any workaround, such as preventStealing or anything that don't work.

      It makes the component most of the time impossible to rely on since the positioning is (as documentation says) made by the framework depending on the available space, etc. and not necessarily by what the developer writes in the x/y properties.

      Thanks by advance,
      Louis

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            louisduverdier Louis DUVERDIER
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes