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

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;"
"}"
);
Styling scroll bars (and complex widgets in general) requires some patience and proper studying of the documentation and the examples.
Most importantly, complex widgets have a fundamental requirement, as explained in the documentation:
The most important issue with your attempt is that you didn't leave space for the buttons and did not set any stylesheet for them.
The space for the button is set by using proper margins (top and bottom for vertical scroll bars).
The arrow buttons can be styled using images, but for simple triangle shapes a smart CSS trick can be used: use borders.
The idea is to have an 0-sized object with borders around it; since only the borders are visible, the result is a rectangle composed of triangles, and the border width is actually the height of each triangle (the distance between the side and the center):
Then you only draw the border that is opposed to the arrow direction; if you want to show an up arrow, draw the bottom border with a different color:
Note tat in order to properly place those arrows without unnecessary margin (like the top "border" of the up arrow), some adjustments must be done using
toporbottomproperties.Finally, if you need the dot-pattern background, that has to be done through an image (a simple 2x2 image will suffice).
Here is the resulting stylesheet:
And here is the result:
Zoomed in to see more details: