import QtQuick 2.10
import QtQuick.Window 2.10
Window {
visible: true
width: 480
height: 640
title: qsTr("后天八卦图")
Text {
anchors.topMargin: 10
anchors.top: parent.top
anchors.horizontalCenter: parent.horizontalCenter
text: "后天八卦图"
font.pointSize: 36
}
PathView {
width: 360
height: 360
anchors.centerIn: parent
model: ListModel {
ListElement { value: "001"; caption: "震 三"}
ListElement { value: "110"; caption: "巽 四"}
ListElement { value: "101"; caption: "离 九"}
ListElement { value: "000"; caption: "坤 二"}
ListElement { value: "011"; caption: "兑 七"}
ListElement { value: "111"; caption: "乾 六"}
ListElement { value: "010"; caption: "坎 一"}
ListElement { value: "100"; caption: "艮 八"}
}
delegate: Rectangle {
width: 60
height: 90
Column {
width: parent.width
height: parent.height - 30
spacing: 5
Repeater {
model: 3
Rectangle {
width: parent.width
height: (parent.height - 10) / 3
color: value.slice(index,index + 1)==="1"?"red":"black"
Rectangle {
width: parent.width / 5
height: parent.height
anchors.centerIn: parent
visible: value.slice(index,index + 1)==="0"
}
}
}
}
Text {
font.bold: true
font.pointSize: 16
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
color: "black"
text: caption
}
}
path: Path {
startX: 0
startY: 180
PathArc {
x: 360
y: 180
radiusX: 180
radiusY: 180
}
PathArc {
x: 0
y: 180
radiusX: 180
radiusY: 180
}
}
}
}