I am trying to add a custom widget to a scroll area on click.

Let say this is my custom widget

And this is the main window where I can add my custom widget one by one when I click the "add" button.

Now when I try to add many custom widgets to that scroll area, the scroll bar didn't show up but instead
all the custom widgets huddled within the scroll area.

Clicked twice the "add" button:

Clicked the "add" button for 5 times:

But it works when I am adding many QPushButtons:

I am new to Qt so I hope that someone can show me how to do this in ui. Thanks in advance.