QGraphicsItem Rotation.



  • 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.


  • Moderators

    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).


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.