Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QGraphicsItem::ItemIgnoresTransformation and changing the 'origin' of the item?



  • Hi,

    I have some QGraphicsItems overlayed on a QPixmap. I want to zoom in on the pixmap without scaling the QGraphicsItems.

    myItem->setFlag(QGraphicsItem::ItemIgnoresTransformations, true) works just fine in this respect. However, the 'fixed point' (that which doesn't change under zoom, relative to the pixmap) of the item is the top-left corner of the item's bounding rect, whereas I would like the origin to be the centre of the bounding rect. So that the centre of the item remains in the same place when I zoom.

    Is this a trivial thing I'm missing? (massive newbie alert of course).

    Thanks in advance.


Log in to reply