summaryrefslogtreecommitdiffstats
path: root/doc/src/declarative
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-07-23 06:22:35 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-07-23 06:22:35 (GMT)
commit7fe100b56ccca40de193164d3ce19600cf50bdd4 (patch)
tree9563d91fe63af272dee0dd18be42e6159de48cf0 /doc/src/declarative
parentfff9aec87509bdcf3c662889b5119f97d32332e5 (diff)
downloadQt-7fe100b56ccca40de193164d3ce19600cf50bdd4.zip
Qt-7fe100b56ccca40de193164d3ce19600cf50bdd4.tar.gz
Qt-7fe100b56ccca40de193164d3ce19600cf50bdd4.tar.bz2
Doc and example fixes for library qualification (QT-558)
Diffstat (limited to 'doc/src/declarative')
-rw-r--r--doc/src/declarative/cppitem.qdoc6
-rw-r--r--doc/src/declarative/extending-examples.qdoc4
-rw-r--r--doc/src/declarative/extending.qdoc5
-rw-r--r--doc/src/declarative/qmlforcpp.qdoc6
4 files changed, 11 insertions, 10 deletions
diff --git a/doc/src/declarative/cppitem.qdoc b/doc/src/declarative/cppitem.qdoc
index d212a5e..97aae67 100644
--- a/doc/src/declarative/cppitem.qdoc
+++ b/doc/src/declarative/cppitem.qdoc
@@ -65,7 +65,7 @@ In order for your type to be usable in QML, you must register it:
\code
QML_DECLARE_TYPE(TypeName);
-QML_DEFINE_TYPE(TypeName,QmlName);
+QML_DEFINE_TYPE(ModuleUri,ModuleMajorVersion,ModuleMinorVersionFrom,ModuleMinorVersionTo,QmlName,TypeName);
\endcode
These macros make the C++ \e TypeName available from the declarative markup language under the name \e QmlName.
@@ -74,9 +74,9 @@ Of course there's nothing stopping you using the same name for both the C++ and
For example:
\code
QML_DECLARE_TYPE(MyCircle);
-QML_DEFINE_TYPE(MyCircle,Circle);
+QML_DEFINE_TYPE(MyLib,1,0,5,Circle,MyCircle);
\endcode
-would make the \e MyCircle class accessable though the \c Circle type in QML.
+would make the \e MyCircle class accessable though the \c Circle type in QML whenever MyLib 1.0 to 1.5 is imported.
\section1 Creating a new 'Fx' item in C++
diff --git a/doc/src/declarative/extending-examples.qdoc b/doc/src/declarative/extending-examples.qdoc
index 4fc1bee..17bef4e 100644
--- a/doc/src/declarative/extending-examples.qdoc
+++ b/doc/src/declarative/extending-examples.qdoc
@@ -70,8 +70,8 @@ The Person class implementation is quite basic. The property accessors simply
return members of the object instance.
The implementation must also include the QML_DEFINE_TYPE() macro. This macro
-registers the Person class with QML, and defines the mapping between the C++
-and QML class names.
+registers the Person class with QML as a type in the People library version 1.0,
+and defines the mapping between the C++ and QML class names.
\section1 Running the example
diff --git a/doc/src/declarative/extending.qdoc b/doc/src/declarative/extending.qdoc
index ac3dc41..88abfe6 100644
--- a/doc/src/declarative/extending.qdoc
+++ b/doc/src/declarative/extending.qdoc
@@ -71,11 +71,12 @@ Custom C++ types are made available to QML using these two macros:
\quotation
\code
#define QML_DECLARE_TYPE(T)
-#define QML_DEFINE_TYPE(T,QmlName)
+#define QML_DEFINE_TYPE(URI,VMAJ,VFROM,VTO,QmlName,T)
\endcode
Register the C++ type \a T with the QML system, and make it available in QML
-under the name \a QmlName. \a T and \a QmlName may be the same.
+under the name \a QmlName in library URI version VMAJ.VFROM to VMAJ.VTO.
+\a T and \a QmlName may be the same.
Generally the QML_DECLARE_TYPE() macro should be included immediately following
the type declaration (usually in its header file), and the QML_DEFINE_TYPE()
diff --git a/doc/src/declarative/qmlforcpp.qdoc b/doc/src/declarative/qmlforcpp.qdoc
index c0d1b7d..74357bb 100644
--- a/doc/src/declarative/qmlforcpp.qdoc
+++ b/doc/src/declarative/qmlforcpp.qdoc
@@ -173,12 +173,12 @@
\section1 Defining QML Types
The QML engine has no intrinsic knowledge of any class types. Instead
- the programmer must define the C++ types, and their corresponding QML
- name.
+ the programmer must define the C++ types, their corresponding QML
+ name, library namespace, and version availability.
\code
#define QML_DECLARE_TYPE(T)
- #define QML_DEFINE_TYPE(T,QmlName)
+ #define QML_DEFINE_TYPE(URI,VMAJ,VFROM,VTO,QmlName,T)
\endcode
Adding these macros to your library or executable automatically makes the