FluentUI/Gallery/res/qml/screen/PointIconListScreen.qml
yxdy 8d68f26b15
Some checks failed
Gallery App Build / Windows (push) Has been cancelled
Gallery App Build / macOS (push) Has been cancelled
Gallery App Build / Ubuntu (push) Has been cancelled
feat: 添加功能
2025-02-15 18:06:24 +08:00

107 lines
3.0 KiB
QML

import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import FluentUI.Controls
import FluentUI.impl
Item {
id: control
anchors.fill: parent
Connections{
target: window
function onInit(arg){
console.log("初始化。。。")
}
}
ListModel{
id: point_model
ListElement{
key: "mime.png"
title: "煤矿"
image: "qrc:/qt/qml/Gallery/res/image/icons/mime.png"
}
ListElement{
key: "dry.png"
title: "陆港"
image: "qrc:/qt/qml/Gallery/res/image/icons/dry.png"
}
ListElement{
key: "dw.png"
title: "点位"
image: "qrc:/qt/qml/Gallery/res/image/icons/dw.png"
}
ListElement{
key: "fwq.png"
title: "服务区"
image: "qrc:/qt/qml/Gallery/res/image/icons/fwq.png"
}
ListElement{
key: "car.png"
title: "车辆"
image: "qrc:/qt/qml/Gallery/res/image/icons/car.png"
}
ListElement{
key: "sf.png"
title: "收费站"
image: "qrc:/qt/qml/Gallery/res/image/icons/sf.png"
}
ListElement{
key: "u.png"
title: "U型路口"
image: "qrc:/qt/qml/Gallery/res/image/icons/u.png"
}
ListElement{
key: "gc.png"
title: "发电厂"
image: "qrc:/qt/qml/Gallery/res/image/icons/gc.png"
}
}
GridView{
anchors.fill: parent
anchors.topMargin: 20
id: grid_view
cellWidth: 115
cellHeight: 110
clip: true
model: point_model
delegate: Item {
width: 120
height: 100
Rectangle{
id:item_icon
anchors.fill: parent
color: "#000"
anchors.leftMargin: 20
Column{
anchors.fill: parent
anchors.topMargin: 20
Image {
source: model.image
anchors.horizontalCenter: parent.horizontalCenter
width: 40
height: 40
}
Text {
text: model.title
anchors.horizontalCenter: parent.horizontalCenter
color: "#fff"
}
}
MouseArea {
anchors.fill: parent
hoverEnabled: true
onEntered: parent.color = "#292929"
onExited: parent.color = "#000000"
onClicked: {
window.setResult(model)
window.close()
}
}
}
}
}
}