I want to paint image on slider groove and slider handle individually.
I want to paint image on slider groove and slider handle individually.
I'm assuming your question is "where do I start". Basically you have two choices, to subclass the slider and reimplemnt thebpaint event to draw something ON the groove or implement a subclass of QStyle to draw something INSTEAD of the groove.
but if i will re implement the paint event can i paint groove and handle each with different image.
If you reimplement the paint event, you can paint whatever you want. You can even not paint at all. Also consider using stylesheets instead of reimplementing the event.
stylesheet i have tried but it is not as flexible as i want.Can you please tell me how i will paint on the handle of the slider. what position i will give suppose if i am using the following code
Qt Code:
{ }To copy to clipboard, switch view to plain text mode
where pixmap is the image for groove.
pixmap1 for handle of slider.
It's not that easy. You need to calculate those positions. However it will probably be simpler to implement it in QProxyStyle subclass.
Bookmarks