diff options
author | Alan Alpert <416365416c@gmail.com> | 2013-05-17 15:32:19 -0700 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-20 01:09:05 +0200 |
commit | fee79b70773ef26c5d45993c4618d302392b0782 (patch) | |
tree | 89c5a0c07eb0c8504ecb1e77ef78b7899d10ed7a /src/qml/doc/src | |
parent | 8850e2eafaba8a6493d3ad5ab584b751eb9a8742 (diff) |
Add qmlProtectModule
A C++ analog to the protected qmldir syntax, this is also a potential
performance improvement because we can avoid some file system accesses.
Change-Id: I41781a6cc72aa65bd2d397800345ea16ef442e90
Reviewed-by: Antti Piira <apiira@blackberry.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/doc/src')
-rw-r--r-- | src/qml/doc/src/qmlfunctions.qdoc | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/qml/doc/src/qmlfunctions.qdoc b/src/qml/doc/src/qmlfunctions.qdoc index 386f9f49df..7d668a4a11 100644 --- a/src/qml/doc/src/qmlfunctions.qdoc +++ b/src/qml/doc/src/qmlfunctions.qdoc @@ -413,3 +413,28 @@ Returns non-zero if the registration was sucessful. */ +/*! + \fn int qmlProtectModule(const QString &uri, int versionMajor); + \relates QQmlEngine + + This function protects a module from having types registered into it. This + can be used to prevent other plugins from injecting types into your module. + It can also be a performance improvement, as it allows the engine to skip + checking for the possibility of new types or plugins when this import is + reached. + + The performance benefit is primarily seen when registering application + specific types from within the application instead of through a plugin. + Using qmlProtectModule allows the engine to skip checking for a plugin when + that uri is imported, which can be noticeable with slow file systems. + + After this function is called, any attempt to register C++ types into this + uri, major version combination will lead to a runtime error. Call this after + you have registered all of your types with the engine. + + #include <QtQml> to use this function. + + Returns true if the module was found and locked, otherwise returns false. + The module must contain exported types in order to be found. +*/ + |