forked from qt-creator/qt-creator
Only Qt 5.12 got true ECMA Script capabilities, so arrow function expressions are not supported before that. To be able to use "regular" inline functions, we allow usage of } by escaping with backslash. For variables that do not start with "JS:" we already supported backslash for escaping. Fixes: QTCREATORBUG-22336 Change-Id: I9fc638e64d2757a21fffc16355635e2fcff87a36 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
18 lines
549 B
C++
18 lines
549 B
C++
%{Cpp:LicenseTemplate}\
|
|
#include "%{JS: Util.relativeFilePath('%{Path}/%{HdrFileName}', '%{Path}' + '/' + Util.path('%{SrcFileName}'))}"
|
|
%{JS: Cpp.openNamespaces('%{Class}')}\
|
|
|
|
@if ! %{IsQtPlugin}
|
|
%{CN}::%{CN}()
|
|
{
|
|
}
|
|
@else
|
|
%{CN}::%{CN}(QObject *parent)
|
|
: %{BaseClassName}(parent)
|
|
{
|
|
}
|
|
%{JS: '%{PluginMethods}'.split('|').map(function(s) { return '\\n' + s.replace(/([a-zA-Z0-9]+\\()/, '%{CN}::$1') + '\\n\{\\n static_assert(false, "You need to implement this function");\\n\}'; \}).join('\\n')}\
|
|
|
|
@endif
|
|
%{JS: Cpp.closeNamespaces('%{Class}')}\
|