FluentUI/Gallery/res/qml/screen/PointIconListScreen.qml
yxdy a44db97aa3
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
init
2025-02-12 10:31:20 +08:00

97 lines
2.7 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: "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: "icon_car.png"
title: "车辆"
image: "qrc:/qt/qml/Gallery/res/image/icons/icon_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"
}
}
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()
}
}
}
}
}
}