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

QGraphicsView::mapToScene has odd offset.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P1: Critical
    • None
    • 6.6.2, 6.7.0, 6.7.1, 6.7.2
    • Widgets: GraphicsView
    • None
    • OpenSuse, Arch Linux
    • Linux/X11

    Description

      OpenBoard provides a virtual whiteboard with several pages. These pages can be moved independently, and OpenBoard saves the position of each page (more specifically, the center of the view after mapping to the relevant scene) 

      In my case, the center point always comes out as QPoint(960, 505). This point is then mapped to the scene via mapToScene(center).
      In Qt 6.6.1, the result is QPointF(0,0) because the page is centered there initially. Changing nothing but the Qt version, Qt 6.6.2 yields QPointF(0,-0.949555).

      This effect compounds over time, resulting in an effect of "moving down". The only seemingly related info I have is that a transform representing a zoom factor of 1.05313 is applied: 

      QTransform(type=TxScale, 11=1.05313 12=0 13=0 21=0 22=1.05313 23=0 31=0 32=0 33=1)

      Incidentally, 1/1.05313 ≃ 0.9495504, which is close to the offset.

      I wasn't able to bisect the commits between 6.6.1 and 6.6.2 to determine which one causes the change. d99b0c might be related, though I'm not sure.
      If there is anything else I could try, please add a comment below.

      Thanks for your time,
      Vekhir

       

      This issue has been reported in OpenBoard too: OpenBoard#1009

      The relevant source code section in OpenBoard is here: https://github.com/OpenBoard-org/OpenBoard/blob/dev/src/board/UBBoardController.cpp#L1008-L1011

      Attachments

        Issue Links

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

          Activity

            People

              bjorn Thorbjørn Lindeijer
              vekhir Vekhir --
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes