I have a Qt dialog and there is a slider in it, when the dialog is initialized the slider will be set a value. In order to remind the user what is the default value, I want to add a mark to the slider, just draw a line or a triangle above the handle. Here, the slider should be of QSlider type, that means I can’t implement a customized control derived from QSlider. Is there any way to realize it ?
Share
I’m not clear why you can’t derive a control from
QSlider. You can still treat it like aQSlider, just override thepaintEventmethod. The example below is pretty cheesy, visually speaking, but you could use the methods fromQStyleto make it look more natural: