Remove "All rights reserved" line from license headers.
[profile/ivi/qtdeclarative.git] / doc / src / declarative / whatsnew.qdoc
index bf4b0df..3121080 100644 (file)
 /****************************************************************************
 **
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
 **
 ** This file is part of the documentation of the Qt Toolkit.
 **
 ** $QT_BEGIN_LICENSE:FDL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
 ** GNU Free Documentation License
 ** Alternatively, this file may be used under the terms of the GNU Free
 ** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of this
-** file.
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
 **
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
 ** $QT_END_LICENSE$
 **
 ****************************************************************************/
 
 /*!
-\title What's new in Qt Quick
-\page qtquick-whatsnew.html
+\title What's New in Qt Quick 2
+\page qtquick2-whatsnew.html
+\inqmlmodule QtQuick 2
 
 \section1 Qt 5.0.0 includes QtQuick 2.0
 
 QtQuick 2.0 is a major update.
 
-MouseArea now propagates clicked, doubleClicked and pressAndHold differently.
+\section2 SceneGraph renderer
 
-\section1 Qt 4.7.4 includes QtQuick 1.1
+QtQuick 2 is based on an OpenGL scenegraph.  The following
+classes replace their equivalents in QtQuick 1:
 
-QtQuick 1.1 is a minor feature update.  \e {import QtQuick 1.1} to use the new features.
+\list
+\o QQuickView
+\o QQuickCanvas
+\o QQuickItem
+\o QQuickPaintedItem
+\endlist
 
-\section2 PinchArea
+\section2 QML Engine/Language Improvements
 
-PinchArea provides support for the common two finger pinch gesture.
+JS engine changed to V8. For most QML users this should not make a visible difference beyond performance improvements, however a lot of undefined behavior semantics may have changed as well. As always, it is recommended not to rely on undefined behavior.
 
-\section2 LayoutMirroring attached property
+Parser and compiler optimizations.
 
-\l {LayoutMirroring}{Layout mirroring} is useful when you need to support both left-to-right and right-to-left layout versions of your application that target different language areas.
+New binding optimizer.
 
-\section2 Anchors
+ValueType improvements:
+ - QColor is now a value type.  The red, green, blue and alpha channels can be accessed via "r", "g", "b" and "a" properties
+ - Improved support for QVector4D, now constructible in QML via Qt.vector4d()
 
-Added the following property:
-\list
-\o \l {Item::}{anchors.mirrored}
-\endlist
+Arbitrary functionality may be provided in a namespace through a Module API.  See \l{qmlRegisterModuleApi()} for more information.
 
-\section2 Text
+JavaScript (.js) files may now import QML modules and other JavaScript files.  See \l{Importing One JavaScript File From Another} for more information.
 
-Added the following properties:
-\list
-\o \l {Text::}{lineHeight}
-\o \l {Text::}{lineHeightMode}
-\o \l {Text::}{lineCount}
-\o \l {Text::}{maximumLineCount}
-\o \l {Text::}{truncated}
-\o \l {Text::}{effectiveHorizontalAlignment}
-\endlist
+A new property type "var" has been added which obsoletes the old "variant" property type.
+Properties of the "var" type may hold JavaScript references.  See \l{QML Basic Types} for more information.
 
-horizontalAlignment now accepts Text.AlignJustify alignment mode.
+QML properties of type \c var and \c variant can now hold pixmaps.  See \l{Scarce Resources in JavaScript} for more information
 
-\section2 TextEdit
+QDeclarativeExpression can now be directly (and more efficiently) constructed from a
+QDeclarativeScriptString.
 
-Added the following properties, methods and signal handlers:
-\list
-\o \l {TextEdit::}{canPaste}
-\o \l {TextEdit::}{lineCount}
-\o \l {TextEdit::}{inputMethodComposing}
-\o \l {TextEdit::}{mouseSelectionMode}
-\o \l {TextEdit::}{effectiveHorizontalAlignment}
-\o \l {TextEdit::}{deselect()}
-\o \l {TextEdit::}{isRightToLeft()}
-\o \l {TextEdit::}{moveCursorSelection()} to enable selection by word
-\o \l {TextEdit::}{onLinkActivated}
-\endlist
+Support for certain sequence types (QList<int>, QList<qreal>, QList<bool>, QList<QUrl>, QList<QString> and QStringList) has been improved.
+QObjects can define Q_PROPERTYs of these types which can be accessed transparently from JavaScript.  See the section on
+sequences in \l{Extending QML Functionalities using C++} for more information.
 
-\section2 TextInput
+\section2 Canvas Item
 
-Added the following properties and methods:
-\list
-\o \l {TextInput::}{canPaste}
-\o \l {TextInput::}{inputMethodComposing}
-\o \l {TextInput::}{mouseSelectionMode}
-\o \l {TextInput::}{effectiveHorizontalAlignment}
-\o \l {TextInput::}{deselect()}
-\o \l {TextInput::}{isRightToLeft()}
-\o \l {TextInput::}{moveCursorSelection()} to enable selection by word
-\endlist
+The new \l Canvas item provides a HTML5 canvas like API, with some enhancements:
+1) Supports 2 render targets: Canvas.Image and Canvas.FramebufferObject
+2) Supports background thread rendering
+3) Supports tiled canvas rendering
 
-\section2 Image, BorderImage and AnimatedImage
+The Canvas item supports most of the HTML5 context2d APIs, the API details please look at the canvas item documentation.
 
-Added the following properties:
-\list
-\o \l{Image::}{cache}
-\o \l{Image::}{mirror}
-\endlist
 
-\section2 Item
+\section2 Particle System
 
-Added the following properties:
-\list
-\o \l{Item::}{implicitWidth} and \l{Item::}{implicitHeight}
-\endlist
+The \l{QtQuick.Particles 2}{QtQuick.Particles} module contains elements that can be composed to form 2D particle system.
 
-\section2 Flickable
 
-Added the following methods:
-\list
-\o \l{Flickable::}{resizeContent()}
-\o \l{Flickable::}{returnToBounds()}
-\endlist
+\section2 Element API/Behavior Changes
 
-\section2 MouseArea
+New \l SpriteImage element renders animated sprites and can transition between animations.
+It uses the \l Sprite element to represent each animation.
 
-Added the following property:
-\list
-\o \l{MouseArea::}{preventStealing}
-\endlist
+MouseArea can now propagate clicked, doubleClicked and pressAndHold differently to pressed. 
+These can now be propagated to the highest-stacking-order enabled MouseArea which has a handler for them.
+You can still ignore these events in the handler to let them pass through.
+This behavior is triggered with the new property propagateComposedEvents.
 
-\section2 ListView and GridView
+The Binding element can now be used as a value source, and will also restore any previously
+set binding when its \i when clause becomes false.
 
-Added the following properties and methods:
-\list
-\o \l{ListView::}{layoutDirection}
-\o \l{ListView::}{effectiveLayoutDirection}
-\o \l{ListView::}{positionViewAtBeginning()}
-\o \l{ListView::}{positionViewAtEnd()}
-\endlist
+Flickable: added dragging, draggingHorizontally and draggingVerically properties.
+Added topMargin, bottomMargin, leftMargin, rightMargin, xOrigin, yOrigin properties.
 
-\section2 Flow, Grid and Row
+Image has two new properties: horizontalAlignment and verticalAlignment. It also has a new value for
+fillMode (Image.Pad) that does not transform the image.
 
-Added the following properties:
-\list
-\o \l{Flow::}{layoutDirection}
-\o \l{Flow::}{effectiveLayoutDirection}
-\endlist
+Grid now has rowSpacing and columnSpacing properties.
 
-\section2 Repeater
+Positioners now have attached properties that can be used to determine a subitem's location within a
+container such as Column or Row: Positioner.index, Positioner.isFirstItem, Positioner.isLastItem.
 
-Added the following methods and signal handlers:
-\list
-\o \l{Repeater::}{onItemAdded}
-\o \l{Repeater::}{onItemRemoved}
-\o \l{Repeater::}{itemAt()}
-\endlist
+Loader improvements:
+ - "active" property added to Loader, to allow delaying instantiation of a Loader element's item property
+ - "setSource(JSObject)" method added to Loader to allow initial property values to be specified (similar to Component.createObject())
+ - now only emits the \c sourceChanged signal when the source is changed and the
+\c sourceComponentChanged signal when the sourceComponent is changed. It used to emit both signals when one of the properties was changed.
 
-\section2 Component
+Text improvements:
+ - 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.
+ - a \c doLayout method was added to trigger the layout from Javascript.
+ - now automatically switch to StyledText instead of RichText if textFormat is set to AutoText.
 
-\list
-\o The \l{Component::}{createObject()} method now accepts a map of initial property values for
-the created object.
-\endlist
+TextEdit:
+ - the default value of the textFormat property is now PlainText instead of AutoText.
 
-\section2 Qt
+TextInput has new wrapMode and verticalAlignment properties, and the positionAt function now takes
+a y parameter.
 
-\list
-\o Added the \l {QML:Qt::application}{Qt.application} object to hold generic global application
-properties.
-\endlist
+PathView now has a \c currentItem property
 
-\section2 Other changes
+ListView and GridView:
+ - now have headerItem and footerItem properties (the instantiated header and footer items).
+ - In RightToLeft layout the preferredHighlightBegin/End are now also reversed.
 
-\list
-\o Functions can be \l{Binding Properties from JavaScript}{assigned to properties from JavaScript}
-to create property bindings.
-\o QtQuick now supports Right to Left layout in positioners, views, anchors and text elements.
-\endlist
+ListView section.labelPositioning property added to allow keeping the current section label
+at the start and/or next section label at the end of the view.
 
+A new property type ("var") has been introduced which obsoletes "variant" properties in QML.
+Properties of this type are equivalent to regular JavaScript variables.  See the documentation
+on \l{QML Basic Types} for more information about "var" properties.
 
-\section1 Qt 4.7.1
+New elements have been added for contructing paths: PathArc, PathCurve, PathSvg.
 
-\section2 QtQuick namespace
+\section2 QtQuick 1 is now a separate library and module
 
-In prior Qt releases, all the Qt Quick elements were available in the \e Qt namespace.  
-Starting with Qt 4.7.1, the elements are also available in the \e QtQuick namespace, 
-which improves naming consistency, and allows the development of Qt Quick to occur at 
-a faster rate than Qt's usual minor release schedule.
+Writing C++ applications using QtQuick 1 specific API, i.e. QDeclarativeView or QDeclarativeItem
+requires adding the "qtquick1" module to the .pro file, e.g. QT += declarative qtquick1
 
-The change for developers is very simple - where you previously wrote \e {import Qt 4.7},
-just replace it with \e {import QtQuick 1.0}, like this:
+QDeclarativeView and QDeclarativeItem headers are now in the QtQuick 1 module, i.e.
+#include <QtQuick1/QDeclarativeView>
+#include <QtQuick1/QDeclarativeItem>
 
-\code
-import QtQuick 1.0 
+"import QtQuick 1.0" loads the module dynamically.  To deploy QtQuick 1 applications
+the library (lib/libQtQuick1*) and plugin (imports/QtQuick/) must be installed.
 
-Text {
-    text: "Welcome to QtQuick 1.0!"
-}
-\endcode
+\sa {What's New in Qt Quick 1}{What's New in Qt Quick 1}
 
-\e {import Qt 4.7} continues to work so existing applications wont break even if they 
-aren't updated, but it is recommended that all import statements be modified to the new 
-form.
 */