PDA

View Full Version : How can I stop expanding a QGraphicsScene?



emrares
1st November 2010, 16:23
Hi

I am working with QGraphicsView and QGraphicsScene and I want to have a fixed size for the scene without scrollbars, and my widgets from the scene not disappear when the widgets are moved outside the graphicsView. The widgets should stay inside the graphicsView.
Is there any simple way to do it?

Thank you very much for helping!

SixDegrees
1st November 2010, 18:59
Yes, you posted this earlier.

Is there something wrong with your original post? It's only a few posts below this one.

genjix
2nd November 2010, 15:27
self.view.setHorizontalScrollBarPolicy(QtCore.Qt.S crollBarAlwaysOff)
self.view.setVerticalScrollBarPolicy(QtCore.Qt.Scr ollBarAlwaysOff)
self.view.setAlignment(QtCore.Qt.AlignLeft|QtCore. Qt.AlignTop)
self.adjustSize()

That's PySide but it should work in C++. Self is the parent window.