You could apply a default stylesheet and monitor the range change and value change slots and apply a different stylesheet when the mid-value is reached. The important parts of the style sheet might look like this:
QSlider::add-page
:vertical
{ background
: blue;
} QSlider::sub-page
:vertical
{ background
: blue;
}
QSlider::add-page:vertical { background: blue; }
QSlider::sub-page:vertical { background: blue; }
To copy to clipboard, switch view to plain text mode
when off-centre, and this when centred (probably with some tolerance around centre):
QSlider::add-page
:vertical
{ background
: grey;
} QSlider::sub-page
:vertical
{ background
: grey;
}
QSlider::add-page:vertical { background: grey; }
QSlider::sub-page:vertical { background: grey; }
To copy to clipboard, switch view to plain text mode
You would probably want to style the rest of the slider; see https://doc.qt.io/qt-5/stylesheet-ex...ing-qscrollbar
You need to reapply the entire stylesheet each time.
Bookmarks