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

A graphics view's last center point may drift if only a scroll bar is moving

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 6.0.3
    • Fix Version/s: None
    • Component/s: Widgets: GraphicsView
    • Labels:
      None
    • Platform/s:
      All

      Description

      If only a scroll bar, for example the horizontal scroll bar, is moved, QGraphicsView::scrollContentsBy(dx, dy) will be called with a zero dy. Then updateLastCenterPoint() will be called by scrollContentsBy(). Both the x and y coordinates of lastCenterPoint will be updated. But actually only the x coordinate should be updated while the y coordinate must be unchanged. The existing code will make lastCenterPoint drift away.

      I uploaded a test case. The horizontal scroll bar is moved every 3 seconds. The horizontal line should not move but it's drifting away slowly.

      It'll be appreciated if this bug is fixed.

        Attachments

        1. main.cpp
          0.3 kB
        2. mainwindow.cpp
          0.7 kB
        3. mainwindow.h
          0.3 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            qt.team.quick.subscriptions Qt Quick and Widgets Team
            Reporter:
            gchen Gang Chen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes