-
Notifications
You must be signed in to change notification settings - Fork 1
/
view.qml
51 lines (41 loc) · 1.06 KB
/
view.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
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial
import QtQuick 2.12
import QtQuick.Controls 2.12
Page {
width: 640
height: 480
id: mainPage
Rectangle {
id: itemDisplay
width: parent.width/2
height:parent.height/2
border.color: "red"
}
ListModel {
id: nameModel
ListElement { name: "Pa"; value: 6 ; delegateColor: "blue" }
ListElement { name: "Pm"; value: 5 ; delegateColor: "green" }
}
Component {
id: nameDelegate
Text {
text: name+' : '+value;
font.pixelSize: mainPage.height/25
color: delegateColor
height: mainPage.height/10
}
}
ListView {
width: parent.width/2
height: parent.height/10
orientation: ListView.Horizontal
anchors.right: parent.right
anchors.top: parent.top
anchors.left: itemDisplay.right
spacing: 30
clip: true
model: nameModel
delegate: nameDelegate
}
}