Cupidvogel
25th October 2015, 09:50
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:
QSlider *fScrollbar = new QSlider(this);
fScrollbar->setGeometry(280,5,10,400);
fScrollbar->setMinimum(5);
fScrollbar->setMaximum(50);
fScrollbar->setTracking(true);
fScrollbar->setStyleSheet("QSlider::handle:vertical { width: 190px; background: black; }");
This is not working as expected, the handle still defaults to a small height which is not changing. This is what which is appearing:
11470
How do I make it work?
QSlider *fScrollbar = new QSlider(this);
fScrollbar->setGeometry(280,5,10,400);
fScrollbar->setMinimum(5);
fScrollbar->setMaximum(50);
fScrollbar->setTracking(true);
fScrollbar->setStyleSheet("QSlider::handle:vertical { width: 190px; background: black; }");
This is not working as expected, the handle still defaults to a small height which is not changing. This is what which is appearing:
11470
How do I make it work?