aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual/qml/testfiles_quick2/listview.qml
blob: e95bdbdd3abad1b3414666953b308b181ac67c04 (plain)
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
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0

import QtQuick 2.0

Item {
    width: 200
    height: 100

    ListView {
        anchors.fill: parent;
        model:  ListModel {
            ListElement {
                name: "BMW"
                speed: 200
            }
            ListElement {
                name: "Mercedes"
                speed: 180
            }
            ListElement {
                name: "Audi"
                speed: 190
            }
            ListElement {
                name: "VW"
                speed: 180
            }
        }


        delegate:  Item {
            height:  40
            Row {
                spacing: 10
                Text {
                    text: name;
                    font.bold: true
                }

                Text { text: "speed: " + speed }
            }


        }
    }
}