You can fake it with the border image:
#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();
}
#include <QApplication>
#include <QSlider>
int main(int argc, char **argv)
{
QApplication app(argc, argv);
QSlider slider(Qt::Vertical);
slider.resize(40, 300);
slider.setStyleSheet(" QSlider { border-image: url('bg.png') 0 0 0 0 stretch stretch; } " );
slider.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
with a file bg.png that is an 18x18 pixel square with a transparent upper half, and coloured lower half.
bg.png
Bookmarks