PDA

View Full Version : Dynamically grow a list of widgets



knobby67
7th August 2014, 08:44
Hi All,
I hope someone can help me out in my learning of Qt. My basic problem I'm facing now is I want to dynamically expand a group of widgets. I'm using Qt creator 5 on linux. Basically on my mainwindow.ui form I have

label line edit combo box
addbutton

when I click click the add button I want to add another row with the lable line edit and combo widgets below the current line. So evey time I click add a new set of widgets is added to the bottom of the “list” .
On a second note, is it possible to somehow set the max number of widget rows so that if I exceed a scroll side bar is added. A bit like on the text edit window when to many rows are added a vertical scroll bar is added.
Sorry about the terminology I'm just learning so am unsure of all the correct words to describe some items.

Thanks in advance.

aamer4yu
7th August 2014, 10:58
Will QScrollArea help you :rolleyes:

koki
7th August 2014, 14:53
@aamer4yu thank you for it :) I wasn't in known (http://aaspot.net/forum/showthread.php?1150-Linux-Ubuntu-tam-s%C3%BCr%C3%BCm) that this exists.

knobby67
8th August 2014, 08:43
Thanks I think that will solve the second part