diff options
author | Bea Lam <bea.lam@nokia.com> | 2010-05-14 01:32:57 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2010-05-16 23:42:12 (GMT) |
commit | 82d0b03c4f81c2832975d548917c03dbaddeee72 (patch) | |
tree | cb2d7ae0c7c8c5870f4c9439453c938a9423afad /examples/declarative/listview/highlight.qml | |
parent | 0aca20bf669ef7e7702ee96d0d0676392cfd1b72 (diff) | |
download | Qt-82d0b03c4f81c2832975d548917c03dbaddeee72.zip Qt-82d0b03c4f81c2832975d548917c03dbaddeee72.tar.gz Qt-82d0b03c4f81c2832975d548917c03dbaddeee72.tar.bz2 |
Restructure the examples. They are now organized into various
subdirectories to make it easier to locate examples for certain
features (e.g. animation) and to distinguish between different types
of examples (e.g. very basic examples vs complex demo-like examples).
Diffstat (limited to 'examples/declarative/listview/highlight.qml')
-rw-r--r-- | examples/declarative/listview/highlight.qml | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/examples/declarative/listview/highlight.qml b/examples/declarative/listview/highlight.qml deleted file mode 100644 index ade355d..0000000 --- a/examples/declarative/listview/highlight.qml +++ /dev/null @@ -1,55 +0,0 @@ -import Qt 4.7 - -Rectangle { - width: 400; height: 300 - - // MyPets model is defined in dummydata/MyPetsModel.qml - // The launcher automatically loads files in dummydata/* to assist - // development without a real data source. - // This one contains my pets. - - // Define a delegate component. A component will be - // instantiated for each visible item in the list. - Component { - id: petDelegate - Item { - id: wrapper - width: 200; height: 50 - Column { - Text { text: 'Name: ' + name } - Text { text: 'Type: ' + type } - Text { text: 'Age: ' + age } - } - // Use the ListView.isCurrentItem attached property to - // indent the item if it is the current item. - states: State { - name: "Current" - when: wrapper.ListView.isCurrentItem - PropertyChanges { target: wrapper; x: 10 } - } - transitions: Transition { - NumberAnimation { properties: "x"; duration: 200 } - } - } - } - // Specify a highlight with custom movement. Note that highlightFollowsCurrentItem - // is set to false in the ListView so that we can control how the - // highlight moves to the current item. - Component { - id: petHighlight - Rectangle { - width: 200; height: 50 - color: "#FFFF88" - SpringFollow on y { to: list1.currentItem.y; spring: 3; damping: 0.1 } - } - } - - ListView { - id: list1 - width: 200; height: parent.height - model: MyPetsModel - delegate: petDelegate - highlight: petHighlight; highlightFollowsCurrentItem: false - focus: true - } -} |