I've been pulling my hair out over the QScrollArea for the past couple of days. What I want to do is this: I want to make an area on my window which will contain a variable number of rows of lineEdit and pushButton widgets. They are laid out in a gridLayout which I have put in a frame. That frame is put into a scrollArea so that when more rows are added, they scan be scrolled to.
I have had zero success using QtDesigner. I drag the scrollArea to the window, drag the frame to the scrollArea and then the gridLayout to the frame but when running, there are no scroll bars.
I have had some success programming it by hand.
scrollArea = new QScrollArea(tab_2);
fra_ds_segments = new QFrame;
gridLayout_2 = new QGridLayout(fra_ds_segments);
scrollArea->setGeometry(10, 210, 855, 201);
<<add lines of lineEdits and pushButtons to gridLayout_2>>
This seems to work OK though I'd rather calculate the size of scrollArea rather than hard-code it. I have hard-coded it to an area which doesn't need vertical scroll bars for 5 lines but will for any more than that. So as an aside, does anyone know how to calculate the proper width of a scrollArea to hold certain items an not need scroll bars?
The main issue is...how can I use a scrollArea this way within Designer?