1 Attachment(s)
Setting a transparent background to QScrollbar using stylesheets
Hi,
I am currently trying to set a scrollbar with completely transparent background.
It works well for the part under the handler, which is completely transparent, but in the part where the handler is not, some kind of white canvas remains...
See a picture in the attachment.
Here's the stylesheet I use for Scrollbars:
Code:
background: transparent;
width: 19px;
padding: 0 0 20px 0;
margin: 20px 0 20px 0;
}
background: transparent;
border-image: url(scrollbar.png) 4 0 4 0 repeat;
border-top: 4px;
border-bottom: 4px;
min-height: 39px;
}
border-top: solid 5px transparent;
background: none;
height: 20px;
subcontrol-position: bottom;
subcontrol-origin: padding;
}
border: none;
background: none;
height: 20px;
subcontrol-position: top;
subcontrol-origin: margin;
}
image: url(uparrow.png);
}
image: url(downarrow.png);
}
Any idea ?
Thanks a lot.
Márwyn
Re: Setting a transparent background to QScrollbar using stylesheets
Yes, there is some bug/feature in rendering the background for scrollbar :)
In my opinion the implementation of drawing widgets with stylesheets is a little bit messy. Certain parts are drawn using stylesheets, some other using current style, some other hardcoded style. Therefore if you run your application on Linux, you don't get the problem that you get on your Windows machine.
Try to run your app with different style that Windows default and see what happens
Re: Setting a transparent background to QScrollbar using stylesheets
Thanks a lot !
Setting the scrollbar style to another style did the trick !
Still, this is (a bit) hacky... Is there no clean way to do that ?
Anyway, it will do for now, until I find something else :)
Thx again !
Márwyn