Results 1 to 2 of 2

Thread: Scroll bar on scrollArea not working

  1. #1
    Join Date
    Jan 2017
    Posts
    54
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Scroll bar on scrollArea not working

    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?

  2. #2
    Join Date
    Jan 2017
    Posts
    54
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Scroll bar on scrollArea not working

    SOLVED

    in the designer: I left the physical size of the scroll area showing all widgets, then set the minimumSize and maximumSize to the size I wanted to display/show, and it worked. Thanks

Similar Threads

  1. Replies: 3
    Last Post: 18th January 2016, 04:22
  2. Scrollbar in scroll area not working
    By ada10 in forum Newbie
    Replies: 2
    Last Post: 30th August 2010, 13:39
  3. Replies: 0
    Last Post: 17th August 2010, 15:37
  4. Replies: 10
    Last Post: 2nd August 2010, 15:07
  5. Replies: 6
    Last Post: 14th April 2006, 06:39

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.