1 /****************************************************************************
3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: Nokia Corporation (qt-info@nokia.com)
7 ** This file is part of the documentation of the Qt Toolkit.
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
17 ** Alternatively, this file may be used in accordance with the terms
18 ** and conditions contained in a signed written agreement between you
26 ****************************************************************************/
29 \title What's New in Qt Quick
30 \page qtquick-whatsnew.html
32 \section1 Qt 5.0.0 includes QtQuick 2.0
34 QtQuick 2.0 is a major update.
36 MouseArea now propagates clicked, doubleClicked and pressAndHold differently to pressed.
37 These will now be propagated to the highest-stacking-order enabled MouseArea which has a handler for them.
38 You can still ignore these events in the handler to let them pass through.
40 The Binding element can now be used as a value source, and will also restore any previously
41 set binding when its \e when clause becomes false.
43 QDeclarativeExpression can now be directly (and more efficiently) constructed from a
44 QDeclarativeScriptString.
46 \section2 QtQuick 1 is now a separate library and module
48 Writing C++ applications using QtQuick 1 specific API, i.e. QDeclarativeView or QDeclarativeItem
49 requires adding the "qtquick1" module to the .pro file, e.g. QT += declarative qtquick1
51 QDeclarativeView and QDeclarativeItem headers are now in the QtQuick 1 module, i.e.
52 #include <QtQuick1/QDeclarativeView>
53 #include <QtQuick1/QDeclarativeItem>
55 "import QtQuick 1.0" loads the module dynamically. To deploy QtQuick 1 applications
56 the library (lib/libQtQuick1*) and plugin (imports/QtQuick/) must be installed.
59 \section1 Qt 4.7.4 includes QtQuick 1.1
61 QtQuick 1.1 is a minor feature update. \e {import QtQuick 1.1} to use the new
66 PinchArea provides support for the common two finger pinch gesture.
68 \section2 LayoutMirroring attached property
70 \l {LayoutMirroring}{Layout mirroring} is useful when you need to support both
71 left-to-right and right-to-left layout versions of your application that target
72 different language areas.
76 Added the following property:
78 \o \l {Item::}{anchors.mirrored}
83 Added the following properties:
85 \o \l {Text::}{lineHeight}
86 \o \l {Text::}{lineHeightMode}
87 \o \l {Text::}{lineCount}
88 \o \l {Text::}{maximumLineCount}
89 \o \l {Text::}{truncated}
90 \o \l {Text::}{effectiveHorizontalAlignment}
93 horizontalAlignment now accepts Text.AlignJustify alignment mode.
97 Added the following properties, methods and signal handlers:
99 \o \l {TextEdit::}{canPaste}
100 \o \l {TextEdit::}{lineCount}
101 \o \l {TextEdit::}{inputMethodComposing}
102 \o \l {TextEdit::}{mouseSelectionMode}
103 \o \l {TextEdit::}{effectiveHorizontalAlignment}
104 \o \l {TextEdit::}{deselect()}
105 \o \l {TextEdit::}{isRightToLeft()}
106 \o \l {TextEdit::}{moveCursorSelection()} to enable selection by word
107 \o \l {TextEdit::}{onLinkActivated}
112 Added the following properties and methods:
114 \o \l {TextInput::}{canPaste}
115 \o \l {TextInput::}{inputMethodComposing}
116 \o \l {TextInput::}{mouseSelectionMode}
117 \o \l {TextInput::}{effectiveHorizontalAlignment}
118 \o \l {TextInput::}{deselect()}
119 \o \l {TextInput::}{isRightToLeft()}
120 \o \l {TextInput::}{moveCursorSelection()} to enable selection by word
123 \section2 Image, BorderImage and AnimatedImage
125 Added the following properties:
127 \o \l{Image::}{cache}
128 \o \l{Image::}{mirror}
133 Added the following properties:
135 \o \l{Item::}{implicitWidth} and \l{Item::}{implicitHeight}
140 Added the following methods:
142 \o \l{Flickable::}{resizeContent()}
143 \o \l{Flickable::}{returnToBounds()}
148 Added the following property:
150 \o \l{MouseArea::}{preventStealing}
153 \section2 ListView and GridView
155 Added the following properties and methods:
157 \o \l{ListView::}{layoutDirection}
158 \o \l{ListView::}{effectiveLayoutDirection}
159 \o \l{ListView::}{positionViewAtBeginning()}
160 \o \l{ListView::}{positionViewAtEnd()}
163 \section2 Flow, Grid and Row
165 Added the following properties:
167 \o \l{Flow::}{layoutDirection}
168 \o \l{Flow::}{effectiveLayoutDirection}
173 Added the following methods and signal handlers:
175 \o \l{Repeater::}{onItemAdded}
176 \o \l{Repeater::}{onItemRemoved}
177 \o \l{Repeater::}{itemAt()}
183 \o The \l{Component::}{createObject()} method now accepts a map of initial
184 property values for the created object.
190 \o Added the \l {QML:Qt::application}{Qt.application} object to hold generic
191 global application properties.
194 \section2 Other changes
197 \o Functions can be \l{Property Binding#Property Binding}{assigned to properties from JavaScript}
198 to create property bindings.
199 \o QtQuick now supports Right to Left layout in positioners, views, anchors and text elements.
205 \section2 QtQuick namespace
207 In prior Qt releases, all the Qt Quick elements were available in the \e Qt
208 namespace. Starting with Qt 4.7.1, the elements are also available in the
209 \e QtQuick namespace, which improves naming consistency, and allows the
210 development of Qt Quick to occur at a faster rate than Qt's usual minor release
213 The change for developers is very simple - where you previously wrote
214 \e {import Qt 4.7}, just replace it with \e {import QtQuick 1.0}, like this:
220 text: "Welcome to QtQuick 1.0!"
224 \e {import Qt 4.7} continues to work so existing applications won't break even
225 if they aren't updated, but it is recommended that all import statements be
226 modified to the new form.