Update whatsnew documentation with value-type improvements
authorChris Adams <christopher.adams@nokia.com>
Thu, 26 Jul 2012 00:51:50 +0000 (10:51 +1000)
committerQt by Nokia <qt-info@nokia.com>
Fri, 27 Jul 2012 04:09:11 +0000 (06:09 +0200)
Value types are now supported as property types.  QtQuick provides
several new value types.  Subproperty modification write-back
semantics have been fixed for variant properties.

Change-Id: Ic47a8401178e6f8bbd5037b6929d7afd5e3cffe6
Reviewed-by: Bea Lam <bea.lam@nokia.com>
src/qml/doc/src/whatsnew.qdoc
src/quick/doc/src/whatsnew.qdoc

index d66d78d..253c89c 100644 (file)
@@ -71,8 +71,13 @@ has now been replaced by the new QtQml and QtQuick C++ modules. See the
 \li QML properties of type \l var and \l variant can now hold pixmaps. See \l {Scarce Resources in JavaScript} for more information.
 \li Value type improvements:
     \list
-    \li QColor is now a value type.  The red, green, blue and alpha channels of a \l color property can be accessed via \c r, \c g, \c b and \c a properties.
-    \li Improved support for QVector4D, now constructible in QML via \c Qt.vector4d().
+    \li QML now supports defining properties of value type basic types within QML documents.  Supported types include
+        QSizeF, QPointF and QRectF as \c size, \c point and \c rect respectively.
+    \li QColor is now a value type provided by the QtQuick module.  The red, green, blue and alpha channels
+        of a \l color property can be accessed via \c r, \c g, \c b and \c a properties.
+    \li Factory functions for various value types have been added to the \c Qt object exposed to QML.
+        Some of those functions require the QtQuick module to be imported in order to return valid values.
+        See the QtQuick 2.0 release notes for more information about these functions.
     \endlist
 \li Support for sequence types QList<int>, QList<qreal>, QList<bool>, QList<QUrl>,
     QList<QString> and QStringList has been improved. QObjects can define Q_PROPERTYs of
index 8eff21e..4b6ea36 100644 (file)
@@ -353,6 +353,52 @@ the window loses focus.
     \endlist
 \endlist
 
+\section2 Property types
+
+Support for various math and geometry-related value types, including QVector2D, QVector3D, QVector4D,
+QMatrix4x4 and QQuaternion, as well as QColor and QFont, are now provided by QtQuick.  Properties of
+these types can be declared in QML documents via the property syntax where the type name is \c vector2d,
+\c vector3d, \c vector4d, \c matrix4x4, \c quaternion, \c color and \c font respectively.
+
+QtQuick also provides implementation for the various value type factory or utility functions of the
+\c Qt object which return or operate on values of the above types.  The functions are:
+\table
+  \header
+  \li Value type
+  \li Functions
+
+  \row
+  \li color
+  \li Qt.rgba(), Qt.hsla(), Qt.tint(), Qt.lighter(), Qt.darker(), Qt.colorEqual()
+
+  \row
+  \li font
+  \li Qt.font(), Qt.fontFamilies()
+
+  \row
+  \li vector2d
+  \li Qt.vector2d()
+
+  \row
+  \li vector3d
+  \li Qt.vector3d()
+
+  \row
+  \li vector4d
+  \li Qt.vector4d()
+
+  \row
+  \li matrix4x4
+  \li Qt.matrix4x4()
+
+  \row
+  \li quaternion
+  \li Qt.quaternion()
+\endtable
+
+The \c Qt.rgba(), \c Qt.hsla(), \c Qt.tint(), \c Qt.lighter(), \c Qt.darker()
+and \c Qt.fontFamilies() functions already existed in \c QtDeclarative prior
+to QtQuick 2.0; the other functions are all new in QtQuick 2.0.
 
 \section1 Qt 5.0 - Additional QML Modules