Subclassing QSlider with handle as a Widget
-
ok :)
And for painting the customwidget, you just instantiate it into the paint method of the subclasses slider and parent it to the subclassed slider?
-
And how to you render the customWidget with stylesheet?
-
Yes it was as I thought. So how do I do ? :D
-
Hello again,
I didn't know we could render a widget with QPainter, I never did like that in the past.
You are talking about :painter->begin(mycustomwidget); right?
Looks like there is also itemChange if I forget about the idea of subclassing a QSlider ....
-
I think you misunderstood me ( or maybe I misunderstand you :-) )
Why do you need a "customwidget" at all ? Consider that your "customwidget" is slider handle. You can render this "handle" in the way you want, also you can intercept mouse events for slider and filter these for "handle" rect. -
Its probably me who misunderstood :D
I wanted a separated widget for architecture reasons, to make it modular.
Lets say that tomorrow I decide that it will not be a slider but something else.
Or I want to render this customwidget in another view in my software ...There are a lot of reasons :)