summaryrefslogtreecommitdiffstats
path: root/doc/src/declarative
diff options
context:
space:
mode:
authormae <qt-info@nokia.com>2010-04-08 12:54:42 (GMT)
committermae <qt-info@nokia.com>2010-04-08 13:00:35 (GMT)
commitc3a54c47048b7123f51f2a1078e156d259445221 (patch)
tree299c0dfd3c039ec5fbf36f5a64bca13c1b8b4fd7 /doc/src/declarative
parentdc2429a34e8d0168ef33f48ec0da35631be49243 (diff)
downloadQt-c3a54c47048b7123f51f2a1078e156d259445221.zip
Qt-c3a54c47048b7123f51f2a1078e156d259445221.tar.gz
Qt-c3a54c47048b7123f51f2a1078e156d259445221.tar.bz2
Tune plugin import mechanism
In shadow build environments, we cannot enforce that shared library objects for plugins are located in the same directory as the qmldir file. This makes it hard for Creator to support mixed projects (qml/c++). In order to gain more flexibility, the patch introduces a pluginPathList to QDeclarativeEngine, which completes the existing importsPathList. The pluginPathList defaults to ["."], which indicates the directory where the qmldir file is located in. The qml viewer tool gains a command line option -P to add to the pluginPathList. For consistency, the -L option ("Library") has been renamed to -I ("Import"). QDeclarativeEngine::importExtension() has been renamed to QDeclarativeEngine::importPlugin(). The documentation has been adjusted accordingly. Done with erikv. Reviewed-by: erikv
Diffstat (limited to 'doc/src/declarative')
-rw-r--r--doc/src/declarative/modules.qdoc33
1 files changed, 19 insertions, 14 deletions
diff --git a/doc/src/declarative/modules.qdoc b/doc/src/declarative/modules.qdoc
index 68e58fb..0e332d4 100644
--- a/doc/src/declarative/modules.qdoc
+++ b/doc/src/declarative/modules.qdoc
@@ -86,7 +86,7 @@ The second exception is explained in more detail in the section below on Namespa
\section2 The Import Path
Installed modules are searched for on the import path.
-The \c -L option to the \l {Qt Declarative UI Runtime}{qml} runtime adds paths to the import path.
+The \c -I option to the \l {Qt Declarative UI Runtime}{qml} runtime adds paths to the import path.
From C++, the path is available via \l QDeclarativeEngine::importPathList() and can be prepended to
using \l QDeclarativeEngine::addImportPath().
@@ -114,19 +114,7 @@ Installed files do not need to import the module of which they are a part, as th
to the other QML files in the module as relative (local) files, but
if the module is imported from a remote location, those files must nevertheless be listed in
the \c qmldir file. Types which you do not wish to export to users of your module
-may be marked with the \c internal keyword:
-
-\code
-internal <TypeName> <File>
-\endcode
-
-\c plugin <Name> [<Path>] lines are used to add \l{QDeclarativeExtensionPlugin}{QML C++ plugins}
-to the module. <Name> is the
-name of the library. <Path> is an optional argument specifying the full path to the directory
-containing the plugin file; if it is omitted then the directory is assumed to be the same as
-the directory of the \c qmldir file. Note that <Name> is not usually the same as the file name
-of the plugin binary, which is platform dependent; e.g. the library MyAppTypes would produce
-a libMyAppTypes.so on Linux and MyAppTypes.dll on Windows.
+may be marked with the \c internal keyword: \c internal <TypeName> <File>.
The same type can be provided by different files in different versions, in which
case later earlier versions (eg. 1.2) must precede earlier versions (eg. 1.0),
@@ -141,6 +129,23 @@ of installed software, since a versioned import \e only imports types for that v
leaving other identifiers available, even if the actual installed version might otherwise
provide those identifiers.
+\c plugin <Name> [<Path>] lines are used to add \l{QDeclarativeExtensionPlugin}{QML C++ plugins}
+to the module.
+
+<Name> is the name of the library. It is usually not the same as the file name
+of the plugin binary, which is platform dependent; e.g. the library MyAppTypes would produce
+a libMyAppTypes.so on Linux and MyAppTypes.dll on Windows.
+By default the engine searches for the plugin library in the directory containing the \c qmldir
+file. The \c -P option to the \l {Qt Declarative UI Runtime}{qml} runtime adds paths to the
+plugin search path.
+From C++, the path is available via \l QDeclarativeEngine::pluginPathList() and can be prepended to
+using \l QDeclarativeEngine::addPluginPath().
+
+<Path> is an optional argument specifying either an absolute path to the directory containing the
+plugin file, or a relative path from the directory containing the \c qmldir file to the directory
+containing the plugin file.
+
+
\section2 Namespaces - Named Imports
When importing content it by default imports types into the global namespace.