Commit 4dcb417c authored by Christian Kamm's avatar Christian Kamm

Doc: Add notes about QML modules with plugins.

Change-Id: Iabeddf9ddf60c383d2ecdda7ecbb5e930d988684
Reviewed-on: http://codereview.qt.nokia.com/52Reviewed-by: default avatarLeena Miettinen <riitta-leena.miettinen@nokia.com>
parent 46a707fd
......@@ -21,9 +21,15 @@
/*!
\contentspage index.html
\if defined(qcmanual)
\previouspage creator-keyboard-shortcuts.html
\else
\endif
\page creator-faq.html
\if defined(qcmanual)
\nextpage creator-tips.html
\else
\endif
\title FAQ
......
......@@ -98,6 +98,7 @@
\o \l {Adding User Interaction Methods}
\o \l {Exporting Designs from Graphics Software}
\o \l {Implementing Application Logic}
\o \l {Using QML Modules with Plugins}
\endlist
\o \l{Developing Widget Based Applications}
\o \l{Optimizing Applications for Mobile Devices}
......@@ -1015,7 +1016,7 @@
/*!
\contentspage index.html
\previouspage quick-application-logic.html
\previouspage creator-qml-modules-with-plugins.html
\page creator-using-qt-designer.html
\nextpage creator-usability.html
......@@ -8890,6 +8891,7 @@
\o \l {Adding User Interaction Methods}
\o \l {Exporting Designs from Graphics Software}
\o \l {Implementing Application Logic}
\o \l {Using QML Modules with Plugins}
\endlist
......@@ -9762,7 +9764,7 @@
\contentspage index.html
\previouspage quick-export-to-qml.html
\page quick-application-logic.html
\nextpage creator-using-qt-designer.html
\nextpage creator-qml-modules-with-plugins.html
\title Implementing Application Logic
......@@ -9777,6 +9779,59 @@
*/
/*!
\contentspage index.html
\previouspage quick-application-logic.html
\page creator-qml-modules-with-plugins.html
\nextpage creator-using-qt-designer.html
\title Using QML Modules with Plugins
QML modules may use plugins to expose components defined in C++ to
QML applications. Since Qt Creator cannot load the plugins to determine
the details of the contained components, these modules need to provide
extra type information for code completion and the semantic checks to work
correctly.
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 Qt Creator
when the module is imported.
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}.
\section1 Generating qmltypes Files
You can create and edit \c qmltypes files manually, but you are recommended
to use the \c qmlplugindump tool shipped with Qt 4.8 and later to generate
them automatically. For earlier versions of Qt, you can compile a version
of the tool called \c qmldump from the sources in
\c{<QtCreator>/share/qtcreator/qml/qmldump} if the Qt version contains private headers.
Once you have obtained qmlplugindump for the Qt version the QML module's
plugins were compiled with, run the following command to load My.Module
version 1.0 from \c{/import/path/my/module} including all its plugins and
output a description of the plugins' types to
\c{/import/path/my/module/plugins.qmltypes}:
\code
qmlplugindump My.Module 1.0 /import/path > /import/path/my/module/plugins.qmltypes
\endcode
You can safely ignore the debug output.
\section1 Dumping Plugins Automatically
If a module with plugins lacks the \c qmltypes file, Qt Creator tries to
generate a temporary file itself by running the \c qmldump program in the
background. However, this automatic dumping is a fallback mechanism with
many points of failure and cannot be relied upon.
*/
/*!
\contentspage index.html
\previouspage creator-editor-refactoring.html
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment