summaryrefslogtreecommitdiff
path: root/generator/qtcpp/templates/plugin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'generator/qtcpp/templates/plugin.cpp')
-rw-r--r--generator/qtcpp/templates/plugin.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/generator/qtcpp/templates/plugin.cpp b/generator/qtcpp/templates/plugin.cpp
new file mode 100644
index 0000000..4ed383b
--- /dev/null
+++ b/generator/qtcpp/templates/plugin.cpp
@@ -0,0 +1,26 @@
+{# Copyright (c) Pelagicore AB 2016 #}
+{% set module_name = 'Qml{0}Module'.format(module.module_name()) %}
+/****************************************************************************
+** This is an auto-generated file.
+** Do not edit! All changes made to it will be lost.
+****************************************************************************/
+
+#include "plugin.h"
+
+#include <qqml.h>
+
+#include "{{module_name|lower}}.h"
+
+{% for interface in module.interfaces %}
+#include "{{interface|lower}}.h"
+{% endfor %}
+
+void Plugin::registerTypes(const char *uri)
+{
+ {{module_name}}::registerTypes();
+ // @uri {{module|lower}}
+ {{module_name}}::registerQmlTypes(uri, 1, 0);
+{% for interface in module.interfaces %}
+ Qml{{interface}}::registerQmlTypes(uri, 1, 0);
+{% endfor %}
+}