1 /****************************************************************************
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/
6 ** This file is part of the documentation of the Qt Toolkit.
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
16 ** Alternatively, this file may be used in accordance with the terms
17 ** and conditions contained in a signed written agreement between you
26 ****************************************************************************/
29 \title QtQuick Module Release Notes
30 \page qtquick-releasenotes.html
31 \inqmlmodule QtQuick 2.0
33 \section1 Qt 5.0 - QtQuick C++ Module
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.
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.)
43 The following classes provide the basic functionality for interacting with the QML visual
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
52 QDeclarativeImageProvider)
53 \li QQuickTextureFactory - use with QQuickImageProvider::requestTexture()
56 Custom rendering can be performed on the scenegraph using the following new classes:
61 \li QSGBasicGeometryNode
68 \li QSGFlatColorMaterial
70 \li QSGSimpleTextureNode
73 \li QSGOpaqueTextureMaterial
74 \li QSGTextureMaterial
75 \li QSGTextureProvider
76 \li QSGVertexColorMaterial
80 \section1 Qt 5.0 - QtQuick QML Module
82 The QtQuick 2.0 QML module is a major update.
84 Below are the additions and changes in QtQuick 2.0.
86 \section2 Visual types, Graphical Effects and Sprites
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.
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.
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
107 \li New \l{Image::}{horizontalAlignment} and \l{Image::}{verticalAlignment} properties to set
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
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.
123 \section2 Animations and Transitions
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.
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.
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:
145 \li New \c relativeX and \c relativeY properties define the start and end points of a path
146 relative to its start.
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.
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.
165 \li Changes common to \l Text, TextEdit and TextInput:
167 \li New \c contentWidth and \c contentHeight properties provide the dimensions of the textual
169 \li New \c effectiveHorizontalAlignment property provides the read-only actual horizontal
172 \li Changes common to both TextEdit and TextInput:
174 \li New \c canUndo and \c canRedo properties specify whether undo and redo operations are
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
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.
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.
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
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.
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
218 \li New DropArea type provides more advanced drag and drop functionality.
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.
234 \section2 Specialised Containers
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.
254 \section2 Positioners (Row, Column, Grid, Flow types):
257 \li Changes common to \l Row, \l Column, \l Grid and \l Flow:
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
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.
270 \li New \l{Grid::}{rowSpacing} and \l{Grid::}{columnSpacing} properties.
274 \section2 Models and Views
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)
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.
289 \li Changes common to both ListView and GridView:
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
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.
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}.
312 \li \l{GridView::}{cellWidth} and \l{GridView::}{cellHeight} now use real numbers instead of
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
320 \li New \l{PathView::}{snapMode} property controls the snap model when flicking between items
324 \section2 Utility types
327 \li New \l Accessible attached property for implementing accessibility features in QML applications.
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
333 \li New \l{Loader::}{active} property can delay instantiation of a \l Loader object's
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.)
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.
349 \section1 Qt 5.0 - Additional QML Modules
351 \section2 QtQuick.Particles
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.
356 This obsoletes the experimental \c Qt.labs.particles module.
358 \section2 QtQuick.Window
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.
364 \section2 QtQuick.XmlListModel
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.
369 \section2 QtQuick.LocalStorage
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.