Results 1 to 2 of 2

Thread: Change scroll bar color in QScrollArea

  1. #1
    Join Date
    Dec 2016
    Posts
    37
    Qt products
    Qt5
    Platforms
    Windows

    Default Change scroll bar color in QScrollArea

    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

  2. #2
    Join Date
    Dec 2016
    Posts
    37
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Change scroll bar color in QScrollArea

    I used a QPalette object to set the background color of the scroll area and it left the vertical scroll bar as gray.

Similar Threads

  1. Change background color of Scroll area
    By arunkumaraymuo1 in forum Qt Programming
    Replies: 3
    Last Post: 4th September 2012, 10:22
  2. Qscrollarea does not scroll
    By kabanek in forum Newbie
    Replies: 8
    Last Post: 4th October 2010, 03:51
  3. QScrollArea and scroll
    By uKCuH in forum Newbie
    Replies: 1
    Last Post: 1st July 2010, 12:22
  4. Force a Scroll in a QScrollArea
    By nmuntz in forum Qt Programming
    Replies: 2
    Last Post: 25th January 2009, 13:49
  5. Auto scroll down in QScrollArea
    By EricF in forum Qt Programming
    Replies: 2
    Last Post: 29th December 2008, 12:51

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.