Unwanted resize QGraphicsScene
I am working with a QGraphicsView and I have a little problem. This is my example:
The camera image is an item that I can move but, when I move it out of the scene, the scene resizes and I don't want that:
How can I do to not allow this resize?
Thank you very much!
What should happen when you move the camera out of the scene ?
This post is deleted!
@SGaist It must be like a "wall". It mustn't allow the movement out of the scene
Then it looks like you should do some collision detection on where you won't need your camera to go then remove them.
@SGaist Ouch, I thought it could have a solution more "automatic" like a flag or something like this. I just want to put the widget on the edge of the window when I want to get it out of it.
Thank you for your time!
Ok, I found a solution that could be useful. Only with this line (view is the QGraphicsView, and item, the QGraphicsPixmapItem that I use of background):
view.setSceneRect(0, 0, item->boundingRect().width(), item->boundingRect().height());
This solution sets the scene and, although the widget can exit it, it does not resize it.