Lars Bilke Lars Bilke - 1 year ago 157
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.


Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download