0

所以我有 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,但仍然无法正常工作。它只是恢复到默认样式。

4

0 回答 0