Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. centering under mouse on QGraphicsItem when zooming
QtWS25 Last Chance

centering under mouse on QGraphicsItem when zooming

Scheduled Pinned Locked Moved Unsolved General and Desktop
zoomingqgraphicsviewqgraphicsitemcenter
1 Posts 1 Posters 530 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.
  • L Offline
    L Offline
    lansing
    wrote on 9 Jun 2020, 16:30 last edited by
    #1

    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
    0

    1/1

    9 Jun 2020, 16:30

    • Login

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