Lars Bilke Lars Bilke - 24 days ago 9
C++ Question

QGraphicsView and QGraphicsItem: don´t scale item when scaling the view rect

I am using Qt´s QGraphicsView- and QGraphicsItem-subclasses.
is there a way to not scale the graphical representation of the item in the view when the view rectangle is changed, e.g. when zooming in. The default behaviour is that my items scale in relation to my view rectangle.

I would like to visualize 2d points which should be represented by a thin rectangle which should not scale when zooming in the view. See a typical 3d modelling software for reference where vertex points are always shown at the same size.

Thanks!

Answer

Set the item's flag QGraphicsItem::ItemIgnoresTransformations to true does not work for you?