QQuickCanvas renames
[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 convenience window for rendering a QML scene from a QML file (replaces \c QDeclarativeView)
49 \li QQuickWindow - a base window 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
52     QDeclarativeImageProvider)
53 \li QQuickTextureFactory - use with QQuickImageProvider::requestTexture()
54 \endlist
55
56 Custom rendering can be performed on the scenegraph using the following new classes:
57
58 \list
59 \li QSGNode
60 \li QSGMaterial
61 \li QSGBasicGeometryNode
62 \li QSGGeometryNode
63 \li QSGClipNode
64 \li QSGTransformNode
65 \li QSGRootNode
66 \li QSGOpacityNode
67 \li QSGNodeVisitor
68 \li QSGFlatColorMaterial
69 \li QSGSimpleRectNode
70 \li QSGSimpleTextureNode
71 \li QSGTexture
72 \li QSGDynamicTexture
73 \li QSGOpaqueTextureMaterial
74 \li QSGTextureMaterial
75 \li QSGTextureProvider
76 \li QSGVertexColorMaterial
77 \endlist
78
79
80 \section1 Qt 5.0 - QtQuick QML Module
81
82 The QtQuick 2.0 QML module is a major update.
83
84 Below are the additions and changes in QtQuick 2.0.
85
86 \section2 Visual types, Graphical Effects and Sprites
87
88 \list
89 \li New \l Canvas type for drawing. This provides an API similar to that of the HTML5 Canvas API,
90     along with some additional features.
91     \list
92     \li Supports two render targets: \c Canvas.Image and \c Canvas.FramebufferObject.
93     \li Supports background thread rendering.
94     \li Supports tiled canvas rendering.
95     \li Supports most of the HTML5 context2d APIs.
96     \endlist
97 \li \l Item:
98     \list
99     \li New \l{Item::}{layer.enabled} property enables an item to be rendered into an offscreen
100         cache for optimization.
101     \li New \l{Item::}{contains()} method returns whether an item contains a specified point.
102     \li New \l{Item::}{anchors.alignWhenCentered} property can force centered anchors to align on a
103         whole pixel.
104     \endlist
105 \li \l Image:
106     \list
107     \li New \l{Image::}{horizontalAlignment} and \l{Image::}{verticalAlignment} properties to set
108         the image alignment.
109     \li New \c Image.Pad enumeration value for \l{Image::}{fillMode} that does not transform the image,
110         unlike other \l{Image::}{fillMode} enumeration values.
111     \li Modifying the \l{Image::}{sourceSize} now fits the image to the size, maintaining aspect
112         ratio.
113     \endlist
114 \li New ShaderEffect and ShaderEffectSource types enable GLSL shader programs to be integrated
115     directly into QML code and applied to QML items and images. (This obsoletes the experimental
116     Qt.labs.shaders module.)
117 \li New SpriteSequence type renders animated sprites and can transition between animations. Each
118     animation in a sequence is represented by the new \l Sprite type.
119 \li New AnimatedSprite type for drawing single sprite animations.
120 \endlist
121
122
123 \section2 Animations and Transitions
124 \list
125 \li New AnimationController type enables an animation to be manually driven by a
126     \l{AnimationController::}{progress} value.
127 \li New PathAnimation type animates an item along a \l Path.
128 \li New PathInterpolator type provides updated attribute values for an item animating along a path.
129     It can be used as an low-level alternative to PathAnimation.
130 \li \l Transition:
131     \list
132     \li New \l{Transition::}{running} property holds whether a transition is currently running.
133     \li New \l{Transition::}{enabled} property controls whether a transition is enabled.
134     \endlist
135 \endlist
136
137
138 \section2 Paths
139 \list
140 \li New PathArc type creates an arc-type path.
141 \li New PathCurve type creates a catmull-rom curve path.
142 \li New PathSvg type creates a path from a SVG string.
143 \li Changes common to PathLine, PathQuad and PathCubic:
144     \list
145     \li New \c relativeX and \c relativeY properties define the start and end points of a path
146 relative to its start.
147     \endlist
148 \li PathCubic only:
149     \list
150     \li New \l{PathCubic::}{relativeControl1X}, \l{PathCubic::}{relativeControl1Y},
151         \l{PathCubic::}{relativeControl2X} and \l{PathCubic::}{relativeControl2Y} properties define the
152         positions of the control points relative to the start of the curve.
153     \endlist
154 \li PathQuad only:
155     \list
156     \li New \l{PathQuad::}{relativeControlX} and \l{PathQuad::}{relativeControlY}
157         define the positions of the control points relative to the start of the curve.
158     \endlist
159 \endlist
160
161
162 \section2 Text
163
164 \list
165 \li Changes common to \l Text, TextEdit and TextInput:
166     \list
167     \li New \c contentWidth and \c contentHeight properties provide the dimensions of the textual
168         content.
169     \li New \c effectiveHorizontalAlignment property provides the read-only actual horizontal
170         alignment.
171     \endlist
172 \li Changes common to both TextEdit and TextInput:
173     \list
174     \li New \c canUndo and \c canRedo properties specify whether undo and redo operations are
175         available.
176     \li New \c getText() method returns the text located between specified start and end indexes.
177         Additionally TextEdit has a \l{TextEdit::}{getFormattedText()} method that returns the formatted
178         text.
179     \li \c openSoftwareInputPanel() and \c closeSoftwareInputPanel() methods have been removed. Use
180         \c Qt.application.inputMethod.show() and \c Qt.application.inputMethod.hide() instead.
181     \endlist
182 \li \l Text only:
183     \list
184     \li When \l{Text::}{textFormat} is set to \c Text.AutoText format, the text object will
185         automatically switch to \c Text.StyledText instead of \c Text.RichText.
186     \li \c Text.RightElide is now supported where text spans multiple lines.
187     \li New \l{Text::}{linkColor} property controls the color of linked text.
188     \li New \l{Text::}{onLineLaidOut} handler is called for every line during the layout process to
189         give the option of positioning and/or resizing lines as they are laid out.
190     \li New \l{Text::}{doLayout()} method will trigger the text layout from Javascript.
191     \li New \l{Text::}{fontSizeMode} property allows text to be fitted to the item size.
192     \li New \l{Text::}{minimumPixelSize} and \l {Text::}{minimumPointSize} properties can be used to
193         specify a lower bound when auto-fitting.
194     \endlist
195 \li TextEdit only:
196     \list
197     \li \l{TextEdit::}{textFormat} property now defaults to \c PlainText instead of \c AutoText.
198     \li New \l{TextEdit::}{baseUrl} property specified the base URL used to resolve relative URLs
199         within the text.
200     \endlist
201 \li TextInput only:
202     \list
203     \li New \l{TextInput::}{wrapMode} property sets the text wrapping mode.
204     \li New \l{TextInput::}{horizontalAlignment} and \l{TextInput::}{verticalAlignment} properties.
205     \li New \l{TextInput::}{length} property provides the total number of text characters.
206     \li New \l{TextInput::}{persistentSelection} property enables the text selection to persist when
207 the window loses focus.
208     \li \l{TextInput::}{positionAt()} method now takes a y parameter.
209     \endlist
210 \endlist
211
212 \section2 User Input
213
214 \list
215 \li New MultiPointTouchArea type processes multi-point touches and provides information on touch
216     points including position, pressure and velocity. Touch point data is provided by the new \l
217     TouchPoint type.
218 \li New DropArea type provides more advanced drag and drop functionality.
219 \li MouseArea:
220     \list
221     \li Wheel events are now supported; events are provided through the new WheelEvent type.
222     \li The \l{MouseArea::}{onClicked}, \l{MouseArea::}{onDoubleClicked} and
223         \l{MouseArea::}{onPressAndHold} signals are now propagated differently to
224         \l{MouseArea::}{onPressed}. These will now be propagated to the highest-stacking-order enabled
225         MouseArea that has implemented the relevant handlers. You can still ignore these events in the
226         handler to let them pass through; this behavior is triggered with the new property
227         \l{MouseArea::}{propagateComposedEvents}.
228     \li New \l{MouseArea::}{propagateComposedEvents} property sets whether composed events are
229         propagated to other mouse areas.
230     \li New \l{MouseArea::}{cursorShape} property controls the cursor shape.
231         \endlist
232 \endlist
233
234 \section2 Specialised Containers
235
236 \list
237 \li Flickable:
238     \list
239     \li New \l{Flickable::}{rebound} property specifies the transition to be applied when a
240         flickable snaps back to its bounds.
241     \li New \l{Flickable::}{topMargin}, \l{Flickable::}{bottomMargin}, \l{Flickable::}{leftMargin},
242         \l{Flickable::}{rightMargin} allow extra margin space to be specified for a flickable. This can be
243         used, for example, to implement pull-to-refresh functionality for a list.
244     \li New \l{Flickable::}{originX} and \l{Flickable::}{originY} properties provide the top left
245         position of the content item.
246     \li New \l{Flickable::}{dragging}, \l{Flickable::}{draggingHorizontally} and
247         \l{Flickable::}{draggingVertically} properties provide information on whether a flickable is
248         currently being dragged.
249     \li New \l{Flickable::}{flick()} method flicks the view with a specific velocity.
250     \li New \l{Flickable::}{cancelFlick()} method stops any current flicking movement.
251     \endlist
252 \endlist
253
254 \section2 Positioners (Row, Column, Grid, Flow types):
255
256 \list
257 \li Changes common to \l Row, \l Column, \l Grid and \l Flow:
258     \list
259     \li The \c add and \c move transitions can access a new ViewTransition attached property (see
260         the ViewTransition documentation for examples) and can now animate arbitrary item properties
261         (instead of being restricted to animating an item's position).
262     \li New \c effectiveLayoutDirection property provides the read-only actual layout direction of a
263         positioner.
264     \li New \l Positioner type provides \c index, \c isFirstItem and \c isLastItem attached
265         properties for items within positioners.
266     \li All \c spacing properties on positioners now use real numbers instead of integers.
267     \endlist
268 \li Grid only:
269     \list
270     \li New \l{Grid::}{rowSpacing} and \l{Grid::}{columnSpacing} properties.
271     \endlist
272 \endlist
273
274 \section2 Models and Views
275
276 \list
277 \li ListModel:
278     \list
279     \li By default, roles can no longer change type during a model's lifetime. The new
280         \l{ListModel::}{dynamicRoles} property can be set to restore the original (less performant)
281         behavior.
282     \endlist
283 \li VisualDataModel:
284     \list
285     \li Now has features to filter the items to be displayed in a view. This is supported by the new
286         \l {VisualDataModel::}{groups}, \l {VisualDataModel::}{filterOnGroup}, \l {VisualDataModel::}{items}
287         and \l {VisualDataModel::}{persistedItems} properties.
288     \endlist
289 \li Changes common to both ListView and GridView:
290     \list
291     \li New transition support for animating the adding, removing and moving of items in a ListView
292         or GridView. See the ViewTransition documentation for details.
293     \li New \c verticalLayoutDirection property enables items to be laid out from bottom-to-top
294         using the new \c BottomToTop enumeration value.
295     \li New \c headerItem and \c footerItem properties provide access to the instantiated header and
296         footer items.
297     \li The \c cacheBuffer property now has a non-zero default.
298     \li Delegates in the cache buffer are now created asynchronously.
299     \li Setting a \c RightToLeft layout now also reverses the \c preferredHighlightBegin and \c
300         preferredHighlightEnd.
301     \endlist
302 \li ListView only:
303     \list
304     \li New \l{ListView::}{section.labelPositioning} property can fix the current section label to
305         the start of the view, and the next section label to the end of the view, to prevent labels from
306         scrolling while section items are still in view.
307     \li \c highlightMoveSpeed and \c highlightResizeSpeed have been renamed to
308         \l{ListView::}{highlightMoveVelocity} and \l{ListView::}{highlightResizeVelocity}.
309     \endlist
310 \li GridView only:
311     \list
312     \li \l{GridView::}{cellWidth} and \l{GridView::}{cellHeight} now use real numbers instead of
313         integers.
314     \endlist
315 \li PathView:
316     \list
317     \li New \l{PathView::}{currentItem} property holds the current item in the view.
318     \li New \l{PathView::}{maximumFlickVelocity} property controls the maximum flick velocity of the
319         view.
320     \li New \l{PathView::}{snapMode} property controls the snap model when flicking between items
321     \endlist
322 \endlist
323
324 \section2 Utility types
325
326 \list
327 \li New \l Accessible attached property for implementing accessibility features in QML applications.
328 \li \l Loader:
329     \list
330     \li New \l{Loader::}{asynchronous} property allows components to be instantiated with lower
331         chance of blocking.  If source is used with \e {asynchonous: true} the component will be compiled in
332         a background thread.
333     \li New \l{Loader::}{active} property can delay instantiation of a \l Loader object's
334         \l{Loader::}{item}.
335     \li New \l{Loader::}{setSource()} method loads an object with specific initial property values,
336         similar to \l Component::createObject().
337     \li The \c sourceChanged signal is now only emitted when the \l{Loader::}{source} changes and
338         the \c sourceComponentChanged signal is now only emitted when the \l{Loader::}{sourceComponent}
339         changes. (Previously \l Loader emitted both signals when only one of these properties had changed.)
340     \endlist
341 \li \l Binding:
342     \list
343     \li This type can now be used as a value source, and will also restore any previously set
344         binding when its \l{Binding::}{when} clause becomes false.
345     \endlist
346 \endlist
347
348
349 \section1 Qt 5.0 - Additional QML Modules
350
351 \section2 QtQuick.Particles
352
353 This new module provides particle system support for creating a variety of 2D particle systems. See
354 the \l{QtQuick.Particles 2}{QtQuick.Particles} documentation for comprehensive details.
355
356 This obsoletes the experimental \c Qt.labs.particles module.
357
358 \section2 QtQuick.Window
359
360 This new module contains the \l Window type for creating a basic window and the \l Screen type for
361 accessing a screen's resolution and other details. See the \l{QtQuick.Window 2}{QtQuick.Window}
362 documentation for comprehensive details.
363
364 \section2 QtQuick.XmlListModel
365
366 This new module contains XmlListModel and associated types, which were previously in the QtQuick
367 module. See the \l{QtQuick.XmlListModel 2}{QtQuick.XmlListModel} documentation for details.
368
369 \section2 QtQuick.LocalStorage
370
371 This new module provides access to the SQL Local Storage API that was previously accessible from the
372 \l {QML Global Object}. See the \l{QtQuick.LocalStorage 2}{QtQuick.LocalStorage} documentation for details.
373
374 */