summaryrefslogtreecommitdiffstats
path: root/tests/auto/tools/moc/plugin_metadata.h
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@digia.com>2013-08-20 09:02:17 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-13 11:48:08 +0200
commit31b4461097bd4bd0c128647bab896c2612ef82b0 (patch)
tree53710dab5d5f89650de71649b84589c212d1856f /tests/auto/tools/moc/plugin_metadata.h
parent209a5f1e8dc3e2275f225823ad9edfee09ba756c (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 'tests/auto/tools/moc/plugin_metadata.h')
-rw-r--r--tests/auto/tools/moc/plugin_metadata.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/tests/auto/tools/moc/plugin_metadata.h b/tests/auto/tools/moc/plugin_metadata.h
new file mode 100644
index 0000000000..7172617f00
--- /dev/null
+++ b/tests/auto/tools/moc/plugin_metadata.h
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef TESTPLUGINMETADATA
+#define TESTPLUGINMETADATA
+
+#include <QtPlugin>
+
+class TestPluginMetaData : public QObject
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID "test.meta.tags")
+};
+
+#endif