import QtQuick import QtQuick.Controls as QtC import QtQuick.Layouts Window { width: 640 height: 480 visible: true title: qsTr("Hello World") GridLayout { columns: 3 height: 40 width: parent.width Text { Layout.fillWidth: true text: "SmoothedAnimation" } Text { Layout.fillWidth: true text: "SpringAnimation" } Text { Layout.fillWidth: true text: "Source Slider" } } GridLayout { columns: 3 anchors.fill: parent anchors.topMargin: 40 Item { Layout.fillWidth: true Layout.fillHeight: true Rectangle { color: "grey" width: 5 height: parent.height } Rectangle { width: 11 height: 11 color: "red" y: slider.height - slider.value Behavior on y { SmoothedAnimation { duration: 500; velocity: -1 } } } } Item { Layout.fillWidth: true Layout.fillHeight: true Rectangle { color: "grey" width: 5 height: parent.height } Rectangle { width: 11 height: 11 color: "red" y: slider.height - slider.value Behavior on y { SpringAnimation { mass: 10; spring: 2; damping: 2 } } } } Item { Layout.fillWidth: true Layout.fillHeight: true QtC.Slider { id: slider orientation: Qt.Vertical from: 0 to: height anchors.fill: parent } } } }