List of Widget, how to
-
Hi all,
I have a widget i want to put it on a list like this
the widget is enclosed in a scrollarea so when the number exceeds the view scroll bar come out,
I programatically add the widgets with align topSomeWidget* widget1 = new SomeWidget(this); ui->itemList->addWidget(widget1, 0, Qt::AlignTop);
the problem is, if there are only like two or even a single item, QT Layout will add this in the center or will auto resize the item to fit the view like this.
or if two items
what i did is I created a vertical layout and just add the widget dynamically and it works as expected When there are like a good number of list.
I want to just put the widgets after each other like a list.
How can i do that? -
Add a vertical expanding spacer at the end.
-
@cebuger said in List of Widget, how to:
perfect thanks!
Did it work?
If so please don't forget to mark your post as solved!