Hi,
I Am trying to set colour for half of slider which is vertical,but I Am not able to do.
Can you please suggest how to do????
Thanks in Advance......
Printable View
Hi,
I Am trying to set colour for half of slider which is vertical,but I Am not able to do.
Can you please suggest how to do????
Thanks in Advance......
You mean something like a red upper half and a green lower half?
Exactly....but I want to set only lowerhalf with red colour....
You can fake it with the border image:
with a file bg.png that is an 18x18 pixel square with a transparent upper half, and coloured lower half.Code:
#include <QApplication> #include <QSlider> int main(int argc, char **argv) { slider.resize(40, 300); slider.setStyleSheet(" QSlider { border-image: url('bg.png') 0 0 0 0 stretch stretch; } " ); slider.show(); return app.exec(); }
Attachment 11799