2023-12-06 13:07:35 +00:00
|
|
|
// 割圆的例子
|
2023-02-21 05:44:24 +00:00
|
|
|
import QtQuick
|
2023-12-06 13:07:35 +00:00
|
|
|
import QtQuick.Layouts
|
|
|
|
import Fk.RoomElement
|
2023-02-21 05:44:24 +00:00
|
|
|
|
2023-12-06 13:07:35 +00:00
|
|
|
ColumnLayout {
|
2023-02-21 05:44:24 +00:00
|
|
|
id: root
|
2023-12-06 13:07:35 +00:00
|
|
|
anchors.fill: parent
|
|
|
|
property var extra_data: ({ name: "", data: {
|
|
|
|
all: [1, 2, 4, 6],
|
|
|
|
ok: [1, 4],
|
|
|
|
} })
|
|
|
|
signal finish()
|
2023-02-21 05:44:24 +00:00
|
|
|
|
2023-12-06 13:07:35 +00:00
|
|
|
BigGlowText {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.preferredHeight: childrenRect.height + 4
|
2023-02-21 05:44:24 +00:00
|
|
|
|
2024-01-24 19:23:29 +00:00
|
|
|
text: luatr(extra_data.name)
|
2023-12-06 13:07:35 +00:00
|
|
|
}
|
2023-02-21 05:44:24 +00:00
|
|
|
|
2023-12-06 13:07:35 +00:00
|
|
|
PathView {
|
|
|
|
id: pathView
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
model: extra_data.data.all
|
|
|
|
delegate: Rectangle{
|
|
|
|
width: 42; height: 42
|
|
|
|
color: extra_data.data.ok.includes(modelData) ? "yellow" : "#CCEEEEEE"
|
|
|
|
radius: 2
|
|
|
|
Text {
|
|
|
|
anchors.centerIn: parent
|
|
|
|
text: modelData
|
|
|
|
font.pixelSize: 24
|
|
|
|
}
|
|
|
|
}
|
|
|
|
path: Path {
|
|
|
|
// 默认横屏了,应该没人用竖屏玩这游戏
|
|
|
|
startX: pathView.width / 2
|
|
|
|
startY: 40
|
|
|
|
PathArc {
|
|
|
|
x: pathView.width / 2
|
|
|
|
y: pathView.height - 40
|
|
|
|
radiusX: (pathView.height - 80) / 2
|
|
|
|
radiusY: (pathView.height - 80) / 2
|
|
|
|
direction: PathArc.Clockwise
|
|
|
|
}
|
|
|
|
PathArc {
|
|
|
|
x: pathView.width / 2
|
|
|
|
y: 40
|
|
|
|
radiusX: (pathView.height - 80) / 2
|
|
|
|
radiusY: (pathView.height - 80) / 2
|
|
|
|
direction: PathArc.Clockwise
|
2023-02-21 05:44:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|