PDA

View Full Version : Trying to create custom QDial



dpatel
15th March 2010, 12:57
Guys,

I am trying to create custom QDial using Style Sheet. I was able to do it successfully with QSlider, but QDial does not work. I have read some where that QDial doesn't support stylesheet in full form. I want a confirmation to that if you know more about it. I am using Qt 4.6.

I am able to set the color of QDial but, cannot set the background image. Below is style sheet code which I am using.

QDial{
color:red; /*this works*/
background-image: url(:/Resources/bckgrnd.png); /*this doesn't */
}

Any help is appreciated.

Thanks

zgulser
15th March 2010, 13:01
why do you need red background if you put an image on your QDialog?

dpatel
15th March 2010, 13:33
this color:red is the color of notches that would be drawn along the dial.
background-color:red is to set the background color.

dpatel
16th March 2010, 12:33
I think I will have to subclass QDial and overload paintEvent(). I am able to achieve desired behavior doing so. Wanted to use Stylesheet for this. Let me know if you have a solution with Stylesheet.
Thanks