aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquicklistview/data/attachedProperties.qml
blob: 72fdc009e09951865fd06b94c8b5ffe3445c8ee2 (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
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

import QtQuick 2.0

ListView {
  width: 100
  height: 100

  Component.onCompleted: currentIndex = 0

  model: ListModel {
    ListElement {
      name: "A"
    }
    ListElement {
      name: "B"
    }
  }

  delegate: Text {
    width: ListView.view.width
    text: model.name
  }

  header: Rectangle {
    width: ListView.view.width
  }

  footer: Rectangle {
    width: ListView.view.width
  }

  highlight: Rectangle {
    width: ListView.view.width
  }

  section.property: "name"
  section.criteria: ViewSection.FirstCharacter
  section.delegate: Rectangle {
    objectName: "sectionItem"
    width: ListView.view.width
  }

}