I am trying to design a QSlider where I need to vary the height of the slider handle based on certain parameters. This is what I have so far:

Qt Code:
  1. QSlider *fScrollbar = new QSlider(this);
  2. fScrollbar->setGeometry(280,5,10,400);
  3. fScrollbar->setMinimum(5);
  4. fScrollbar->setMaximum(50);
  5. fScrollbar->setTracking(true);
  6. fScrollbar->setStyleSheet("QSlider::handle:vertical { width: 190px; background: black; }");
To copy to clipboard, switch view to plain text mode 

This is not working as expected, the handle still defaults to a small height which is not changing. This is what which is appearing:

slider.jpg

How do I make it work?