diff options
Diffstat (limited to 'examples/declarative/listview')
-rw-r--r-- | examples/declarative/listview/dynamic.qml | 15 | ||||
-rw-r--r-- | examples/declarative/listview/highlight.qml | 1 | ||||
-rw-r--r-- | examples/declarative/listview/listview-example.qml | 16 |
3 files changed, 21 insertions, 11 deletions
diff --git a/examples/declarative/listview/dynamic.qml b/examples/declarative/listview/dynamic.qml index efd0e10..236a9c5 100644 --- a/examples/declarative/listview/dynamic.qml +++ b/examples/declarative/listview/dynamic.qml @@ -3,6 +3,7 @@ import "content" import "../scrollbar" Rectangle { + id: container width: 640; height: 480 color: "#343434" @@ -54,7 +55,7 @@ Rectangle { id: fruitDelegate Item { - width: parent.width; height: 55 + width: container.width; height: 55 Column { id: moveButtons @@ -174,9 +175,9 @@ Rectangle { anchors.fill: parent onClicked: { fruitModel.append({ - "name":"Pizza Margarita", - "cost":5.95, - "attributes":[{"description": "Cheese"},{"description": "Tomato"}] + "name": "Pizza Margarita", + "cost": 5.95, + "attributes": [{"description": "Cheese"},{"description": "Tomato"}] }) } } @@ -189,9 +190,9 @@ Rectangle { anchors.fill: parent; onClicked: { fruitModel.insert(0, { - "name":"Pizza Supreme", - "cost":9.95, - "attributes":[{"description": "Cheese"},{"description": "Tomato"},{"description": "The Works"}] + "name": "Pizza Supreme", + "cost": 9.95, + "attributes": [{"description": "Cheese"},{"description": "Tomato"},{"description": "The Works"}] }) } } diff --git a/examples/declarative/listview/highlight.qml b/examples/declarative/listview/highlight.qml index 2f7f2ca..50ba2f7 100644 --- a/examples/declarative/listview/highlight.qml +++ b/examples/declarative/listview/highlight.qml @@ -43,6 +43,7 @@ Rectangle { SpringFollow on y { to: list1.currentItem.y; spring: 3; damping: 0.1 } } } + ListView { id: list1 width: 200; height: parent.height diff --git a/examples/declarative/listview/listview-example.qml b/examples/declarative/listview/listview-example.qml index 9409356..6feedf6 100644 --- a/examples/declarative/listview/listview-example.qml +++ b/examples/declarative/listview/listview-example.qml @@ -58,25 +58,33 @@ Rectangle { ListView { id: list1 width: 200; height: parent.height - model: MyPetsModel; delegate: petDelegate + model: MyPetsModel + delegate: petDelegate + highlight: petHighlight currentIndex: list3.currentIndex focus: true } + ListView { id: list2 x: 200; width: 200; height: parent.height - model: MyPetsModel; delegate: petDelegate + model: MyPetsModel + delegate: petDelegate + highlight: petHighlight currentIndex: list1.currentIndex preferredHighlightBegin: 80; preferredHighlightEnd: 220 highlightRangeMode: "ApplyRange" } + ListView { id: list3 x: 400; width: 200; height: parent.height - model: MyPetsModel; delegate: petDelegate - highlight: petHighlight + model: MyPetsModel + delegate: petDelegate + + highlight: Rectangle { color: "lightsteelblue" } currentIndex: list1.currentIndex preferredHighlightBegin: 125; preferredHighlightEnd: 125 highlightRangeMode: "StrictlyEnforceRange" |