Yes, really nice.
You should have a custom widget for that. The widget must be all transparent besides the circle and the ellipse knob.
You can achieve this by filling the (rectangular) widget with a transparent pixmap. then draw a circle( inscribed in the widget bounding rect - actually square).
For the knob you can simply draw an ellipse and store its bounding rect as a member in the class.
Next you must implement mousePressEvent, mouseReleaseEvent and mouseMoveEvent. These will make possible the interaction with the knob.
For the horizontal and vertical sliders you should use the same class, but add some flags to it that will tell it how to paint the slider( as a circle, horizontal, etc... ).
You can add a valueChanged signal that you emit in mouseMoveEvent, when the user drags the knob and the value changes.
That's how I would do it.
BTW: to make the two smaller sliders fit, you should compute the square inscribed in the circle( its diagonal is equal with the circle diameter ), therefore the length of a slider is sqrt(2)*diameter.
Regards




).
Reply With Quote
Bookmarks