f989a19417242d07ddb6dcf5574019e87d95d1fd
[profile/ivi/qtdeclarative.git] / src / quick / doc / src / whatsnew.qdoc
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 documentation of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:FDL$
9 ** GNU Free Documentation License
10 ** Alternatively, this file may be used under the terms of the GNU Free
11 ** Documentation License version 1.3 as published by the Free Software
12 ** Foundation and appearing in the file included in the packaging of
13 ** this file.
14 **
15 ** Other Usage
16 ** Alternatively, this file may be used in accordance with the terms
17 ** and conditions contained in a signed written agreement between you
18 ** and Nokia.
19 **
20 **
21 **
22 **
23 **
24 ** $QT_END_LICENSE$
25 **
26 ****************************************************************************/
27
28 /*!
29 \title QtQuick Module Release Notes
30 \page qtquick-releasenotes.html
31 \inqmlmodule QtQuick 2.0
32
33 \section1 Qt 5.0 - QtQuick C++ Module
34
35 The QtQuick C++ module is new in Qt 5. It provides the visual canvas and scenegraph backend
36 as well as the QtQuick QML module for QML application development.
37
38 As of Qt 5, the QtQuick module is based on an OpenGL scenegraph. Many of the classes in
39 the QtQuick module have been ported from the \c QtDeclarative module from Qt 4.8 to use
40 the scenegraph architecture; these classes have been renamed to use a \c QQuick* prefix.
41 (See the \l {Porting QML Applications to Qt 5} for porting information.)
42
43 The following classes provide the basic functionality for interacting with the QML visual
44 canvas from C++:
45
46 \list
47 \li QQuickItem - the base visual QML type (replaces \c QDeclarativeItem)
48 \li QQuickView - a window for rendering a QML scene from a QML file (replaces \c QDeclarativeView)
49 \li QQuickCanvas - a base canvas for displaying a QML scene
50 \li QQuickPaintedItem - convenience for using the QPainter API with the scenegraph
51 \li QQuickImageProvider - fetches custom images for use in QML applications (replaces \c QDeclarativeImageProvider)
52 \li QQuickTextureFactory - use with QQuickImageProvider::requestTexture()
53 \endlist
54
55 Custom rendering can be performed on the scenegraph using the following new classes:
56
57 \list
58 \li QSGNode
59 \li QSGMaterial
60 \li QSGBasicGeometryNode
61 \li QSGGeometryNode
62 \li QSGClipNode
63 \li QSGTransformNode
64 \li QSGRootNode
65 \li QSGOpacityNode
66 \li QSGNodeVisitor
67 \li QSGFlatColorMaterial
68 \li QSGSimpleRectNode
69 \li QSGSimpleTextureNode
70 \li QSGTexture
71 \li QSGDynamicTexture
72 \li QSGOpaqueTextureMaterial
73 \li QSGTextureMaterial
74 \li QSGTextureProvider
75 \li QSGVertexColorMaterial
76 \endlist
77
78
79 \section1 Qt 5.0 - QtQuick QML Module
80
81 The QtQuick 2.0 QML module is a major update.
82
83 Below are the additions and changes in QtQuick 2.0:
84
85 \section2 Graphics and Animations
86
87 \list
88 \li New \l Canvas type for drawing. This provides a HTML5 canvas like API along with some additional features.
89     \list
90     \li Supports two render targets: \c Canvas.Image and \c Canvas.FramebufferObject.
91     \li Supports background thread rendering.
92     \li Supports tiled canvas rendering.
93     \li Supports most of the HTML5 context2d APIs.
94     \endlist
95 \li \l Image:
96     \list
97     \li New \l{Image::}{horizontalAlignment} and \l{Image::}{verticalAlignment} properties.
98     \li New \c Image.Pad enum value for \l{Image::}{fillMode} that does not transform the image, unlike other \l{Image::}{fillMode} enum values.
99     \li Modifying the \l{Image::}{sourceSize} now fits the image to the size, maintaining aspect ratio.
100     \endlist
101 \li New SpriteSequence type renders animated sprites and can transition between animations.
102 \li New \l Sprite type which represents each animation in a SpriteSequence.
103 \li New AnimatedSprite type for drawing single sprite animations.
104 \li New PathArc, PathCurve and PathSvg types:
105     \list
106     \li PathArc and PathCurve support the construction of arcs and catmull-rom curves, respectively. PathSvg supports the construction of a path from a SVG string.
107     \endlist
108     \endlist
109 \endlist
110
111
112 \section2 Text
113
114 \list
115 \li \l Text:
116     \list
117     \li When \c Text.AutoText format is enabled, the text object will automatically switch to \c Text.StyledText instead of \c Text.RichText.
118     \li New \l{Text::}{onLineLaidOut} handler is called for every line during the layout process to give the option of positioning and/or resizing lines as they are laid out.
119     \li New \l{Text::}{doLayout()} method will trigger the text layout from Javascript.
120     \li \c Text.RightElide is now supported where text spans multiple lines.
121     \li New \l{Text::}{fontSizeMode} property allows text to be fitted to the item size.
122     \li New \l{Text::}{minimumPixelSize} and \l {Text::}{minimumPointSize} properties can be used to specify a lower bound when auto-fitting.
123     \endlist
124 \li TextEdit:
125     \list
126     \li \l{TextEdit::}{textFormat} property now defaults to \c PlainText instead of \c AutoText.
127     \endlist
128 \li TextInput:
129     \list
130     \li New \l{TextInput::}{wrapMode} property.
131     \li New \l{TextInput::}{horizontalAlignment} and \l{TextInput::}{verticalAlignment} properties.
132     \li \l{TextInput::}{positionAt()} method now takes a y parameter.
133     \endlist
134 \endlist
135
136 \section2 User Input
137
138 \list
139 \li New MultiPointTouchArea type processes multi-point touches and provides information on touch points including position, pressure and velocity.
140 \li MouseArea:
141     \list
142     \li Wheel events are now supported.
143     \li The \l{MouseArea::}{onClicked}, \l{MouseArea::}{onDoubleClicked} and \l{MouseArea::}{onPressAndHold} signals are now propagated differently to \l{MouseArea::}{onPressed}. These will now be propagated to the highest-stacking-order enabled MouseArea that has a handler for them. You can still ignore these events in the handler to let them pass through; this behavior is triggered with the new property \l{MouseArea::}{propagateComposedEvents}.
144     \li New \l{MouseArea::}{propagateComposedEvents} property sets whether composed events are propagated to other mouse areas.
145     \endlist
146 \endlist
147
148 \section2 Specialised Containers
149
150 \list
151 \li Flickable:
152     \list
153     \li New \l{Flickable::}{rebound} property specifies the transition to be applied when a flickable snaps back to its bounds.
154     \li New \l{Flickable::}{topMargin}, \l{Flickable::}{bottomMargin}, \l{Flickable::}{leftMargin}, \l{Flickable::}{rightMargin} allow extra margin space to be specified for a flickable. This can be used, for example, to implement the pull-to-refresh functionality for a list.
155     \li New \l{Flickable::}{originX} and \l{Flickable::}{originY} properties provide the top left position of the content item.
156     \li New \l{Flickable::}{dragging}, \l{Flickable::}{draggingHorizontally} and \l{Flickable::}{draggingVertically} properties provide information on whether a flickable is currently being dragged.
157     \endlist
158 \endlist
159
160 \section2 Positioners (Row, Column, Grid, Flow types):
161
162 \list
163 \li The \c add and \c move transitions can now access a ViewTransition attached property (see the ViewTransition documentation for examples) and can now animate arbitrary item properties (instead of being restricted to animating an item's position).
164 \li New \l Positioner type provides \c index, \c isFirstItem and \c isLastItem attached properties for items within positioners.
165 \li All \c spacing properties on positioners now use real numbers instead of integers.
166 \li Grid:
167     \list
168     \li New \l{Grid::}{rowSpacing} and \l{Grid::}{columnSpacing} properties.
169     \endlist
170 \endlist
171
172 \section2 Models and Views
173
174 \list
175 \li ListView and GridView:
176     \list
177     \li New transition support for animating the adding, removing and moving of items in a ListView or GridView. See the ViewTransition documentation for details.
178     \li New \c verticalLayoutDirection property enables items to be laid out from bottom-to-top using the new \c BottomToTop enum value.
179     \li New \c headerItem and \c footerItem properties provide access to the instantiated header and footer items.
180     \li The \c cacheBuffer property now has a non-zero default.
181     \li Delegates in the cache buffer are now created asynchronously.
182     \li Setting a \c RightToLeft layout now also reverses the \c preferredHighlightBegin and \c preferredHighlightEnd.
183     \endlist
184 \li ListView only:
185     \list
186     \li New \l{ListView::}{section.labelPositioning} property can fix the current section label to the start of the view, and the next section label to the end of the view, so that labels do not scroll while section items are still in view.
187     \endlist
188 \li PathView:
189     \list
190     \li New \l{PathView::}{currentItem} property.
191     \li New \l{PathView::}{maximumFlickVelocity} property.
192     \endlist
193 \endlist
194
195 \section2 Utility types
196
197 \list
198 \li \l Loader:
199     \list
200     \li New \l{Loader::}{asynchronous} property allows components to be instantiated with lower chance of blocking.  If source is used with \e {asynchonous: true} the component will be compiled in a background thread.
201     \li New \l{Loader::}{active} property delays instantiation of a \l Loader object's \l{Loader::}{item}.
202     \li New \l{Loader::}{setSource()} method can load an object with specific initial property values, similar to \l Component::createObject().
203     \li The \c sourceChanged signal is now only emitted when the \l{Loader::}{source} changes and the \c sourceComponentChanged signal is now only emitted when the \l{Loader::}{sourceComponent} changes. (Previously Loader emitted both signals when only one of the properties had changed.)
204     \endlist
205 \li \l Binding:
206     \list
207     \li This type can now be used as a value source, and will also restore any previously set binding when its \l{Binding::}{when} clause becomes false.
208     \endlist
209 \endlist
210
211
212 \section1 Qt 5.0 - Additional QML Modules
213
214 \section2 QtQuick.Particles
215
216 The new QtQuick.Particles module provides particle system support for creating a variety of 2D particle systems. See the QtQuick.Particles documentation for comprehensive details.
217
218 \section2 QtQuick.XmlListModel
219
220 XmlListModel has now moved into its own module, QtQuick.XmlListModel. This module must now be imported to use the XmlListModel and XmlRole types.
221
222
223 */