用Flickable和ScrollBar显示滚动条

import QtQuick 2.0
import QtQuick.Controls 2.15
Rectangle{
color: “red”
Flickable {
anchors.fill: parent
contentHeight: parent.height*2
contentWidth: parent.width
clip: true
boundsBehavior:Flickable.StopAtBounds
ScrollBar.vertical: ScrollBar {
anchors.top: parent.top
anchors.topMargin: -1
anchors.right: parent.right
width: 30
height:parent.height
}
}
}
在这里插入图片描述

你可能感兴趣的:(QT,qt)