aboutsummaryrefslogtreecommitdiffstats
path: root/examples/declarative/qtquick1/modelviews/listview
diff options
context:
space:
mode:
authorMatthew Vogt <matthew.vogt@nokia.com>2012-01-31 16:52:36 +1000
committerQt by Nokia <qt-info@nokia.com>2012-02-03 00:39:18 +0100
commit01dc7e2ea476e0e6dcdce2e72979bbc858f4057d (patch)
treed8796f7695bbf8ad42abf47cd84c1b5e000ef795 /examples/declarative/qtquick1/modelviews/listview
parent5e07b57b818326da47a46d384415041fa4cea0ba (diff)
Remove QtQuick1 elements from qtdeclarative
QtQuick1 is now contained in a separate repository. Task-number: QTBUG-23737 Change-Id: I09eae67af5693a22b896b916f816f73ccc3a89b1 Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'examples/declarative/qtquick1/modelviews/listview')
-rw-r--r--examples/declarative/qtquick1/modelviews/listview/content/PetsModel.qml98
-rw-r--r--examples/declarative/qtquick1/modelviews/listview/content/PressAndHoldButton.qml82
-rw-r--r--examples/declarative/qtquick1/modelviews/listview/content/RecipesModel.qml129
-rw-r--r--examples/declarative/qtquick1/modelviews/listview/content/TextButton.qml78
-rw-r--r--examples/declarative/qtquick1/modelviews/listview/content/pics/arrow-down.pngbin594 -> 0 bytes
-rw-r--r--examples/declarative/qtquick1/modelviews/listview/content/pics/arrow-up.pngbin692 -> 0 bytes
-rw-r--r--examples/declarative/qtquick1/modelviews/listview/content/pics/fruit-salad.jpgbin17952 -> 0 bytes
-rw-r--r--examples/declarative/qtquick1/modelviews/listview/content/pics/hamburger.jpgbin8572 -> 0 bytes
-rw-r--r--examples/declarative/qtquick1/modelviews/listview/content/pics/lemonade.jpgbin6645 -> 0 bytes
-rw-r--r--examples/declarative/qtquick1/modelviews/listview/content/pics/list-delete.pngbin831 -> 0 bytes
-rw-r--r--examples/declarative/qtquick1/modelviews/listview/content/pics/minus-sign.pngbin250 -> 0 bytes
-rw-r--r--examples/declarative/qtquick1/modelviews/listview/content/pics/moreDown.pngbin217 -> 0 bytes
-rw-r--r--examples/declarative/qtquick1/modelviews/listview/content/pics/moreUp.pngbin212 -> 0 bytes
-rw-r--r--examples/declarative/qtquick1/modelviews/listview/content/pics/pancakes.jpgbin9163 -> 0 bytes
-rw-r--r--examples/declarative/qtquick1/modelviews/listview/content/pics/plus-sign.pngbin462 -> 0 bytes
-rw-r--r--examples/declarative/qtquick1/modelviews/listview/content/pics/vegetable-soup.jpgbin8639 -> 0 bytes
-rw-r--r--examples/declarative/qtquick1/modelviews/listview/dynamiclist.qml203
-rw-r--r--examples/declarative/qtquick1/modelviews/listview/expandingdelegates.qml202
-rw-r--r--examples/declarative/qtquick1/modelviews/listview/highlight.qml99
-rw-r--r--examples/declarative/qtquick1/modelviews/listview/highlightranges.qml122
-rw-r--r--examples/declarative/qtquick1/modelviews/listview/listview.qmlproject14
-rw-r--r--examples/declarative/qtquick1/modelviews/listview/sections.qml87
22 files changed, 0 insertions, 1114 deletions
diff --git a/examples/declarative/qtquick1/modelviews/listview/content/PetsModel.qml b/examples/declarative/qtquick1/modelviews/listview/content/PetsModel.qml
deleted file mode 100644
index 139a67b8e8..0000000000
--- a/examples/declarative/qtquick1/modelviews/listview/content/PetsModel.qml
+++ /dev/null
@@ -1,98 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 1.0
-
-ListModel {
- ListElement {
- name: "Polly"
- type: "Parrot"
- age: 12
- size: "Small"
- }
- ListElement {
- name: "Penny"
- type: "Turtle"
- age: 4
- size: "Small"
- }
- ListElement {
- name: "Warren"
- type: "Rabbit"
- age: 2
- size: "Small"
- }
- ListElement {
- name: "Spot"
- type: "Dog"
- age: 9
- size: "Medium"
- }
- ListElement {
- name: "Schrödinger"
- type: "Cat"
- age: 2
- size: "Medium"
- }
- ListElement {
- name: "Joey"
- type: "Kangaroo"
- age: 1
- size: "Medium"
- }
- ListElement {
- name: "Kimba"
- type: "Bunny"
- age: 65
- size: "Large"
- }
- ListElement {
- name: "Rover"
- type: "Dog"
- age: 5
- size: "Large"
- }
- ListElement {
- name: "Tiny"
- type: "Elephant"
- age: 15
- size: "Large"
- }
-}
diff --git a/examples/declarative/qtquick1/modelviews/listview/content/PressAndHoldButton.qml b/examples/declarative/qtquick1/modelviews/listview/content/PressAndHoldButton.qml
deleted file mode 100644
index c6b1ecef61..0000000000
--- a/examples/declarative/qtquick1/modelviews/listview/content/PressAndHoldButton.qml
+++ /dev/null
@@ -1,82 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 1.0
-
-Image {
- id: container
-
- property int repeatDelay: 300
- property int repeatDuration: 75
- property bool pressed: false
-
- signal clicked
-
- scale: pressed ? 0.9 : 1
-
- function release() {
- autoRepeatClicks.stop()
- container.pressed = false
- }
-
- SequentialAnimation on pressed {
- id: autoRepeatClicks
- running: false
-
- PropertyAction { target: container; property: "pressed"; value: true }
- ScriptAction { script: container.clicked() }
- PauseAnimation { duration: repeatDelay }
-
- SequentialAnimation {
- loops: Animation.Infinite
- ScriptAction { script: container.clicked() }
- PauseAnimation { duration: repeatDuration }
- }
- }
-
- MouseArea {
- anchors.fill: parent
-
- onPressed: autoRepeatClicks.start()
- onReleased: container.release()
- onCanceled: container.release()
- }
-}
-
diff --git a/examples/declarative/qtquick1/modelviews/listview/content/RecipesModel.qml b/examples/declarative/qtquick1/modelviews/listview/content/RecipesModel.qml
deleted file mode 100644
index 79a0f67466..0000000000
--- a/examples/declarative/qtquick1/modelviews/listview/content/RecipesModel.qml
+++ /dev/null
@@ -1,129 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 1.0
-
-ListModel {
- ListElement {
- title: "Pancakes"
- picture: "content/pics/pancakes.jpg"
- ingredients: "<html>
- <ul>
- <li> 1 cup (150g) self-raising flour
- <li> 1 tbs caster sugar
- <li> 3/4 cup (185ml) milk
- <li> 1 egg
- </ul>
- </html>"
- method: "<html>
- <ol>
- <li> Sift flour and sugar together into a bowl. Add a pinch of salt.
- <li> Beat milk and egg together, then add to dry ingredients. Beat until smooth.
- <li> Pour mixture into a pan on medium heat and cook until bubbles appear on the surface.
- <li> Turn over and cook other side until golden.
- </ol>
- </html>"
- }
- ListElement {
- title: "Fruit Salad"
- picture: "content/pics/fruit-salad.jpg"
- ingredients: "* Seasonal Fruit"
- method: "* Chop fruit and place in a bowl."
- }
- ListElement {
- title: "Vegetable Soup"
- picture: "content/pics/vegetable-soup.jpg"
- ingredients: "<html>
- <ul>
- <li> 1 onion
- <li> 1 turnip
- <li> 1 potato
- <li> 1 carrot
- <li> 1 head of celery
- <li> 1 1/2 litres of water
- </ul>
- </html>"
- method: "<html>
- <ol>
- <li> Chop vegetables.
- <li> Boil in water until vegetables soften.
- <li> Season with salt and pepper to taste.
- </ol>
- </html>"
- }
- ListElement {
- title: "Hamburger"
- picture: "content/pics/hamburger.jpg"
- ingredients: "<html>
- <ul>
- <li> 500g minced beef
- <li> Seasoning
- <li> lettuce, tomato, onion, cheese
- <li> 1 hamburger bun for each burger
- </ul>
- </html>"
- method: "<html>
- <ol>
- <li> Mix the beef, together with seasoning, in a food processor.
- <li> Shape the beef into burgers.
- <li> Grill the burgers for about 5 mins on each side (until cooked through)
- <li> Serve each burger on a bun with ketchup, cheese, lettuce, tomato and onion.
- </ol>
- </html>"
- }
- ListElement {
- title: "Lemonade"
- picture: "content/pics/lemonade.jpg"
- ingredients: "<html>
- <ul>
- <li> 1 cup Lemon Juice
- <li> 1 cup Sugar
- <li> 6 Cups of Water (2 cups warm water, 4 cups cold water)
- </ul>
- </html>"
- method: "<html>
- <ol>
- <li> Pour 2 cups of warm water into a pitcher and stir in sugar until it dissolves.
- <li> Pour in lemon juice, stir again, and add 4 cups of cold water.
- <li> Chill or serve over ice cubes.
- </ol>
- </html>"
- }
-}
diff --git a/examples/declarative/qtquick1/modelviews/listview/content/TextButton.qml b/examples/declarative/qtquick1/modelviews/listview/content/TextButton.qml
deleted file mode 100644
index 4e58067589..0000000000
--- a/examples/declarative/qtquick1/modelviews/listview/content/TextButton.qml
+++ /dev/null
@@ -1,78 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 1.0
-
-Rectangle {
- id: container
-
- property alias text: label.text
-
- signal clicked
-
- width: label.width + 20; height: label.height + 6
- smooth: true
- radius: 10
-
- gradient: Gradient {
- GradientStop { id: gradientStop; position: 0.0; color: palette.light }
- GradientStop { position: 1.0; color: palette.button }
- }
-
- SystemPalette { id: palette }
-
- MouseArea {
- id: mouseArea
- anchors.fill: parent
- onClicked: { container.clicked() }
- }
-
- Text {
- id: label
- anchors.centerIn: parent
- }
-
- states: State {
- name: "pressed"
- when: mouseArea.pressed
- PropertyChanges { target: gradientStop; color: palette.dark }
- }
-}
-
diff --git a/examples/declarative/qtquick1/modelviews/listview/content/pics/arrow-down.png b/examples/declarative/qtquick1/modelviews/listview/content/pics/arrow-down.png
deleted file mode 100644
index 29d1d4439a..0000000000
--- a/examples/declarative/qtquick1/modelviews/listview/content/pics/arrow-down.png
+++ /dev/null
Binary files differ
diff --git a/examples/declarative/qtquick1/modelviews/listview/content/pics/arrow-up.png b/examples/declarative/qtquick1/modelviews/listview/content/pics/arrow-up.png
deleted file mode 100644
index e437312217..0000000000
--- a/examples/declarative/qtquick1/modelviews/listview/content/pics/arrow-up.png
+++ /dev/null
Binary files differ
diff --git a/examples/declarative/qtquick1/modelviews/listview/content/pics/fruit-salad.jpg b/examples/declarative/qtquick1/modelviews/listview/content/pics/fruit-salad.jpg
deleted file mode 100644
index da5a6b10a2..0000000000
--- a/examples/declarative/qtquick1/modelviews/listview/content/pics/fruit-salad.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/declarative/qtquick1/modelviews/listview/content/pics/hamburger.jpg b/examples/declarative/qtquick1/modelviews/listview/content/pics/hamburger.jpg
deleted file mode 100644
index d0a15be1bf..0000000000
--- a/examples/declarative/qtquick1/modelviews/listview/content/pics/hamburger.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/declarative/qtquick1/modelviews/listview/content/pics/lemonade.jpg b/examples/declarative/qtquick1/modelviews/listview/content/pics/lemonade.jpg
deleted file mode 100644
index db445c9ac8..0000000000
--- a/examples/declarative/qtquick1/modelviews/listview/content/pics/lemonade.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/declarative/qtquick1/modelviews/listview/content/pics/list-delete.png b/examples/declarative/qtquick1/modelviews/listview/content/pics/list-delete.png
deleted file mode 100644
index df2a147d24..0000000000
--- a/examples/declarative/qtquick1/modelviews/listview/content/pics/list-delete.png
+++ /dev/null
Binary files differ
diff --git a/examples/declarative/qtquick1/modelviews/listview/content/pics/minus-sign.png b/examples/declarative/qtquick1/modelviews/listview/content/pics/minus-sign.png
deleted file mode 100644
index d6f233d739..0000000000
--- a/examples/declarative/qtquick1/modelviews/listview/content/pics/minus-sign.png
+++ /dev/null
Binary files differ
diff --git a/examples/declarative/qtquick1/modelviews/listview/content/pics/moreDown.png b/examples/declarative/qtquick1/modelviews/listview/content/pics/moreDown.png
deleted file mode 100644
index 31a35d5c20..0000000000
--- a/examples/declarative/qtquick1/modelviews/listview/content/pics/moreDown.png
+++ /dev/null
Binary files differ
diff --git a/examples/declarative/qtquick1/modelviews/listview/content/pics/moreUp.png b/examples/declarative/qtquick1/modelviews/listview/content/pics/moreUp.png
deleted file mode 100644
index fefb9c9098..0000000000
--- a/examples/declarative/qtquick1/modelviews/listview/content/pics/moreUp.png
+++ /dev/null
Binary files differ
diff --git a/examples/declarative/qtquick1/modelviews/listview/content/pics/pancakes.jpg b/examples/declarative/qtquick1/modelviews/listview/content/pics/pancakes.jpg
deleted file mode 100644
index 60c439638e..0000000000
--- a/examples/declarative/qtquick1/modelviews/listview/content/pics/pancakes.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/declarative/qtquick1/modelviews/listview/content/pics/plus-sign.png b/examples/declarative/qtquick1/modelviews/listview/content/pics/plus-sign.png
deleted file mode 100644
index 40df1134f8..0000000000
--- a/examples/declarative/qtquick1/modelviews/listview/content/pics/plus-sign.png
+++ /dev/null
Binary files differ
diff --git a/examples/declarative/qtquick1/modelviews/listview/content/pics/vegetable-soup.jpg b/examples/declarative/qtquick1/modelviews/listview/content/pics/vegetable-soup.jpg
deleted file mode 100644
index 9dce332041..0000000000
--- a/examples/declarative/qtquick1/modelviews/listview/content/pics/vegetable-soup.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/declarative/qtquick1/modelviews/listview/dynamiclist.qml b/examples/declarative/qtquick1/modelviews/listview/dynamiclist.qml
deleted file mode 100644
index 91d9a228df..0000000000
--- a/examples/declarative/qtquick1/modelviews/listview/dynamiclist.qml
+++ /dev/null
@@ -1,203 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-import QtQuick 1.0
-import "content"
-
-// This example shows how items can be dynamically added to and removed from
-// a ListModel, and how these list modifications can be animated.
-
-Rectangle {
- id: container
- width: 500; height: 400
- color: "#343434"
-
- // The model:
- ListModel {
- id: fruitModel
-
- ListElement {
- name: "Apple"; cost: 2.45
- attributes: [
- ListElement { description: "Core" },
- ListElement { description: "Deciduous" }
- ]
- }
- ListElement {
- name: "Banana"; cost: 1.95
- attributes: [
- ListElement { description: "Tropical" },
- ListElement { description: "Seedless" }
- ]
- }
- ListElement {
- name: "Cumquat"; cost: 3.25
- attributes: [
- ListElement { description: "Citrus" }
- ]
- }
- ListElement {
- name: "Durian"; cost: 9.95
- attributes: [
- ListElement { description: "Tropical" },
- ListElement { description: "Smelly" }
- ]
- }
- }
-
- // The delegate for each fruit in the model:
- Component {
- id: listDelegate
-
- Item {
- id: delegateItem
- width: listView.width; height: 55
- clip: true
-
- Row {
- anchors.verticalCenter: parent.verticalCenter
- spacing: 10
-
- Column {
- Image {
- source: "content/pics/arrow-up.png"
- MouseArea { anchors.fill: parent; onClicked: fruitModel.move(index, index-1, 1) }
- }
- Image { source: "content/pics/arrow-down.png"
- MouseArea { anchors.fill: parent; onClicked: fruitModel.move(index, index+1, 1) }
- }
- }
-
- Column {
- anchors.verticalCenter: parent.verticalCenter
-
- Text {
- text: name
- font.pixelSize: 15
- color: "white"
- }
- Row {
- spacing: 5
- Repeater {
- model: attributes
- Text { text: description; color: "White" }
- }
- }
- }
- }
-
- Row {
- anchors.verticalCenter: parent.verticalCenter
- anchors.right: parent.right
- spacing: 10
-
- PressAndHoldButton {
- anchors.verticalCenter: parent.verticalCenter
- source: "content/pics/plus-sign.png"
- onClicked: fruitModel.setProperty(index, "cost", cost + 0.25)
- }
-
- Text {
- id: costText
- anchors.verticalCenter: parent.verticalCenter
- text: '$' + Number(cost).toFixed(2)
- font.pixelSize: 15
- color: "white"
- font.bold: true
- }
-
- PressAndHoldButton {
- anchors.verticalCenter: parent.verticalCenter
- source: "content/pics/minus-sign.png"
- onClicked: fruitModel.setProperty(index, "cost", Math.max(0,cost-0.25))
- }
-
- Image {
- source: "content/pics/list-delete.png"
- MouseArea { anchors.fill:parent; onClicked: fruitModel.remove(index) }
- }
- }
-
- // Animate adding and removing of items:
-
- ListView.onAdd: SequentialAnimation {
- PropertyAction { target: delegateItem; property: "height"; value: 0 }
- NumberAnimation { target: delegateItem; property: "height"; to: 55; duration: 250; easing.type: Easing.InOutQuad }
- }
-
- ListView.onRemove: SequentialAnimation {
- PropertyAction { target: delegateItem; property: "ListView.delayRemove"; value: true }
- //NumberAnimation { target: delegateItem; property: "height"; to: 0; duration: 250; easing.type: Easing.InOutQuad }
-
- // Make sure delayRemove is set back to false so that the item can be destroyed
- PropertyAction { target: delegateItem; property: "ListView.delayRemove"; value: false }
- }
- }
- }
-
- // The view:
- ListView {
- id: listView
- anchors.fill: parent; anchors.margins: 20
- model: fruitModel
- delegate: listDelegate
- }
-
- Row {
- anchors { left: parent.left; bottom: parent.bottom; margins: 20 }
- spacing: 10
-
- TextButton {
- text: "Add an item"
- onClicked: {
- fruitModel.append({
- "name": "Pizza Margarita",
- "cost": 5.95,
- "attributes": [{"description": "Cheese"}, {"description": "Tomato"}]
- })
- }
- }
-
- TextButton {
- text: "Remove all items"
- onClicked: fruitModel.clear()
- }
- }
-}
-
diff --git a/examples/declarative/qtquick1/modelviews/listview/expandingdelegates.qml b/examples/declarative/qtquick1/modelviews/listview/expandingdelegates.qml
deleted file mode 100644
index 186734ba05..0000000000
--- a/examples/declarative/qtquick1/modelviews/listview/expandingdelegates.qml
+++ /dev/null
@@ -1,202 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 1.0
-import "content"
-
-// This example illustrates expanding a list item to show a more detailed view.
-
-Rectangle {
- id: page
- width: 400; height: 240
- color: "black"
-
- // Delegate for the recipes. This delegate has two modes:
- // 1. List mode (default), which just shows the picture and title of the recipe.
- // 2. Details mode, which also shows the ingredients and method.
- Component {
- id: recipeDelegate
-
- Item {
- id: recipe
-
- // Create a property to contain the visibility of the details.
- // We can bind multiple element's opacity to this one property,
- // rather than having a "PropertyChanges" line for each element we
- // want to fade.
- property real detailsOpacity : 0
-
- width: listView.width
- height: 70
-
- // A simple rounded rectangle for the background
- Rectangle {
- id: background
- x: 2; y: 2; width: parent.width - x*2; height: parent.height - y*2
- color: "ivory"
- border.color: "orange"
- radius: 5
- }
-
- // This mouse region covers the entire delegate.
- // When clicked it changes mode to 'Details'. If we are already
- // in Details mode, then no change will happen.
- MouseArea {
- anchors.fill: parent
- onClicked: recipe.state = 'Details';
- }
-
- // Lay out the page: picture, title and ingredients at the top, and method at the
- // bottom. Note that elements that should not be visible in the list
- // mode have their opacity set to recipe.detailsOpacity.
- Row {
- id: topLayout
- x: 10; y: 10; height: recipeImage.height; width: parent.width
- spacing: 10
-
- Image {
- id: recipeImage
- width: 50; height: 50
- source: picture
- }
-
- Column {
- width: background.width - recipeImage.width - 20; height: recipeImage.height
- spacing: 5
-
- Text {
- text: title
- font.bold: true; font.pointSize: 16
- }
-
- Text {
- text: "Ingredients"
- font.pointSize: 12; font.bold: true
- opacity: recipe.detailsOpacity
- }
-
- Text {
- text: ingredients
- wrapMode: Text.WordWrap
- width: parent.width
- opacity: recipe.detailsOpacity
- }
- }
- }
-
- Item {
- id: details
- x: 10; width: parent.width - 20
- anchors { top: topLayout.bottom; topMargin: 10; bottom: parent.bottom; bottomMargin: 10 }
- opacity: recipe.detailsOpacity
-
- Text {
- id: methodTitle
- anchors.top: parent.top
- text: "Method"
- font.pointSize: 12; font.bold: true
- }
-
- Flickable {
- id: flick
- width: parent.width
- anchors { top: methodTitle.bottom; bottom: parent.bottom }
- contentHeight: methodText.height
- clip: true
-
- Text { id: methodText; text: method; wrapMode: Text.WordWrap; width: details.width }
- }
-
- Image {
- anchors { right: flick.right; top: flick.top }
- source: "content/pics/moreUp.png"
- opacity: flick.atYBeginning ? 0 : 1
- }
-
- Image {
- anchors { right: flick.right; bottom: flick.bottom }
- source: "content/pics/moreDown.png"
- opacity: flick.atYEnd ? 0 : 1
- }
- }
-
- // A button to close the detailed view, i.e. set the state back to default ('').
- TextButton {
- y: 10
- anchors { right: background.right; rightMargin: 10 }
- opacity: recipe.detailsOpacity
- text: "Close"
-
- onClicked: recipe.state = '';
- }
-
- states: State {
- name: "Details"
-
- PropertyChanges { target: background; color: "white" }
- PropertyChanges { target: recipeImage; width: 130; height: 130 } // Make picture bigger
- PropertyChanges { target: recipe; detailsOpacity: 1; x: 0 } // Make details visible
- PropertyChanges { target: recipe; height: listView.height } // Fill the entire list area with the detailed view
-
- // Move the list so that this item is at the top.
- PropertyChanges { target: recipe.ListView.view; explicit: true; contentY: recipe.y }
-
- // Disallow flicking while we're in detailed view
- PropertyChanges { target: recipe.ListView.view; interactive: false }
- }
-
- transitions: Transition {
- // Make the state changes smooth
- ParallelAnimation {
- ColorAnimation { property: "color"; duration: 500 }
- NumberAnimation { duration: 300; properties: "detailsOpacity,x,contentY,height,width" }
- }
- }
- }
- }
-
- // The actual list
- ListView {
- id: listView
- anchors.fill: parent
- model: RecipesModel {}
- delegate: recipeDelegate
- }
-}
diff --git a/examples/declarative/qtquick1/modelviews/listview/highlight.qml b/examples/declarative/qtquick1/modelviews/listview/highlight.qml
deleted file mode 100644
index cb2829b81b..0000000000
--- a/examples/declarative/qtquick1/modelviews/listview/highlight.qml
+++ /dev/null
@@ -1,99 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-// This example shows how to create your own highlight delegate for a ListView
-// that uses a SpringAnimation to provide custom movement when the
-// highlight bar is moved between items.
-
-import QtQuick 1.0
-import "content"
-
-Rectangle {
- width: 200; height: 300
-
- // 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: 55
- Column {
- Text { text: 'Name: ' + name }
- Text { text: 'Type: ' + type }
- Text { text: 'Age: ' + age }
- }
- // indent the item if it is the current item
- states: State {
- name: "Current"
- when: wrapper.ListView.isCurrentItem
- PropertyChanges { target: wrapper; x: 20 }
- }
- transitions: Transition {
- NumberAnimation { properties: "x"; duration: 200 }
- }
- }
- }
-
- // Define a highlight with customised movement between items.
- Component {
- id: highlightBar
- Rectangle {
- width: 200; height: 50
- color: "#FFFF88"
- y: listView.currentItem.y;
- Behavior on y { SpringAnimation { spring: 2; damping: 0.1 } }
- }
- }
-
- ListView {
- id: listView
- width: 200; height: parent.height
-
- model: PetsModel {}
- delegate: petDelegate
- focus: true
-
- // Set the highlight delegate. Note we must also set highlightFollowsCurrentItem
- // to false so the highlight delegate can control how the highlight is moved.
- highlight: highlightBar
- highlightFollowsCurrentItem: false
- }
-}
diff --git a/examples/declarative/qtquick1/modelviews/listview/highlightranges.qml b/examples/declarative/qtquick1/modelviews/listview/highlightranges.qml
deleted file mode 100644
index c4e01b06ae..0000000000
--- a/examples/declarative/qtquick1/modelviews/listview/highlightranges.qml
+++ /dev/null
@@ -1,122 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 1.0
-import "content"
-
-Rectangle {
- id: root
- property int current: 0
- width: 600; height: 300
-
- // This example shows the same model in three different ListView items,
- // with different highlight ranges. The highlight ranges are set by the
- // preferredHighlightBegin and preferredHighlightEnd properties in ListView.
- //
- // The first ListView does not set a highlight range, so its currentItem
- // can move freely within the visible area. If it moves outside the
- // visible area, the view is automatically scrolled to keep the current
- // item visible.
- //
- // The second ListView sets a highlight range which attempts to keep the
- // current item within the the bounds of the range. However,
- // items will not scroll beyond the beginning or end of the view,
- // forcing the highlight to move outside the range at the ends.
- //
- // The third ListView sets the highlightRangeMode to StrictlyEnforceRange
- // and sets a range smaller than the height of an item. This
- // forces the current item to change when the view is flicked,
- // since the highlight is unable to move.
- //
- // All ListViews bind their currentIndex to the root.current property.
- // The first ListView sets root.current whenever its currentIndex changes
- // due to keyboard interaction.
- // Flicking the third ListView with the mouse also changes root.current.
-
- ListView {
- id: list1
- width: 200; height: parent.height
- model: PetsModel {}
- delegate: petDelegate
-
- highlight: Rectangle { color: "lightsteelblue" }
- currentIndex: root.current
- onCurrentIndexChanged: root.current = currentIndex
- focus: true
- }
-
- ListView {
- id: list2
- x: list1.width
- width: 200; height: parent.height
- model: PetsModel {}
- delegate: petDelegate
-
- highlight: Rectangle { color: "yellow" }
- currentIndex: root.current
- preferredHighlightBegin: 80; preferredHighlightEnd: 220
- highlightRangeMode: ListView.ApplyRange
- }
-
- ListView {
- id: list3
- x: list1.width + list2.width
- width: 200; height: parent.height
- model: PetsModel {}
- delegate: petDelegate
-
- highlight: Rectangle { color: "yellow" }
- currentIndex: root.current
- onCurrentIndexChanged: root.current = currentIndex
- preferredHighlightBegin: 125; preferredHighlightEnd: 125
- highlightRangeMode: ListView.StrictlyEnforceRange
- }
-
- // The delegate for each list
- Component {
- id: petDelegate
- Column {
- width: 200
- Text { text: 'Name: ' + name }
- Text { text: 'Type: ' + type }
- Text { text: 'Age: ' + age }
- }
- }
-}
diff --git a/examples/declarative/qtquick1/modelviews/listview/listview.qmlproject b/examples/declarative/qtquick1/modelviews/listview/listview.qmlproject
deleted file mode 100644
index 2bb4016996..0000000000
--- a/examples/declarative/qtquick1/modelviews/listview/listview.qmlproject
+++ /dev/null
@@ -1,14 +0,0 @@
-import QmlProject 1.0
-
-Project {
- /* Include .qml, .js, and image files from current directory and subdirectories */
- QmlFiles {
- directory: "."
- }
- JavaScriptFiles {
- directory: "."
- }
- ImageFiles {
- directory: "."
- }
-}
diff --git a/examples/declarative/qtquick1/modelviews/listview/sections.qml b/examples/declarative/qtquick1/modelviews/listview/sections.qml
deleted file mode 100644
index 6232f20315..0000000000
--- a/examples/declarative/qtquick1/modelviews/listview/sections.qml
+++ /dev/null
@@ -1,87 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-// This example shows how a ListView can be separated into sections using
-// the ListView.section attached property.
-
-import QtQuick 1.0
-
-//! [0]
-Rectangle {
- id: container
- width: 200
- height: 250
-
- ListModel {
- id: animalsModel
- ListElement { name: "Parrot"; size: "Small" }
- ListElement { name: "Guinea pig"; size: "Small" }
- ListElement { name: "Dog"; size: "Medium" }
- ListElement { name: "Cat"; size: "Medium" }
- ListElement { name: "Elephant"; size: "Large" }
- }
-
- // The delegate for each section header
- Component {
- id: sectionHeading
- Rectangle {
- width: container.width
- height: childrenRect.height
- color: "lightsteelblue"
-
- Text {
- text: section
- font.bold: true
- }
- }
- }
-
- ListView {
- anchors.fill: parent
- model: animalsModel
- delegate: Text { text: name }
-
- section.property: "size"
- section.criteria: ViewSection.FullString
- section.delegate: sectionHeading
- }
-}
-//! [0]
-