PDA

View Full Version : Slider Style sheet



sijithjames
30th December 2009, 06:05
Hi
I want to design a customized vertical slider. How can i do that.
I like to give customized color or image to slider.
Please provide some help

yogeshgokul
30th December 2009, 07:49
Hi
I want to design a customized vertical slider. How can i do that.
I like to give customized color or image to slider.
Please provide some help
You have 2 options.
1. Use style sheet. (http://doc.trolltech.com/4.3/stylesheet-examples.html#customizing-qslider)
2. Use QStyle (http://qt.nokia.com/doc/qtjambi-4.3.5_01/com/trolltech/qt/qstyle.html#creating-a-custom-style) (Create your own style by subclassing QStyle.)

Tavit
30th December 2009, 12:43
Hi
Using style sheet you can easily change your slider
QSlider::groove:vertical { background-image: url(:/new/prefix1/SliderTruckFullSpk.png); left: 0px; right:0px; /* absolutely position 4px from the left and right of the widget. setting margins on the widget should work too... */}
QSlider::handle:vertical {height:17px;width:17px; background-image: url(:/new/prefix1/speakerindicator_Idle.png); left: 1px; right: 0px;top:0px;bottom:4px; }
QSlider::sub-page:vertical { background-image: url(:/new/prefix1/SliderTruck.png);left: 0px; right:0px; }