-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdiary.qml
80 lines (69 loc) · 1.98 KB
/
diary.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import QtQuick 2.0
Rectangle {
color: "black"
GridView {
id: gridView
anchors.fill: parent
anchors.topMargin: 100
anchors.leftMargin: 50
anchors.rightMargin: 50
cellWidth: 150
cellHeight: 200
model: ListModel {
ListElement {
name: "2019/7/5"
portrait: "images/img_diary1.jpg"
}
ListElement {
name: "2019/7/6"
portrait: "images/img_diary2.jpg"
}
ListElement {
name: "2019/7/7"
portrait: "images/img_diary3.jpg"
}
ListElement {
name: "2019/7/8"
portrait: "images/img_diary4.jpg"
}
ListElement {
name: "2019/7/9"
portrait: "images/img_diary5.jpg"
}
ListElement {
name: "2019/7/10"
portrait: "images/img_diary6.jpg"
}
ListElement {
name: "2019/7/11"
portrait: "images/img_diary7.jpg"
}
}
delegate: Rectangle{
color: touchArea.pressed ? Qt.rgba(100/255, 100/255, 100/255, 100/255) : "transparent"
width: 150
height: 200
radius: 5
MouseArea{
id: touchArea
anchors.fill: parent
}
Column {
id: itemCol
spacing: 10
anchors.centerIn: parent
Image {
source: portrait
height: 150
fillMode: Image.PreserveAspectFit
anchors.horizontalCenter: parent.horizontalCenter
}
Text {
text: name;
color: "white"
anchors.horizontalCenter: parent.horizontalCenter
}
}
}
}
}