-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.qml
51 lines (44 loc) · 1.47 KB
/
main.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
import QtQuick 2.12
import QtQuick.Window 2.12
Window {
visible: true
width: 640
height: 480
title: qsTr("Hello World")
ListModel {
id: fruitModel
ListElement { name: QT_TR_NOOP("Grapes"); icon: "1f347" }
ListElement { name: QT_TR_NOOP("Melon"); icon: "1f348" }
ListElement { name: QT_TR_NOOP("Watermelon"); icon: "1f349" }
ListElement { name: QT_TR_NOOP("Tangerine"); icon: "1f34a" }
ListElement { name: QT_TR_NOOP("Lemon"); icon: "1f34b" }
ListElement { name: QT_TR_NOOP("Banana"); icon: "1f34c" }
ListElement { name: QT_TR_NOOP("Pinapple"); icon: "1f34d" }
ListElement { name: QT_TR_NOOP("Red apple"); icon: "1f34e" }
ListElement { name: QT_TR_NOOP("Green apple"); icon: "1f34f" }
}
ListView {
anchors.fill: parent
anchors.margins: 10
model: fruitModel
delegate: Item {
height: 82
width: ListView.view.widht
Row {
spacing: 20
Image {
source: "https://github.com/twitter/twemoji/raw/master/assets/72x72/" + icon + ".png"
width: 72
height: 72
}
Text {
text: qsTr(name)
height: 72
verticalAlignment: Text.AlignVCenter
font.bold: true
font.pixelSize: 30
}
}
}
}
}