PDA

View Full Version : QScrollBar background image



Alundra
11th March 2014, 18:03
Hi all,
I try to have a scrollbar like this post :
http://www.qtcentre.org/threads/27908-Styling-background-of-QScrollBar
but on this post, the solution posted was not the good way.
Is it possible to achieve it correctly ? Can you say me a good way ?
I tried background-image on the stylesheet but I don't see the image on the scrollbar.


QScrollBar:vertical
{
background-image: url(Line.png);
width: 15px;
margin: 0px;
border: none;
}

Thanks for the help

Alundra
13th March 2014, 14:11
I found some doc who say that QScrollBar doesn't support image, so the only way is to use the paint function.
Using the paint function, then not needed to use an image, painter can draw a line correctly for scrollbar I think.
But I don't have a real view of how make it correct because if QScrollBar is inherited, how say it's the scrollbar for all widget ?
I hope you can help
Thanks