ScrollBar not working in scrollview.
Unsolved
General and Desktop
-
I'm new to qml and most of my code consists of examples from official documentation and online examples. I've created a scrollview in which there is a rectangle with column and in the column there are multiple buttons. I tried inplementing a scrollbar because the content will be bigger than the container , but the scrollbar does not work any help would be appreciated.
My code is as follow:import QtQuick 2.15 import QtQuick.Window 2.15 import QtQuick.Controls 2.15 import QtGraphicalEffects 1.15 Window { width: 740 height: 580 visible: true color: "#00000000" title: qsTr("Hello World") Rectangle { id: rectangle color: "#40405f" anchors.fill: parent Button { id: button text: qsTr("Menu") anchors.left: parent.left anchors.top: parent.top anchors.bottom: parent.bottom anchors.leftMargin: 10 anchors.bottomMargin: 466 anchors.topMargin: 74 onClicked: animationMenu.running = true } ScrollView { id: scrollView width: 0 anchors.left: button.right anchors.top: parent.top anchors.bottom: parent.bottom anchors.leftMargin: 10 anchors.bottomMargin: 10 anchors.topMargin: 10 clip: true Rectangle { id: rectangle1 color: "#00000000" border.color: "#00000000" border.width: 0 anchors.fill: parent PropertyAnimation { id: animationMenu target: scrollView property: "width" to: if(scrollView.width == 0) return 240; else return 0 duration: 800 easing.type: Easing.InOutQuint } Column { id: columnMenu width: 0 anchors.fill: parent spacing: 10 Button { id: button1 text: qsTr("Button") } Button { id: button2 text: qsTr("Button") } Button { id: button3 text: qsTr("Button") } Button { id: button4 text: qsTr("Button") } } } ScrollBar { id: vbar hoverEnabled: true orientation: Qt.Vertical size: scrollView.height / rectangle1.height anchors.top: parent.top anchors.right: parent.right anchors.bottom: parent.bottom wheelEnabled: true pressed: true active: true } } } }