Unsolved Disable QGraphicsScene autoscale
-
Hi guys.
I have a scene where I paint a series of items using a drag-and-drop process. What I want to do is to place the item where I loose it, do not auto-scale it. What happens to me is that if for example, having the scene empty, I drag an item and release it very close to the right side of the scene, it puts me in the middle and that's not what I want. What I want is to put it where I let it go and if the item does not enter the horizontal axis the horizontal scroll appears so that the user can see it.
Thank you.
-
Hi
If you mean it expands when you add item, then maybe this is what you want
https://forum.qt.io/topic/48564/force-qgraphicsview-size-to-match-qgraphicsscene-size -
Could you show me some of your code? You may did not set propagating mousereleaseEvent in your derived class.
-
A GraphicsScene's sceneRect will automatically grow when inserting items. I suspect that the view will the zoom into the changed sceneRect.
To avoid this, explicitly call setSceneRect with the desired size.