When you call QScrollArea::setWidget(), it replaces the first widget with the second one. That's why it has the prefix "set" and not "add".
Two possible routes to a solution:
1 - Add a QLayout-based layout to the scroll area, and then add your multiple widgets to the layout
2 - Derive a new class from QWidget, add a layout to that, and add your widgets to that layout. Then add the derived widget to the scroll area.
The second method is the one I would choose. It is in essence exactly the same way you would create a new dialog class, except that in this case the bsae class is QWidget, not QDialog. Once you create that new widget class, you can use Qt designer to create its UI.
Bookmarks