我想创建一个自定义滚动条。像这样。
这是我的代码,我想在Qml中使用滚动条组件。
Rectangle {
id: frame
clip: true
width: 160
height: 160
border.color: "black"
anchors.centerIn: parent
Text {
id: content
text: "ABC"
font.pixelSize: 160
x: -hbar.position * width
y: -vbar.position * height
}
ScrollBar {
id: vbar
hoverEnabled: true
active: hovered || pressed
orientation: Qt.Vertical
size: frame.height / content.height
anchors.top: parent.top
anchors.right: parent.right
anchors.bottom: parent.bottom
}
}
在我的情况下,我想用
我的滚动条图像
。
我试过了
来源:“/巴bng”
,但它说滚动条没有参数“source”。如何使用自定义图像。