QML学习
main.qml
import QtQuick 2.15
import QtQuick.Window 2.15Window {width: 640height: 480visible: truetitle: qsTr("Hello World")color: "black"PathView {id: pathViewanchors.fill: parentmodel: ListModel {ListElement { content: "PathView"; color: "red" }ListElement { content: "放假当宅宅"; color: "green" }ListElement { content: "关注"; color: "yellow" }ListElement { content: "点赞"; color: "blue" }ListElement { content: "投币"; color: "coral" }ListElement { content: "收藏"; color: "blueviolet" }}delegate: Rectangle {width: pathView.width * 0.5height: pathView.height * 0.5color: model.coloropacity: PathView.itemOpacityz: PathView.itemZText {anchors.centerIn: parentfont.pointSize: 30text: model.content}}path: Path {startX: pathView.width / 2startY: pathView.height / 3 * 2PathAttribute {name: "itemOpacity"value: 1.0}PathAttribute {name: "itemZ"value: 10}PathCubic {x: pathView.width / 2y: pathView.height / 3control1X: pathView.widthcontrol1Y: ycontrol2X: pathView.widthcontrol2Y: pathView.height / 3 * 2}PathAttribute {name: "itemOpacity"value: 0}PathAttribute {name: "itemZ"value: 0}PathCubic {x: pathView.width / 2y: pathView.height / 3 * 2control1X: 0control1Y: ycontrol2X: 0control2Y: pathView.height / 3}PathAttribute {name: "itemOpacity"value: 1}PathAttribute {name: "itemZ"value: 10}}}
}
演示