diff options
author | Richard Moe Gustavsen <richard.gustavsen@digia.com> | 2013-08-20 09:02:17 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-13 11:48:08 +0200 |
commit | 31b4461097bd4bd0c128647bab896c2612ef82b0 (patch) | |
tree | 53710dab5d5f89650de71649b84589c212d1856f /src/tools/moc/moc.cpp | |
parent | 209a5f1e8dc3e2275f225823ad9edfee09ba756c (diff) |
moc: add -M<key=value> to ease static qml plugin linking
A module plugin in qml belongs to a URI/namespace. This
uri is resolved run-time by QtDeclarative by knowing the
path of the qmldir that references the plugin.
For static plugins this becomes a problem, since we lost
the information regarding which plugin belongs to which
qmldir, since a static plugin has no file path.
To avoid pushing the responsibility of clarifying this
onto the application developer, it is better to embed this
information into the meta data of the plugins themselves.
Since this information can be resolved by the
build system, a new option to moc has been added:
-M<key=value>
that will let you add meta tags to the meta data from
the command line to each class that has an IID specified.
For the URI case, we can then e.g do:
-Muri=QtQuick.Controls -Muri=QtQuick.Controls.Private
Change-Id: I81a156660148fc94db6f3cac0473e9e1c8458c58
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src/tools/moc/moc.cpp')
-rw-r--r-- | src/tools/moc/moc.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp index 648723ebc1..8ff481d5b1 100644 --- a/src/tools/moc/moc.cpp +++ b/src/tools/moc/moc.cpp @@ -787,6 +787,10 @@ void Moc::parse() if (!def.hasQObject && !def.hasQGadget) error("Class declarations lacks Q_OBJECT macro."); + // Add meta tags to the plugin meta data: + if (!def.pluginData.iid.isEmpty()) + def.pluginData.metaArgs = metaArgs; + checkSuperClasses(&def); checkProperties(&def); |