0
votes

i am in Qt5.7 and changed my scrollbar style sheet by this code:

QScrollBar::sub-page:horizonta,QScrollBar::add-page:horizontall {
background: rgb(45, 45, 45);
border:none;
}

QScrollBar{    selection-color: rgb(255, 0, 0);
background-color:rgb(24, 24, 24);
border:none;
}

and the result is : enter image description here

the question is how to change the slider's border COLOR?(the white border that pointed in the picture) )

1
What do you mean by "change"? Size, color, style...?jpo38
There are typos in your stylesheet - e.g. :: is incorrect, as is horizonta and horizontall.Kuba hasn't forgotten Monica
i want to change color (as i said in edited post)javad

1 Answers

0
votes

You can try with handle, sub-page, add-page, add-line, sub-line values in the sample below the border looks with different colors:

QScrollBar{
    background: rgb(45, 45, 45);
    background-color:rgb(24, 24, 24);
    margin: 0;
}   

QScrollBar::handle:horizonal{
    border: 2px solid red;
}

QScrollBar::sub-page:horizontal{
    border: 2px solid blue;
}

QScrollBar::add-page:horizontall {
    border: 2px solid green;
}

QScrollBar::add-line:horizontal {
    border: 2px solid yellow;
}

QScrollBar::sub-line:horizontal{
    border: 2px solid white;
}

Also this link: https://forum.qt.io/topic/59351/qscrollbar-hiding-add-line-and-sub-line-when-moved was useful for me