[英]How can i setStyleSheet in QML?(only QML no C++)
我想创建一个自定义滚动条。
这是我的代码,我想在Qml中使用ScrollBar组件。
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
}
}
就我而言,我想用Scrollbar image创建。
我尝试了“ source:“ ./bar.bng” ”,但是它说ScrollBar没有参数“ source”。 我如何使用自定义图像。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.