Text format AutoText should use StyledText instead of RichText.
[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 QSGView
43 \o QSGCanvas
44 \o QSGItem
45 \o QSGPaintedItem
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 now propagates clicked, doubleClicked and pressAndHold differently to pressed. 
90 These will 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
93 The Binding element can now be used as a value source, and will also restore any previously
94 set binding when its \e when clause becomes false.
95
96 Flickable: added dragging, draggingHorizontally and draggingVerically properties.
97 Added topMargin, bottomMargin, leftMargin, rightMargin, xOrigin, yOrigin properties.
98
99 Image has two new properties: horizontalAlignment and verticalAlignment. It also has a new value for
100 fillMode (Image.Pad) that does not transform the image.
101
102 Text will now automatically switch to StyledText instead of RichText if textFormat is set to AutoText.
103
104 Grid now has rowSpacing and columnSpacing properties.
105
106 Positioners now have attached properties that can be used to determine a subitem's location within a
107 container such as Column or Row: Positioner.index, Positioner.isFirstItem, Positioner.isLastItem.
108
109 Loader improvements:
110  - "active" property added to Loader, to allow delaying instantiation of a Loader element's item property
111  - "setSource(JSObject)" method added to Loader to allow initial property values to be specified (similar to Component.createObject())
112  - now only emits the \c sourceChanged signal when the source is changed and the
113 \c sourceComponentChanged signal when the sourceComponent is changed. It used to emit both signals when one of the properties was changed.
114
115 PathView now has a \c currentItem property
116
117 ListView and GridView now have headerItem and footerItem properties (the instantiated
118 header and footer items).
119
120 ListView section.labelPositioning property added to allow keeping the current section label
121 at the start and/or next section label at the end of the view.
122
123
124 \section2 QtQuick 1 is now a separate library and module
125
126 Writing C++ applications using QtQuick 1 specific API, i.e. QDeclarativeView or QDeclarativeItem
127 requires adding the "qtquick1" module to the .pro file, e.g. QT += declarative qtquick1
128
129 QDeclarativeView and QDeclarativeItem headers are now in the QtQuick 1 module, i.e.
130 #include <QtQuick1/QDeclarativeView>
131 #include <QtQuick1/QDeclarativeItem>
132
133 "import QtQuick 1.0" loads the module dynamically.  To deploy QtQuick 1 applications
134 the library (lib/libQtQuick1*) and plugin (imports/QtQuick/) must be installed.
135
136 \sa {What's New in Qt Quick 1}{What's New in Qt Quick 1}
137
138 */