diff options
author | Bea Lam <bea.lam@nokia.com> | 2010-04-27 04:48:28 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2010-04-27 04:49:23 (GMT) |
commit | f0826662baaf7916f7b5f4fa9c8e9abab457731d (patch) | |
tree | 07333d1c267698d44eb0db382652e1ae1becdcdf | |
parent | 4b2293fe1dbb82a0767fff155cef9e33cde3faeb (diff) | |
download | Qt-f0826662baaf7916f7b5f4fa9c8e9abab457731d.zip Qt-f0826662baaf7916f7b5f4fa9c8e9abab457731d.tar.gz Qt-f0826662baaf7916f7b5f4fa9c8e9abab457731d.tar.bz2 |
Plugins documentation.
Task-number: QTBUG-10129
-rw-r--r-- | doc/src/declarative/extending-tutorial.qdoc | 7 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativeextensionplugin.cpp | 15 |
2 files changed, 15 insertions, 7 deletions
diff --git a/doc/src/declarative/extending-tutorial.qdoc b/doc/src/declarative/extending-tutorial.qdoc index a139616..f00b858 100644 --- a/doc/src/declarative/extending-tutorial.qdoc +++ b/doc/src/declarative/extending-tutorial.qdoc @@ -62,7 +62,7 @@ Tutorial chapters: \o \l{declarative/tutorials/extending/chapter2-methods}{Connecting to C++ Methods and Signals} \o \l{declarative/tutorials/extending/chapter3-bindings}{Adding Property Bindings} \o \l{declarative/tutorials/extending/chapter4-customPropertyTypes}{Using Custom Property Types} -\o \l{declarative/tutorials/extending/chapter5-plugins}{Deploying Your Extension} +\o \l{declarative/tutorials/extending/chapter5-plugins}{Writing an Extension Plugin} \o \l{qml-extending-tutorial6.html}{In Summary} \endlist @@ -308,7 +308,7 @@ Try it out with the code in Qt's \c examples/tutorials/extending/chapter4-custom */ /*! -\title Chapter 5: Deploying Your Extension +\title Chapter 5: Writing an Extension Plugin \example declarative/tutorials/extending/chapter5-plugins @@ -316,7 +316,8 @@ Currently the \c Musician and \c Instrument types are used by \c app.qml, which is displayed using a QDeclarativeView in a C++ application. An alternative way to use our QML extension is to create a plugin library to make it available to the QML engine. This means we could load \c app.qml using the standard \c qml tool -instead of writing a \c main.cpp file and loading our own C++ application. +(or some other QML runtime application) instead of writing a \c main.cpp file and +loading our own C++ application. To create a plugin library, we need: diff --git a/src/declarative/qml/qdeclarativeextensionplugin.cpp b/src/declarative/qml/qdeclarativeextensionplugin.cpp index 863bfc4..2c15385 100644 --- a/src/declarative/qml/qdeclarativeextensionplugin.cpp +++ b/src/declarative/qml/qdeclarativeextensionplugin.cpp @@ -64,8 +64,11 @@ QT_BEGIN_NAMESPACE as any manipulation of the engine's root context may cause conflicts or other issues in the library user's code. - See \l {Extending QML in C++} for details how to write a QML extension plugin. - See \l {How to Create Qt Plugins} for general Qt plugin documentation. + See \l {Tutorial: Writing QML extensions with C++} for details on creating + QML extensions, including how to build a plugin with with QDeclarativeExtensionPlugin. + For a simple overview, see the \l{declarative/plugins}{plugins} example. + + Also see \l {How to Create Qt Plugins} for general Qt plugin documentation. \sa QDeclarativeEngine::importPlugin() */ @@ -73,8 +76,12 @@ QT_BEGIN_NAMESPACE /*! \fn void QDeclarativeExtensionPlugin::registerTypes(const char *uri) - Registers the QML types in the given \a uri. Here you call qmlRegisterType() for - all types which are provided by the extension plugin. + Registers the QML types in the given \a uri. Subclasses should implement + this to call qmlRegisterType() for all types which are provided by the extension + plugin. + + The \a uri is an identifier for the plugin generated by the QML engine + based on the name and path of the extension's plugin library. */ /*! |