diff options
Diffstat (limited to 'doc/src/declarative/extending.qdoc')
-rw-r--r-- | doc/src/declarative/extending.qdoc | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/doc/src/declarative/extending.qdoc b/doc/src/declarative/extending.qdoc index df8a1e7d27..19e9ffcf16 100644 --- a/doc/src/declarative/extending.qdoc +++ b/doc/src/declarative/extending.qdoc @@ -7,11 +7,11 @@ ** This file is part of the documentation of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:FDL$ -** Commercial Usage -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in a -** written agreement between you and Nokia. +** 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 @@ -80,19 +80,14 @@ Types can be registered by libraries, application code, or by plugins Once registered, all \l {Qt's Property System}{properties} of the supported types are available in QML. QML has intrinsic support for -properties of these types: +properties of the types listed in the \l{Extending Types from QML} +document, including the following: \list -\o bool -\o unsigned int, int -\o float, double, qreal -\o QString -\o QUrl -\o QColor +\o bool, unsigned int, int, float, double, qreal +\o QString, QUrl, QColor \o QDate, QTime, QDateTime -\o QPoint, QPointF -\o QSize, QSizeF -\o QRect, QRectF +\o QPoint, QPointF, QSize, QSizeF, QRect, QRectF \o QVariant \endlist @@ -432,7 +427,7 @@ on<Property-name>Changed, regardless of the name used for the NOTIFY signal in C++. We recommend using <property-name>Changed() for the NOTIFY signal in C++. -See also \l {Extending types from QML}. +See also \l {Extending Types from QML}. \section1 Methods @@ -640,7 +635,7 @@ public: /*! \page qml-extending-types.html -\title Extending types from QML +\title Extending Types from QML Many of the elements available for use in QML are implemented in \l {Extending QML in C++}{C++}. These types are know as "core types". QML @@ -652,7 +647,8 @@ language. \section1 Adding new properties -New properties can be added to an existing type. These new properties are +New properties can be added to an existing type using the \c property keyword. +These new properties are available for use within QML, and also appear as regular Qt properties on the C++ object, accessible through the regular property access mechanisms. @@ -684,8 +680,12 @@ like this: property list<Item> listOfItemsProperty \endcode +Custom types must be registered with qmlRegisterType() to be usable as a property +type. Also note that list properties cannot be modified like ordinary JavaScript +arrays; see the \l {list}{list type documentation} for details. + QML supports two methods for adding a new property to a type: a new property -definition, and a property alias. +definition, and a property alias. These are shown below. \section2 Property definitions |