PDA

View Full Version : Change scroll bar color in QScrollArea



tvj4218
28th February 2017, 17:59
I've got a QScrollArea with a vertical scroll bar. I set the background of the scroll area to transparent using stylesheets programatically. This unfortunately sets the vertical bar's background as transparent as well, which is what I do not want. I want the scroll bar to be gray.
I've tried accessing the vertical scroll bar using QScrollArea::horizontalScrollBar() method but I cannot use the returned pointer as I get a "pointer to incomplete class type" error.

Thank you for any help.

n

tvj4218
28th February 2017, 20:48
I used a QPalette object to set the background color of the scroll area and it left the vertical scroll bar as gray.