aboutsummaryrefslogtreecommitdiffstats
path: root/share/qtcreator/templates/wizards/projects/cpplibrary/lib.cpp
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2019-04-03 19:02:30 +0200
committerEike Ziller <eike.ziller@qt.io>2019-04-17 10:53:21 +0000
commitcb63706f83610ebda34f6713b51d4ff61aaa82a5 (patch)
tree6a64e6739141c55f76f66e8a26b9b092b4b3cd12 /share/qtcreator/templates/wizards/projects/cpplibrary/lib.cpp
parentf213f6176b7941e3fc5406423c79ac8a96a95fae (diff)
Move C++ Library wizard to JSON
And add build system option (QMake & CMake) Task-number: QTCREATORBUG-17308 Fixes: QTCREATORBUG-14605 Change-Id: Ibfadc4bffeabd7ec11271647460a21b6400625c7 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'share/qtcreator/templates/wizards/projects/cpplibrary/lib.cpp')
-rw-r--r--share/qtcreator/templates/wizards/projects/cpplibrary/lib.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/share/qtcreator/templates/wizards/projects/cpplibrary/lib.cpp b/share/qtcreator/templates/wizards/projects/cpplibrary/lib.cpp
new file mode 100644
index 00000000000..23bf7797da0
--- /dev/null
+++ b/share/qtcreator/templates/wizards/projects/cpplibrary/lib.cpp
@@ -0,0 +1,17 @@
+%{Cpp:LicenseTemplate}\
+#include "%{HdrFileName}"
+%{JS: Cpp.openNamespaces('%{Class}')}\
+
+@if ! %{IsQtPlugin}
+%{CN}::%{CN}()
+{
+}
+@else
+%{CN}::%{CN}(QObject *parent)
+ : %{BaseClassName}(parent)
+{
+}
+%{JS: '%{PluginMethods}'.split('|').map(s => '\n' + s.replace(/([a-zA-Z0-9]+\()/, '%{CN}::$1') + '\n\u007B\n static_assert(false, "You need to implement this function");\n\u007D').join('\n')}\
+
+@endif
+%{JS: Cpp.closeNamespaces('%{Class}')}\