Hi i'm trying to get a photoshop-like behaviour for my QGraphicsScene
The grid in the background should not resize with the call of scale. And I must be able to save the picture with QPixmap::grabWidget(view) but without the background grid. I can probably do it with removing the background layer just before saving the picture, but i'm not sure if its cleanest way to do it.
Any ideas ?
thx.
The grid in the background should not resize with the call of scale.
Use the QGraphicsItem::ItemIgnoresTransformations
flag.
The item ignores inherited transformations (i.e., its position is still anchored to its parent, but the parent or view rotation, zoom or shear transformations are ignored). This flag is useful for keeping text label items horizontal and unscaled, so they will still be readable if the view is transformed. When set, the item's view geometry and scene geometry will be maintained separately.
In order to set this flag use the setFlag
function when creating the grid item.
I must be able to save the picture with QPixmap::grabWidget(view) but without the background grid.
Call the hide
function on the grid item before calling the grabWidget
. After you have grabbed it you show it again by calling the show
function.