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

Unexpected behaviour of QXYSeries::hovered

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.5.0, 6.5.1
    • Charts
    • None
    • Any

    Description

      I'm getting what I believe is "unexpected" results from handling this signal from QXYSeries.

      I have this slot for handling the hovered signal:

      void ChartTab::scoreHovered(const QPointF& point, bool state)
      {
         if (state)
         {
             const QPoint globalMouseLocation(QCursor::pos());
             QLocale locale; QToolTip::showText(globalMouseLocation, locale.toString(point.y(), 'f', 2), this);
         }
      }
      

       

      When I position the mouse over a data point in the series, then slot is invoked with state set to true and my code displays the tooltip, but it also sets state to true when I position the mouse pointer over the line that connects the points in the series.
      I would have expected it to only set state to true when the mouse is over an actual data point in the series.

      It's been suggested that my expectation may differ from the intended behaviour, but to me the description of the signal which says:

      "This signal is emitted when a mouse is hovered over the point point in the chart. When the mouse moves over the point, state turns true, and when the mouse moves away again, it turns false."

      clearly means it should only be emitted for data points in the series, not for any arbitrary position on the lines connecting the data points

       

      Attachments

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

        Activity

          People

            e0348803 Miikka Heikkinen
            perdrix David Partridge
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes