Remove "All rights reserved" line from license headers.
[profile/ivi/qtdeclarative.git] / tests / testapplications / elements / content / GridViewElement.qml
1 /****************************************************************************
2 **
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/
5 **
6 ** This file is part of the test suite of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** GNU Lesser General Public License Usage
10 ** This file may be used under the terms of the GNU Lesser General Public
11 ** License version 2.1 as published by the Free Software Foundation and
12 ** appearing in the file LICENSE.LGPL included in the packaging of this
13 ** file. Please review the following information to ensure the GNU Lesser
14 ** General Public License version 2.1 requirements will be met:
15 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
16 **
17 ** In addition, as a special exception, Nokia gives you certain additional
18 ** rights. These rights are described in the Nokia Qt LGPL Exception
19 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
20 **
21 ** GNU General Public License Usage
22 ** Alternatively, this file may be used under the terms of the GNU General
23 ** Public License version 3.0 as published by the Free Software Foundation
24 ** and appearing in the file LICENSE.GPL included in the packaging of this
25 ** file. Please review the following information to ensure the GNU General
26 ** Public License version 3.0 requirements will be met:
27 ** http://www.gnu.org/copyleft/gpl.html.
28 **
29 ** Other Usage
30 ** Alternatively, this file may be used in accordance with the terms and
31 ** conditions contained in a signed written agreement between you and Nokia.
32 **
33 **
34 **
35 **
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41
42 import QtQuick 2.0
43
44 Rectangle {
45     id: gridviewelement; radius: 5; clip: true
46     property int cellsize
47     cellsize: Math.floor(elementview.width / 3)
48
49     GridView {
50         id: elementview
51         height: parent.height * .98; width: parent.width * .98
52         anchors.centerIn: parent
53         delegate: griddelegate; model: elements; visible: { qmlfiletoload == "" }
54         highlightFollowsCurrentItem: true; highlightRangeMode: ListView.StrictlyEnforceRange
55         cellWidth: cellsize; cellHeight: cellsize
56     }
57
58     // Delegates for the launcher grid
59     Component {
60         id: griddelegate
61         Item {
62             height: cellsize; width: cellsize
63             Column { anchors.fill: parent; spacing: 2
64                 Rectangle {
65                     height: parent.height * .8; width: height
66                     color: "lightgray"; radius: 5; smooth: true
67                     anchors.horizontalCenter: parent.horizontalCenter
68                     Image {
69                         height: parent.height*.75; width: height
70                         anchors.centerIn: parent
71                         source: "pics/logo.png"; fillMode: Image.PreserveAspectFit
72                     }
73                 }
74                 Text {
75                     height: parent.height * .8; width: parent.width
76                     anchors.horizontalCenter: parent.horizontalCenter; text: model.label; elide: Text.ElideRight
77                     horizontalAlignment: Text.AlignHCenter
78                 }
79             }
80             MouseArea {
81                 anchors.fill: parent
82                 hoverEnabled: true // For desktop testing
83                 onClicked: { runapp(model.label+"Element.qml"); }
84                 onEntered: { helptext = model.help }
85                 onExited: { helptext = "" }
86             }
87         }
88     }
89
90     // Elements list
91     ListModel {
92         id: elements
93         ListElement { label: "Rectangle"; help: "The Rectangle item provides a filled rectangle with an optional border." }
94         ListElement { label: "Image"; help: "The Image element displays an image in a declarative user interface" }
95         ListElement { label: "AnimatedImage"; help: "An image element that supports animations" }
96         ListElement { label: "BorderImage"; help: "The BorderImage element provides an image that can be used as a border." }
97         ListElement { label: "SystemPalette"; help: "The SystemPalette element provides access to the Qt palettes." }
98         ListElement { label: "Text"; help: "The Text item allows you to add formatted text to a scene." }
99         ListElement { label: "FontLoader"; help: "The FontLoader element allows fonts to be loaded by name or URL." }
100         ListElement { label: "TextInput"; help: "The TextInput item displays an editable line of text." }
101         ListElement { label: "TextEdit"; help: "The TextEdit item displays multiple lines of editable formatted text." }
102         ListElement { label: "ListView"; help: "The ListView item provides a list view of items provided by a model." }
103         ListElement { label: "Flipable"; help: "The Flipable item provides a surface that can be flipped" }
104         ListElement { label: "Column"; help: "The Column item arranges its children vertically." }
105         ListElement { label: "Row"; help: "The Row item arranges its children horizontally." }
106         ListElement { label: "Grid"; help: "The Grid item positions its children in a grid." }
107         ListElement { label: "Flow"; help: "The Flow item arranges its children side by side, wrapping as necessary." }
108         ListElement { label: "Repeater"; help: "The Repeater element allows you to repeat an Item-based component using a model." }
109         ListElement { label: "IntValidator"; help: "This element provides a validator for integer values." }
110         ListElement { label: "DoubleValidator"; help: "This element provides a validator for non-integer values." }
111         ListElement { label: "RegExpValidator"; help: "This element provides a validator, which counts as valid any string which matches a specified regular expression." }
112         ListElement { label: "Flickable"; help: "The Flickable item provides a surface that can be \"flicked\"." }
113         ListElement { label: "Keys"; help: "The Keys attached property provides key handling to Items." }
114         ListElement { label: "MouseArea"; help: "The MouseArea item enables simple mouse handling." }
115         ListElement { label: "SequentialAnimation"; help: "The SequentialAnimation element allows animations to be run sequentially." }
116         ListElement { label: "ParallelAnimation"; help: "The ParallelAnimation element allows animations to be run in parallel." }
117         ListElement { label: "XmlListModel"; help: "The XmlListModel element is used to specify a read-only model using XPath expressions." }
118         ListElement { label: "Scale"; help: "The Scale element provides a way to scale an Item." }
119         ListElement { label: "ParticleSystem"; help: "The ParticleSystem brings together ParticlePainter, Emitter and Affector elements." }
120         ListElement { label: "ImageParticle"; help: "The ImageParticle element visualizes logical particles using an image." }
121         ListElement { label: "Emitter"; help: "The Emitter element allows you to emit logical particles." }
122         ListElement { label: "Affector"; help: "Affector elements can alter the attributes of logical particles at any point in their lifetime." }
123         ListElement { label: "Shape"; help: "The Shape element allows you to specify an area for affectors and emitter." }
124         ListElement { label: "TrailEmitter"; help: "The TrailEmitter element allows you to emit logical particles from other logical particles." }
125         ListElement { label: "Direction"; help: "The Direction elements allow you to specify a vector space." }
126         ListElement { label: "SpriteImage"; help: "The SpriteImage element plays stochastic sprite animations." }
127     }
128 }