PDA

View Full Version : Styling background of QScrollBar



martinn
9th February 2010, 09:25
I'm trying to use stylesheets to style my scrollbars as this picture:
http://i46.tinypic.com/317b9z6.jpg

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:


QScrollBar:vertical {
border: 0px;
background: #fff;
margin: 0px;
width: 15px;
}

QScrollBar::handle:vertical {
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #D7D7D7, stop: 1.0 #A2A2A2);
min-height: 20px;
border: 1px solid #9F9F9F;
border-radius: 4px;
}

wysota
19th February 2010, 11:06
I think you have to either go with a picture or with a linear gradient that will generate a line (but it might not look good if the scrollbar becomes wide because of some reason - like style settings).