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. Positioning QGraphicsItem in the middle of viewport - jittering
QtWS25 Last Chance

Positioning QGraphicsItem in the middle of viewport - jittering

Scheduled Pinned Locked Moved Unsolved Qt 6
1 Posts 1 Posters 155 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.
  • B Offline
    B Offline
    black_gay
    wrote on last edited by
    #1

    I have a huge QgraphicsScene and a QGraphicsItem which changes its position according to pressed key arrows. I want the item to always be in the centre of the viewport. I used QGraphicsView::centerOn() and its exactly what i need, but there is jittering problem - and as i read its associated with the integer precision issue. So whats the way around? Another post says to use QGraphicsView::translate() and setTransformationAnchor(QGraphicsView::NoAnchor). But it doesnt seem to work.

    1 Reply Last reply
    0

    • Login

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