Results 1 to 2 of 2

Thread: Styling background of QScrollBar

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2010
    Posts
    51
    Thanks
    9
    Thanked 14 Times in 4 Posts

    Default Styling background of QScrollBar

    I'm trying to use stylesheets to style my scrollbars as this picture:


    My problem is to make the background to be just a line with a width of 1px. One idea is to use a picture as the background (where the picture is just white with a 1px line). But is there another way of doing this?

    This is the style I'm using:
    Qt Code:
    1. QScrollBar:vertical {
    2. border: 0px;
    3. background: #fff;
    4. margin: 0px;
    5. width: 15px;
    6. }
    7.  
    8. QScrollBar::handle:vertical {
    9. background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
    10. stop: 0 #D7D7D7, stop: 1.0 #A2A2A2);
    11. min-height: 20px;
    12. border: 1px solid #9F9F9F;
    13. border-radius: 4px;
    14. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by martinn; 9th February 2010 at 09:52.

Similar Threads

  1. Problems styling horizontal QScrollbar
    By GuS in forum Qt Programming
    Replies: 0
    Last Post: 10th September 2008, 22:34
  2. Background Style Disables QScrollBar "Drag" Action
    By brent99 in forum Qt Programming
    Replies: 1
    Last Post: 3rd June 2008, 20:16
  3. qscrollbar styling
    By 20khz in forum Qt Programming
    Replies: 0
    Last Post: 5th May 2008, 14:17
  4. Problems styling QScrollBar / QPushButton
    By December in forum Qt Programming
    Replies: 0
    Last Post: 20th January 2008, 06:53
  5. qss + QScrollBar background issue
    By Lykurg in forum Qt Programming
    Replies: 0
    Last Post: 25th July 2007, 16:17

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
  •  
Qt is a trademark of The Qt Company.