Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. Scrolling in QGraphicsView

Scrolling in QGraphicsView

Scheduled Pinned Locked Moved Solved Qt 6
5 Posts 4 Posters 730 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    damian28102000
    wrote on 11 Mar 2021, 03:39 last edited by damian28102000 3 Nov 2021, 03:40
    #1

    Hi!
    I would like to be able to scroll where the mouse is in QGraphicsView, something like this: https://youtu.be/4dq7n8S9AHw
    Unfortunately, the solution presented on yt doesn't work in the newer version of qt (I'm using 6.0.1).

    I mean scroll in two directions where the mouse is now.

    Anyone have an idea how to move a solution from yt to a newer version, or is able to present a better one?

    A 1 Reply Last reply 11 Mar 2021, 23:45
    0
    • K Offline
      K Offline
      Ketan__Patel__0011
      wrote on 19 Mar 2021, 13:47 last edited by
      #5

      set Transformation Anchor for Your QGraphicsView
      QGraphicsview::setTransformationAnchor(QGraphicsView::AnchorUnderMouse);

      I am using same solution and it is working correctly.

      1 Reply Last reply
      3
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 11 Mar 2021, 21:13 last edited by
        #2

        Hi,

        Please provide a minimal compilable example that shows the issue.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        D 1 Reply Last reply 14 Mar 2021, 18:59
        1
        • D damian28102000
          11 Mar 2021, 03:39

          Hi!
          I would like to be able to scroll where the mouse is in QGraphicsView, something like this: https://youtu.be/4dq7n8S9AHw
          Unfortunately, the solution presented on yt doesn't work in the newer version of qt (I'm using 6.0.1).

          I mean scroll in two directions where the mouse is now.

          Anyone have an idea how to move a solution from yt to a newer version, or is able to present a better one?

          A Offline
          A Offline
          artwaw
          wrote on 11 Mar 2021, 23:45 last edited by
          #3

          @damian28102000 You already asked that in Polish part of the forum and I already explained that using Qt6 is sort of pointless atm due to many parts and modules still missing. I also advised you to roll back to Qt5, where you know it works.

          For more information please re-read.

          Kind Regards,
          Artur

          1 Reply Last reply
          1
          • S SGaist
            11 Mar 2021, 21:13

            Hi,

            Please provide a minimal compilable example that shows the issue.

            D Offline
            D Offline
            damian28102000
            wrote on 14 Mar 2021, 18:59 last edited by damian28102000
            #4

            45b12c42-51a5-4ef2-9b8e-b92462a88899-image.png I mean scroll in two directions where the mouse is now

            When I have the mouse on the red point I would like the x and y axes to get closer to exactly that point.
            Now you understand me? (sorry for the response time :( )

            a bit like a "magnifier" in paint but on the mouse scroll

            1 Reply Last reply
            0
            • K Offline
              K Offline
              Ketan__Patel__0011
              wrote on 19 Mar 2021, 13:47 last edited by
              #5

              set Transformation Anchor for Your QGraphicsView
              QGraphicsview::setTransformationAnchor(QGraphicsView::AnchorUnderMouse);

              I am using same solution and it is working correctly.

              1 Reply Last reply
              3

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved