You need to provide a minimal example of what's going on. We shouldn't have to guess.
All I can see is up to three widgets: the top level one, the QScrollArea
, and whatever widget is inside of the scroll area. If that's the case, then the scroll area is not managed by a layout, and when you resize the top level widget, the scroll area's size remains unchanged.
I see two solutions, assuming that MyContentsWidget
is the widget that draws your genetics thingamajingy (if that's what it is).
Get rid of the toplevel widget and use the QScrollArea
as a toplevel widget:
int main(int argc, char ** argv) {
QApplication app(argc, argv);
QScrollArea area;
MyContentsWidget contents;
area.setWidget(&contents);
area.show();
return app.exec();
}
Add a layout to the toplevel widget, so that it'll resize the scroll area appropriately:
class MyWindow : public QWidget {
QGridLayout m_layout;
QScrollArea m_area;
MyContentsWidget m_contents;
public:
MyWindow(QWidget * parent = 0) : QWidget(parent), m_layout(this) {
m_layout.addWidget(&m_area, 0, 0);
m_area.setWidget(&m_contents);
}
};
In both cases, the order of declaration is the opposite of the order of destruction, and it is important since you must ensure that MyContentsWidget
is destructed before the scroll area.