diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2012-03-05 15:02:09 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-20 06:49:30 +0100 |
commit | 386e56ff336fe956f4d44946edab275b7244a4ca (patch) | |
tree | ce459a1398a7020f73b55a7a00a194e4753d644e /examples/quick/touchinteraction/flickable | |
parent | 738d3a99db5aeed0fccbef78aeec0a98d426fbad (diff) |
Update touchinteraction examples to new guidelines
Includes adding flickable examples
Change-Id: Ie1a47882bcb8b671f162b2b778dad33ce105407b
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
Diffstat (limited to 'examples/quick/touchinteraction/flickable')
-rw-r--r-- | examples/quick/touchinteraction/flickable/basic-flickable.qml | 68 | ||||
-rw-r--r-- | examples/quick/touchinteraction/flickable/content/Panel.qml (renamed from examples/quick/touchinteraction/flickable/content/Day.qml) | 2 | ||||
-rw-r--r-- | examples/quick/touchinteraction/flickable/corkboards.qml | 51 |
3 files changed, 80 insertions, 41 deletions
diff --git a/examples/quick/touchinteraction/flickable/basic-flickable.qml b/examples/quick/touchinteraction/flickable/basic-flickable.qml new file mode 100644 index 0000000000..58650d7334 --- /dev/null +++ b/examples/quick/touchinteraction/flickable/basic-flickable.qml @@ -0,0 +1,68 @@ +/**************************************************************************** +** +** 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 2.0 + +Rectangle { + width: 320 + height: 480 + Flickable { + anchors.fill: parent + contentWidth: 1200 + contentHeight: 1200 + Rectangle { + width: 1000 + height: 1000 + x: 100 + y: 100 + radius: 128 + border.width: 4 + border.color: "black" + gradient: Gradient { + GradientStop { position: 0.0; color: "#000000" } + GradientStop { position: 0.2; color: "#888888" } + GradientStop { position: 0.4; color: "#FFFFFF" } + GradientStop { position: 0.6; color: "#FFFFFF" } + GradientStop { position: 0.8; color: "#888888" } + GradientStop { position: 1.0; color: "#000000" } + } + } + } +} diff --git a/examples/quick/touchinteraction/flickable/content/Day.qml b/examples/quick/touchinteraction/flickable/content/Panel.qml index 7fe625c305..3a402bbc06 100644 --- a/examples/quick/touchinteraction/flickable/content/Day.qml +++ b/examples/quick/touchinteraction/flickable/content/Panel.qml @@ -48,7 +48,7 @@ Component { width: ListView.view.width+40; height: ListView.view.height - Image { + Image { source: "cork.jpg" width: page.ListView.view.width height: page.ListView.view.height diff --git a/examples/quick/touchinteraction/flickable/corkboards.qml b/examples/quick/touchinteraction/flickable/corkboards.qml index dc3aa6b378..85c62f1538 100644 --- a/examples/quick/touchinteraction/flickable/corkboards.qml +++ b/examples/quick/touchinteraction/flickable/corkboards.qml @@ -42,62 +42,33 @@ import QtQuick 2.0 import "content" Rectangle { - width: 800; height: 480 + width: 320; height: 480 color: "#464646" ListModel { id: list ListElement { - name: "Sunday" + name: "Panel One" notes: [ - ListElement { noteText: "Lunch" }, - ListElement { noteText: "Birthday Party" } + ListElement { noteText: "Tap to edit" }, + ListElement { noteText: "Drag to move" }, + ListElement { noteText: "Flick to scroll" } ] } ListElement { - name: "Monday" + name: "Panel Two" notes: [ - ListElement { noteText: "Pickup kids from\nschool\n4.30pm" }, - ListElement { noteText: "Checkout Qt" }, ListElement { noteText: "Read email" } + ListElement { noteText: "Note One" }, + ListElement { noteText: "Note Two" } ] } ListElement { - name: "Tuesday" + name: "Panel Three" notes: [ - ListElement { noteText: "Walk dog" }, - ListElement { noteText: "Buy newspaper" } - ] - } - - ListElement { - name: "Wednesday" - notes: [ ListElement { noteText: "Cook dinner" } ] - } - - ListElement { - name: "Thursday" - notes: [ - ListElement { noteText: "Meeting\n5.30pm" }, - ListElement { noteText: "Weed garden" } - ] - } - - ListElement { - name: "Friday" - notes: [ - ListElement { noteText: "More work" }, - ListElement { noteText: "Grocery shopping" } - ] - } - - ListElement { - name: "Saturday" - notes: [ - ListElement { noteText: "Drink" }, - ListElement { noteText: "Download Qt\nPlay with QML" } + ListElement { noteText: "Note Three" } ] } } @@ -111,6 +82,6 @@ Rectangle { orientation: ListView.Horizontal snapMode: ListView.SnapOneItem model: list - delegate: Day { } + delegate: Panel { } } } |