Qt滚动区域滚动条不应用样式

时间:2018-08-13 16:33:00

标签: qt qt-designer qscrollarea qstylesheet

所以我有1个ScrollArea,并将样式表设置为:

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;
}

当我运行应用程序时,样式不适用。我试图将页边距编辑为0px,但这仍然行不通。它只是恢复为默认样式。

0 个答案:

没有答案