0

So I have 1 ScrollArea and I have set the stylesheet to be:

QScrollBar { 
    background-color: rgb(29, 29, 29);
    border: 1px Solid white;
    border-radius: 5px;
    margin-right: 4px;
    margin-top: 4px;
    margin-bottom: 4px; 

}
QScrollBar::handle {
    background: white;
    min-height: 0px;
    border: 1px solid white;
    border-radius: 4px;
}

QScrollBar::add-line {
    background: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop: 0 rgb(32, 47, 130), stop: 0.5 rgb(32, 47, 130),  stop:1 rgb(32, 47, 130));
    height: 0px;
    subcontrol-position: bottom;
    subcontrol-origin: margin;
}
QScrollBar::sub-line {
    background: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop: 0  rgb(32, 47, 130), stop: 0.5 rgb(32, 47, 130),  stop:1 rgb(32, 47, 130));
    height: 0 px;
    subcontrol-position: top;
    subcontrol-origin: margin;
}

And when I run the application, the styling doesn't apply. I have tried to edit the margins to 0px and that still doesn't work. It just reverts back to the default styling.

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
Tom Butcher
  • 29
  • 11
  • How do you establish the stylesheet? If you want help, you must provide a [mcve] – eyllanesc Aug 13 '18 at 17:05
  • @eyllanesc via the Qt Designer. I simply right clicked the scrollArea and clicked change style sheet. then I entered the code above. – Tom Butcher Aug 13 '18 at 17:52
  • I've created a new project, added a QScrollArea, set the stylesheet you've provided and the scroll bars look different than the default ones. So this is working and the mistake is somewhere else. Add more info about your project as @eyllanesc have said. – scopchanov Aug 14 '18 at 12:19

0 Answers0