Use the updated module api registration function in example

Previously, the example used the non-templated registration function.
This commit also links the qmlRegisterModuleApi documentation from the
"Creating QML Types" page.

Change-Id: I43afb5c051a52fef4059160972f7508f40dac523
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
This commit is contained in:
Chris Adams 2012-04-02 16:01:34 +10:00 committed by Qt by Nokia
parent 2149e9e617
commit 664a0e3f49
2 changed files with 3 additions and 1 deletions

View File

@ -70,6 +70,8 @@ int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const c
Alternatively, these functions provide a way for other types of C++ types
to be visible in the QML context.
\list
\li \l qmlRegisterModuleApi() is suited for registering either a QJSValue
or QObject module API (shared instance) into a namespace
\li \l qmlRegisterUncreatableType() is suited for attached
properties and enum types.
\li \l qmlRegisterTypeNotAvailable() is for

View File

@ -351,7 +351,7 @@
// third, register the module API provider with QML by calling this function in an initialization function.
...
qmlRegisterModuleApi("Qt.example.qobjectApi", 1, 0, example_qobject_module_api_provider);
qmlRegisterModuleApi<ModuleApiExample>("Qt.example.qobjectApi", 1, 0, example_qobject_module_api_provider);
...
\endcode