PDA

View Full Version : Stylesheet for QSlider



Luc4
31st May 2010, 11:55
Hi! I'm trying to use a stylesheet for a QSlider. I've been able to do anything but placing an image for the QSlider::sub-page:horizontal so that it is resized only in width. I need the image I place to be resized so that the width is from the beginning to the handle, but the height is always the same.

I tried this way, forcing the height to what I need:

QSlider::sub-page:horizontal {image: url(image.png); height: 11px;

but it keeps resizing the whole image. Is it possible to keep its height always the same?
Thanks!

Luc4
1st June 2010, 08:01
In case anyone else need this, I found out a good solution: I used an image as large as the groove and the stylesheet

"QSlider::sub-page:horizontal {border-image: url(...);"
"border-top: 5px transparent; border-bottom: 5px transparent;"
"border-right: 10px transparent; border-left: 10px transparent;"
"}";

This way the result is exactly what I was looking for!