aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorJuergen Bocklage-Ryannel <juergen.bocklage-ryannel@pelagicore.com>2016-12-05 13:18:10 +0100
committerJuergen Bocklage-Ryannel <juergen.bocklage-ryannel@pelagicore.com>2016-12-05 13:18:10 +0100
commit5a90b31c56d7639e3e4bb46e3f196c9efad15812 (patch)
tree9b134fd261730d92a62a2f75f4d979242965d8b5 /examples
parent63b8fda57b67099e9ebd989d3ba293d2ad15fb2c (diff)
WIP: updating the qtcpp generator
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/qtcpp/generator/qtcpp.py4
-rw-r--r--examples/qtcpp/generator/templates/interface.cpp2
-rw-r--r--examples/qtcpp/generator/templates/interface.h12
-rw-r--r--examples/qtcpp/qtcpp.pro2
-rw-r--r--examples/qtcpp/src/plugins/plugins.pro3
-rw-r--r--examples/qtcpp/src/src.pro2
6 files changed, 18 insertions, 7 deletions
diff --git a/examples/qtcpp/generator/qtcpp.py b/examples/qtcpp/generator/qtcpp.py
index 5b98dfe..479aaa7 100755
--- a/examples/qtcpp/generator/qtcpp.py
+++ b/examples/qtcpp/generator/qtcpp.py
@@ -70,8 +70,8 @@ def run_generation(input, output):
generator.write('{{path}}/qml{{module.module_name|lower}}module.cpp', 'module.cpp', ctx)
for interface in module.interfaces:
ctx.update({'interface': interface})
- generator.write('{{path}}/{{interface|lower}}.h', 'interface.h', ctx)
- generator.write('{{path}}/{{interface|lower}}.cpp', 'interface.cpp', ctx)
+ generator.write('{{path}}/qmlabstract{{interface|lower}}.h', 'interface.h', ctx)
+ generator.write('{{path}}/qmlabstract{{interface|lower}}.cpp', 'interface.cpp', ctx)
for struct in module.structs:
ctx.update({'struct': struct})
generator.write('{{path}}/{{struct|lower}}.h', 'struct.h', ctx)
diff --git a/examples/qtcpp/generator/templates/interface.cpp b/examples/qtcpp/generator/templates/interface.cpp
index 3485071..24a15e3 100644
--- a/examples/qtcpp/generator/templates/interface.cpp
+++ b/examples/qtcpp/generator/templates/interface.cpp
@@ -1,4 +1,5 @@
{# Copyright (c) Pelagicore AB 2016 #}
+{% set class = 'QmlAbstract{0}'.format(interface) %}
/****************************************************************************
** This is an auto-generated file.
** Do not edit! All changes made to it will be lost.
@@ -53,5 +54,6 @@ void {{class}}::set{{property|upperfirst}}({{ property|parameterType }})
{{operation.comment}}
{{operation|returnType}} {{class}}::{{operation}}({{operation.parameters|map('parameterType')|join(', ')}})
{
+ qWarn() << "Not implemented: {{class}}::{{operation}}(...)";
}
{% endfor %}
diff --git a/examples/qtcpp/generator/templates/interface.h b/examples/qtcpp/generator/templates/interface.h
index 2d1ffb1..97ccbd0 100644
--- a/examples/qtcpp/generator/templates/interface.h
+++ b/examples/qtcpp/generator/templates/interface.h
@@ -1,5 +1,5 @@
{# Copyright (c) Pelagicore AB 2016 #}
-{% set class = 'Qml{0}'.format(interface) %}
+{% set class = 'QmlAbstract{0}'.format(interface) %}
/****************************************************************************
** This is an auto-generated file.
** Do not edit! All changes made to it will be lost.
@@ -24,16 +24,18 @@ public:
static void registerQmlTypes(const QString& uri, int majorVersion=1, int minorVersion=0);
public Q_SLOTS:
-{% for operation in interface.operations %}
+{%- for operation in interface.operations %}
{{operation|returnType}} {{operation}}({{operation.parameters|map('parameterType')|join(', ')}});
-{%- endfor %}
+{% endfor %}
+{% for property in interface.properties %}
+ void set{{property|upperfirst}}({{ property|parameterType }});
+{% endfor %}
public:
{% for property in interface.properties %}
- void set{{property|upperfirst}}({{ property|parameterType }});
{{property|returnType}} {{property}}() const;
-
{% endfor %}
+
Q_SIGNALS:
{% for property in interface.properties %}
void {{property}}Changed({{property|parameterType}});
diff --git a/examples/qtcpp/qtcpp.pro b/examples/qtcpp/qtcpp.pro
new file mode 100644
index 0000000..65d9262
--- /dev/null
+++ b/examples/qtcpp/qtcpp.pro
@@ -0,0 +1,2 @@
+TEMPLATE = subdirs
+SUBDIRS = src
diff --git a/examples/qtcpp/src/plugins/plugins.pro b/examples/qtcpp/src/plugins/plugins.pro
new file mode 100644
index 0000000..c945fe3
--- /dev/null
+++ b/examples/qtcpp/src/plugins/plugins.pro
@@ -0,0 +1,3 @@
+TEMPLATE = subdirs
+SUBDIRS += \
+ org.example
diff --git a/examples/qtcpp/src/src.pro b/examples/qtcpp/src/src.pro
index e69de29..64db4ad 100644
--- a/examples/qtcpp/src/src.pro
+++ b/examples/qtcpp/src/src.pro
@@ -0,0 +1,2 @@
+TEMPLATE = subdirs
+SUBDIRS = plugins