Unwanted resize QGraphicsScene
Solved
General and Desktop
-
Hello!
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!
-
Hi,
What should happen when you move the camera 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.
-
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.