Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved centering under mouse on QGraphicsItem when zooming

    General and Desktop
    zooming qgraphicsview qgraphicsitem center
    1
    1
    311
    Loading More Posts
    • 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.
    • L
      lansing last edited by

      I have a rectangle QGraphicsItem in a QGraphicsView. When I scroll my mouse, the width of the item will change representing zoom in/zoom out. When the width of the item is longer than the view, a scroll will appear. Now I want the anchor to be under my mouse when scrolling so it stays in the center of viewport in the perspective of the QGraphicsItem.

      The document has info about setResizeAnchor(QGraphicsView::AnchorUnderMouse) but that only applies to the coordinate of QGraphicsView, I want it to be centering on the QGraphicsItem instead.

      1 Reply Last reply Reply Quote 0
      • First post
        Last post