summaryrefslogtreecommitdiffstats
path: root/doc/src/declarative/qtdeclarative.qdoc
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2011-02-10 22:35:31 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2011-02-10 22:35:31 (GMT)
commitca13ba801144763b1ca7c39b2ef8594de94e2d3e (patch)
tree7600e31df6ce715a5bc28c0c97983bac9484c7cb /doc/src/declarative/qtdeclarative.qdoc
parentab38731fe5dcfaa1a7a70bc290a8856b5b01524d (diff)
parentec20a6da3edea3031f1705c3b13e24dc2c7c6de5 (diff)
downloadQt-ca13ba801144763b1ca7c39b2ef8594de94e2d3e.zip
Qt-ca13ba801144763b1ca7c39b2ef8594de94e2d3e.tar.gz
Qt-ca13ba801144763b1ca7c39b2ef8594de94e2d3e.tar.bz2
Merge remote-tracking branch 'origin/4.7' into HEAD
Diffstat (limited to 'doc/src/declarative/qtdeclarative.qdoc')
-rw-r--r--doc/src/declarative/qtdeclarative.qdoc21
1 files changed, 19 insertions, 2 deletions
diff --git a/doc/src/declarative/qtdeclarative.qdoc b/doc/src/declarative/qtdeclarative.qdoc
index 05dac52..4a6f6a9 100644
--- a/doc/src/declarative/qtdeclarative.qdoc
+++ b/doc/src/declarative/qtdeclarative.qdoc
@@ -56,7 +56,7 @@
\macro QML_DECLARE_TYPE()
\relates QDeclarativeEngine
- Equivalent to \c Q_DECLARE_METATYPE(TYPE) and \c Q_DECLARE_METATYPE(QDeclarativeListProperty<TYPE>)
+ Equivalent to \c Q_DECLARE_METATYPE(TYPE *) and \c Q_DECLARE_METATYPE(QDeclarativeListProperty<TYPE>)
#include <QtDeclarative> to use this macro.
*/
@@ -85,6 +85,21 @@
Returns the QML type id.
+ There are two forms of this template function:
+
+ \code
+ template<typename T>
+ int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const char *qmlName);
+
+ template<typename T, int metaObjectRevision>
+ int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const char *qmlName);
+ \endcode
+
+ The former is the standard form which registers the type \e T as a new type.
+ The latter allows a particular revision of a class to be registered in
+ a specified version (see \l {QML Type Versioning}).
+
+
For example, this registers a C++ class \c MySliderItem as a QML type
named \c Slider for version 1.0 of a \l{QML Modules}{module} called
"com.mycompany.qmlcomponents":
@@ -103,7 +118,9 @@
\qml
import com.mycompany.qmlcomponents 1.0
- Slider { ... }
+ Slider {
+ // ...
+ }
\endqml
Note that it's perfectly reasonable for a library to register types to older versions