How to customize a QScrollBar
07:06 06 Jan 2024

This image shows the kind of scrollbar I want in my Qt application:

Wanted result

And this is my attempt, which isn't close to the requirement:

QString sbStyle = QString(
    "QScrollBar:vertical {"
    "border: none;"
    "background: #111;"
    "width: 10px;"
    "}"
    "QScrollBar::handle:vertical {"
    "background: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:0 #ddd, stop:1 #111);"
    "min-height: 10px;"
    "}"
    "QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical {"
    "border: none;"
    "background: #111;"
    "}"
);
qt qtstylesheets qscrollbar