View Full Version : Ho do I Expand QGrpahicsView off screen inside a QScrollArea?

4th June 2013, 13:12

Wondering if someone could help me here. I have a QScrollArea containing various widgets laid out vertically. A label, QListView and at the bottom a QGraphicsView. What I am trying to get to is that the QGraphicsView widget will expand off screen so that by using QScrollArea side bar I can scroll down moving all widgets up.

The problem I am having is that the Layout the QGraphicsView has been been added to does not expand inside the QScrollArea so what I end up with is a letterbox effect at the bottom of the screen with no change to the QScrollArea.

I'm not sure if the QLayout which contains the graphics is causing me problems or the QGraphicsView?

Is there something I am missing.



5th June 2013, 21:21
Cannot see your attachment.

The size of the widget inside the scroll area (i.e. the one you call setWidget() with) is not driven by the size of the scroll area view port. You need to set the size of that widget if the size derived automatically from size hints of the contained widgets is not acceptable.