QML ListView滚动条自定义

环境Qt5.12

核心代码

ListView {
                    id: listView
                    focus: true
                    anchors.fill: parent
                    contentWidth: parent.width-30
                    clip: true
                    delegate: RadioDelegate{
                    }
                    model: importDataModel
                    ScrollBar.vertical: ScrollBar {
                        width:25
                        height:  parent.height
                        anchors.right:parent.right
                        // 滚动
                        position:  parent.visibleArea.yPosition
                        active: true
                    }

}

猜你喜欢

转载自blog.csdn.net/alongsxmx/article/details/86676551