I have read this forum's posts on my problem of getting a scroll bar to work in a scrollArea, but am still having problems.
I want a scroll area that stays the same dimensions all the time, but is able to scroll down to see all entries in the scrollArea. I want each entry in the scroll area to remain the same size, regardless of how many entries are in the scroll area.
In QT Creator/Designer:
1.I added a scrollArea. In that area, I added four columns and 10 rows of line edits.
2. All line edits have same vertical heights, but varying widths. I clicked "fixed" as a Horizontal and Vertical size policy for each line edit (as I do not want them to be resized).
3. I clicked the vertical ScrollBarPolicy to Always On and the Horizontal bar to Always off
4. I unchecked the QScrollArea/widgetResizable to make it FALSE, because I want the scroll area to remain fixed.
5. For the scrollArea, I selected "Fixed" for both the Horizontal and Vertical sizePolicy (I do not want the scroll area to change dimensions)
6. After making my matrix of line edits, the scroll area was larger than I wanted, so I grabbed the bottom edge of the scroll area and moved it up -- making it shorter and covering up about half of the line edits. (This is where I want to be able to scroll down and see the bottom line edits, and of course the upper ones will disappear from the fixed-size scroll area).
I have added no code related to the scrollArea. The code for the line edits works fine.
Result: Only about half of the line edits are visible (as expected), and a scroll bar/area appears, but it looks inactivated (greyed-out) and does not move - all I see are the upper and lower arrows and no actual bar.
What am I missing? Am I not understanding how a scroll area works? Do I also need to add code regarding the scrollArea?
Bookmarks