summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/declarative/listview
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src/snippets/declarative/listview')
-rw-r--r--doc/src/snippets/declarative/listview/highlight.qml14
-rw-r--r--doc/src/snippets/declarative/listview/listview.qml12
2 files changed, 13 insertions, 13 deletions
diff --git a/doc/src/snippets/declarative/listview/highlight.qml b/doc/src/snippets/declarative/listview/highlight.qml
index 97eac45..2234ee7 100644
--- a/doc/src/snippets/declarative/listview/highlight.qml
+++ b/doc/src/snippets/declarative/listview/highlight.qml
@@ -11,9 +11,9 @@ Rectangle {
// instantiated for each visible item in the list.
//! [0]
Component {
- id: Delegate
+ id: delegate
Item {
- id: Wrapper
+ id: wrapper
width: 180; height: 40
Column {
x: 5; y: 5
@@ -28,22 +28,22 @@ Rectangle {
// highlight moves to the current item.
//! [1]
Component {
- id: Highlight
+ id: highlight
Rectangle {
width: 180; height: 40
color: "lightsteelblue"; radius: 5
y: SpringFollow {
- source: List.currentItem.y
+ source: list.currentItem.y
spring: 3
damping: 0.2
}
}
}
ListView {
- id: List
+ id: list
width: parent.height; height: parent.height
- model: ContactModel; delegate: Delegate
- highlight: Highlight
+ model: ContactModel; delegate: delegate
+ highlight: highlight
highlightFollowsCurrentItem: false
focus: true
}
diff --git a/doc/src/snippets/declarative/listview/listview.qml b/doc/src/snippets/declarative/listview/listview.qml
index c907077..be0f3ad 100644
--- a/doc/src/snippets/declarative/listview/listview.qml
+++ b/doc/src/snippets/declarative/listview/listview.qml
@@ -12,11 +12,11 @@ Rectangle {
// instantiated for each visible item in the list.
//! [0]
Component {
- id: Delegate
+ id: delegate
Item {
- id: Wrapper
+ id: wrapper
width: 180; height: 40
- VerticalLayout {
+ Column {
x: 5; y: 5
Text { text: '<b>Name:</b> ' + name }
Text { text: '<b>Number:</b> ' + number }
@@ -28,7 +28,7 @@ Rectangle {
// by each ListView and placed behind the current item.
//! [1]
Component {
- id: Highlight
+ id: highlight
Rectangle {
color: "lightsteelblue"
radius: 5
@@ -40,8 +40,8 @@ Rectangle {
ListView {
width: parent.width; height: parent.height
model: ContactModel
- delegate: Delegate
- highlight: Highlight
+ delegate: delegate
+ highlight: highlight
focus: true
}
//! [2]