Add propagateComposedEvents property to MouseArea
[profile/ivi/qtdeclarative.git] / doc / src / declarative / whatsnew.qdoc
1 /****************************************************************************
2 **
3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: Nokia Corporation (qt-info@nokia.com)
6 **
7 ** This file is part of the documentation of the Qt Toolkit.
8 **
9 ** $QT_BEGIN_LICENSE:FDL$
10 ** GNU Free Documentation License
11 ** Alternatively, this file may be used under the terms of the GNU Free
12 ** Documentation License version 1.3 as published by the Free Software
13 ** Foundation and appearing in the file included in the packaging of
14 ** this file.
15 **
16 ** Other Usage
17 ** Alternatively, this file may be used in accordance with the terms
18 ** and conditions contained in a signed written agreement between you
19 ** and Nokia.
20 **
21 **
22 **
23 **
24 ** $QT_END_LICENSE$
25 **
26 ****************************************************************************/
27
28 /*!
29 \title What's New in Qt Quick 2
30 \page qtquick2-whatsnew.html
31
32 \section1 Qt 5.0.0 includes QtQuick 2.0
33
34 QtQuick 2.0 is a major update.
35
36 \section2 SceneGraph renderer
37
38 QtQuick 2 is based on an OpenGL scenegraph.  The following
39 classes replace their equivalents in QtQuick 1:
40
41 \list
42 \o QQuickView
43 \o QQuickCanvas
44 \o QQuickItem
45 \o QQuickPaintedItem
46 \endlist
47
48 \section2 QML Engine/Language Improvements
49
50 JS engine changed to V8.
51
52 Parser and compiler optimizations.
53
54 New binding optimizer.
55
56 ValueType improvements:
57  - QColor is now a value type.  The red, green, blue and alpha channels can be accessed via "r", "g", "b" and "a" properties
58  - Improved support for QVector4D, now constructible in QML via Qt.vector4d()
59
60 Arbitrary functionality may be provided in a namespace through a Module API.  See \l{qmlRegisterModuleApi()} for more information.
61
62 JavaScript (.js) files may now import QML modules and other JavaScript files.  See \l{Importing One JavaScript File From Another} for more information.
63
64 QML properties of type \c variant can now hold pixmaps.  See \l{Scarce Resources in JavaScript} for more information
65
66 QDeclarativeExpression can now be directly (and more efficiently) constructed from a
67 QDeclarativeScriptString.
68
69 \section2 Canvas Item
70
71 The new \l Canvas item provides a HTML5 canvas like API, with some enhancements:
72 1) Supports 2 render targets: Canvas.Image and Canvas.FramebufferObject
73 2) Supports background thread rendering
74 3) Supports tiled canvas rendering
75
76 The Canvas item supports most of the HTML5 context2d APIs, the API details please look at the canvas item documentation.
77
78
79 \section2 Particle System
80
81 The \l{QtQuick.Particles 2}{QtQuick.Particles} module contains elements that can be composed to form 2D particle system.
82
83
84 \section2 Element API/Behavior Changes
85
86 New \l SpriteImage element renders animated sprites and can transition between animations.
87 It uses the \l Sprite element to represent each animation.
88
89 MouseArea can now propagate clicked, doubleClicked and pressAndHold differently to pressed. 
90 These can now be propagated to the highest-stacking-order enabled MouseArea which has a handler for them.
91 You can still ignore these events in the handler to let them pass through.
92 This behavior is triggered with the new property propagateComposedEvents.
93
94 The Binding element can now be used as a value source, and will also restore any previously
95 set binding when its \i when clause becomes false.
96
97 Flickable: added dragging, draggingHorizontally and draggingVerically properties.
98 Added topMargin, bottomMargin, leftMargin, rightMargin, xOrigin, yOrigin properties.
99
100 Image has two new properties: horizontalAlignment and verticalAlignment. It also has a new value for
101 fillMode (Image.Pad) that does not transform the image.
102
103 Grid now has rowSpacing and columnSpacing properties.
104
105 Positioners now have attached properties that can be used to determine a subitem's location within a
106 container such as Column or Row: Positioner.index, Positioner.isFirstItem, Positioner.isLastItem.
107
108 Loader improvements:
109  - "active" property added to Loader, to allow delaying instantiation of a Loader element's item property
110  - "setSource(JSObject)" method added to Loader to allow initial property values to be specified (similar to Component.createObject())
111  - now only emits the \c sourceChanged signal when the source is changed and the
112 \c sourceComponentChanged signal when the sourceComponent is changed. It used to emit both signals when one of the properties was changed.
113
114 Text improvements:
115  - a \c onLineLaidOut handler is called for every line during the layout process. This gives the opportunity to position and resize a line as it is being laid out.
116  - a \c doLayout method was added to trigger the layout from Javascript.
117  - now automatically switch to StyledText instead of RichText if textFormat is set to AutoText.
118
119 PathView now has a \c currentItem property
120
121 ListView and GridView:
122  - now have headerItem and footerItem properties (the instantiated header and footer items).
123  - In RightToLeft layout the preferredHighlightBegin/End are now also reversed.
124
125 ListView section.labelPositioning property added to allow keeping the current section label
126 at the start and/or next section label at the end of the view.
127
128 A new property type ("var") has been introduced which obsoletes "variant" properties in QML.
129 Properties of this type are equivalent to regular JavaScript variables.  See the documentation
130 on \l{QML Basic Types} for more information about "var" properties.
131
132 \section2 QtQuick 1 is now a separate library and module
133
134 Writing C++ applications using QtQuick 1 specific API, i.e. QDeclarativeView or QDeclarativeItem
135 requires adding the "qtquick1" module to the .pro file, e.g. QT += declarative qtquick1
136
137 QDeclarativeView and QDeclarativeItem headers are now in the QtQuick 1 module, i.e.
138 #include <QtQuick1/QDeclarativeView>
139 #include <QtQuick1/QDeclarativeItem>
140
141 "import QtQuick 1.0" loads the module dynamically.  To deploy QtQuick 1 applications
142 the library (lib/libQtQuick1*) and plugin (imports/QtQuick/) must be installed.
143
144 \sa {What's New in Qt Quick 1}{What's New in Qt Quick 1}
145
146 */