From d723e197653a1f27a76bf30f6ac52538952bab40 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Thu, 13 Oct 2011 10:29:02 +0200 Subject: [PATCH] Doc: QML and C++ Change-Id: Ic0d5906cdd16a08196d4240265f4179a93936f5e Reviewed-by: Christian Kamm --- doc/src/qtquick/qtquick-app-development.qdoc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/doc/src/qtquick/qtquick-app-development.qdoc b/doc/src/qtquick/qtquick-app-development.qdoc index 17b23e66263..7d38fee6668 100644 --- a/doc/src/qtquick/qtquick-app-development.qdoc +++ b/doc/src/qtquick/qtquick-app-development.qdoc @@ -1027,6 +1027,18 @@ extra type information for code completion and the semantic checks to work correctly. + When you write a QML module or use QML from a C++ application you typically + register new types with + \l{http://doc.qt.nokia.com/4.8/qdeclarativeengine.html#qmlRegisterType} + {qmlRegisterType} or expose some class instances with + \l{http://doc.qt.nokia.com/4.8/qdeclarativecontext.html#setContextProperty} + {setContextProperty}. The \QC C++ code model now scans for these calls and + tells the QML code model about them. This means that properties are + displayed during code completion and the JavaScript code checker does not + complain about unknown types. However, this works only when the source code + is available, and therefore, you must explicitly generate type information + for QML modules with plugins before distributing them. + Ideally, QML modules have a \c{plugins.qmltypes} file in the same directory as the \c qmldir file. The \c qmltypes file contains a description of the components exported by the module's plugins and is loaded by \QC @@ -1035,7 +1047,7 @@ For Qt 4.8 and later, one or more \c qmltypes files can be listed in the \c qmldir file under the \c typeinfo header. These files will be read in addition to \c{plugins.qmltypes}. For more information, see - \l{http://doc.qt.nokia.com/4.8-snapshot/qdeclarativemodules.html#writing-a-qmldir-file}{Writing a qmldir File}. + \l{http://doc.qt.nokia.com/4.8/qdeclarativemodules.html#writing-a-qmldir-file}{Writing a qmldir File}. \section1 Generating qmltypes Files