diff options
author | Bea Lam <bea.lam@nokia.com> | 2010-04-13 06:04:40 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2010-04-13 06:07:19 (GMT) |
commit | 38ddecfd87399ed92729f122d940cce812c44ec2 (patch) | |
tree | d52395429119e8e38b8624682f0da1018fe4e527 /examples/declarative/listview | |
parent | a34993a9d8d1b9b3f3ad30604dbad3ad456bbdcd (diff) | |
download | Qt-38ddecfd87399ed92729f122d940cce812c44ec2.zip Qt-38ddecfd87399ed92729f122d940cce812c44ec2.tar.gz Qt-38ddecfd87399ed92729f122d940cce812c44ec2.tar.bz2 |
Example fixes
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" |