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. QGraphicsItem Rotation.
Qt 6.11 is out! See what's new in the release blog

QGraphicsItem Rotation.

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.7k Views 1 Watching
  • 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.
  • M Offline
    M Offline
    MyQT
    wrote on last edited by
    #1

    I have subclassed QGraphicsItem to draw my own customised item in QGraphicsScene.
    Subclassed item contains image.
    I am able to show it properly. When i tried ot rotate, it is obsered that it's loaction is getting changed.
    item's battom part is moving which i don't want. instead of that i want to move it's top portion.
    is there any way that we can rotate subclassed QGraphics Item without changing it's botton (base) location?

    Thansk in advance.

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Items are rotated around their transform origin point, which by default is at (0,0) - upper left corner. You need to specify this origin to whatever you want - center of the image, bottom corner etc. with setTransformOriginPoint(x,y).

      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