如何正确更改QSlider的元素

问题描述 投票:0回答:1

enter image description here

这是样式表:

QSlider{
    border: 0px solid;
}
QSlider::handle:horizontal#slider_xScaling{
    image: url(":/tools/references/dragger.png")no-repeat scroll 0 0;;
}
QSlider::add-page:horizontal#slider_xScaling{
    image:  url(":/info/references/ic-scroll-layer-track.png")no-repeat scroll 0 0;
}
QSlider::sub-page:horizontal {
    background: transparent url(":/tools/references/ic-track-fill.png") no-repeat scroll 0 0;
    margin-top: -1px;
}

我已经在QT上的CSS样式表上进行了实验,但仍无法为此提供适当的输出。显然该音轨应该在中间,但它在这里。

qt qtstylesheets
1个回答
1
投票

这是我解决的方法。我还更改了QSlider的高度,以使跟踪器与手柄对齐。

QSlider::sub-page:horizontal {
    background: transparent url(":/tools/references/ic-track-fill.png") no-repeat scroll 0 0;
}
QSlider::handle:horizontal{
    image: url(":/tools/references/dragger.png")no-repeat scroll 0 0;
}
QSlider{
    border:0px solid;
}
© www.soinside.com 2019 - 2024. All rights reserved.