0

I would like to change the colors of the handle of a qwtSlider. Also I would like to set the size of the slider-bar itself. I know I can use setBackgroundStyle(), but I would like to specify the size and color of all parts myself.

Frank
  • 2,446
  • 7
  • 33
  • 67

1 Answers1

1

I think it is not possible using Qt Stylesheets (although I'd love to be proven wrong).

To change the colors of the handle of a QwtSlider you can subclass it and reimplement void drawThumb(...) The code of qwt_slider.cpp shows how/which colors are chosen.

Analogously you can change other appearance properties by reimplementing other functions from QwtSlider.

c_k
  • 1,746
  • 1
  • 20
  • 35
  • Would I have to change the Painter, Brush or Palette in order to change the color? – Frank Feb 26 '13 at 16:12
  • Please have a look at the documentation of `qDrawShadePanel`: http://qt-project.org/doc/qt-4.8/qdrawutil-h.html. You'll see that you have to pass a QPalette instance which contains groups of colors. – c_k Feb 26 '13 at 16:24