90 lines
2.3 KiB
QML
90 lines
2.3 KiB
QML
import QtQuick
|
|
import QtQuick.Controls
|
|
import QtQuick.Layouts
|
|
import "./common"
|
|
Item {
|
|
id: self
|
|
ListModel{
|
|
id: model
|
|
ListElement{
|
|
name: "存储板"
|
|
src: "./resource/1.png"
|
|
taskId: "1"
|
|
|
|
}
|
|
ListElement{
|
|
name: "驱动板"
|
|
src: "./resource/2.png"
|
|
taskId: "2"
|
|
}
|
|
ListElement{
|
|
name: "接口板"
|
|
src: "./resource/3.png"
|
|
taskId: "3"
|
|
}
|
|
ListElement{
|
|
name: "控制板"
|
|
src: "./resource/4.png"
|
|
taskId: "4"
|
|
}
|
|
ListElement{
|
|
name: "电容板"
|
|
src: "./resource/5.png"
|
|
taskId: "5"
|
|
}
|
|
}
|
|
Column {
|
|
anchors.centerIn: parent
|
|
spacing: 20
|
|
Repeater{
|
|
model: model
|
|
Rectangle {
|
|
id: rectBtn
|
|
width: 750; height: 120
|
|
radius: 9
|
|
Behavior on scale{
|
|
NumberAnimation{
|
|
duration: 100
|
|
}
|
|
}
|
|
|
|
Row{
|
|
spacing: 10
|
|
anchors.centerIn: parent
|
|
Item{
|
|
id: textItem
|
|
width: 100; height: 100
|
|
Label{
|
|
text: name
|
|
font.pixelSize: 28
|
|
anchors.centerIn: parent
|
|
}
|
|
}
|
|
Image{
|
|
anchors.verticalCenter: textItem.verticalCenter
|
|
source: src
|
|
width: 572
|
|
height: 79
|
|
}
|
|
}
|
|
MouseArea{
|
|
anchors.fill: parent
|
|
hoverEnabled: true
|
|
onClicked: {
|
|
testDetail.taskId = taskId
|
|
testDetail.taskSrc = src
|
|
testDetail.taskName = name
|
|
testDetail.show()
|
|
}
|
|
onEntered:{
|
|
rectBtn.scale = 1.05
|
|
}
|
|
onExited: {
|
|
rectBtn.scale = 1
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|