aboutsummaryrefslogtreecommitdiffstats
path: root/src/doc/qtivi/src/ivigenerator/filter-reference.qdoc
blob: c330fffab21c1bee3b7f4fe724ad6ecd597a4359 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
/****************************************************************************
**
** Copyright (C) 2018 Pelagicore AG
** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the QtIvi module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL-QTAS$
** Commercial License Usage
** Licensees holding valid commercial Qt Automotive Suite 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 The Qt Company.  For
** licensing terms and conditions see https://www.qt.io/terms-conditions.
** For further information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
** $QT_END_LICENSE$
**
****************************************************************************/
/*!
\page filter-reference.html
\title Filter Reference
\previouspage Autogenerator Usage
\nextpage Qmake Integration

In addition to the built-in Jinja filters listed \l
{http://jinja.pocoo.org/docs/2.9/templates/#list-of-builtin-filters} {here}, the following
additional features are implemented in the ivigenerator.

\target return_type(symbol)
\target return_type()
\section1 return_type(symbol)

Returns the C++ type for the passed symbol.

E.g. QString for a symbol of type "string".

\target parameter_type(symbol)
\section1 parameter_type(symbol)

Return the C++ type for the passed symbol. This returns the same type as return_type(), but already
prepared to be used as a parameter for methods.

E.g. "const QString &<name>" for a symbol of type "string"

\target getter_name(symbol)
\section1 getter_name(symbol)

Returns the getter name of the property, if defined by the \c @getter_name annotation. Otherwise
retuns the passed symbol.

\target setter_name(symbol)
\section1 setter_name(symbol)

Returns the setter name of the property, if defined by the \c @setter_name annotation. Otherwise
retuns the passed symbol.

\target default_type_value(symbol)
\section1 default_type_value(symbol)

Returns the default value for the passed symbol. Models are initialized as \c nullptr

\target default_value(symbol, zone="=")
\section1 default_value(symbol, zone="=")

Returns the default value for the passed symbol set by the \c @default annotation. If not set uses
\c default_type_value instead.

The zone parameter is used to identify different default values per zone.

\target model_type(symbol)
\section1 model_type(symbol)

Returns the C++ class name for this model.

\target flag_type(symbol)
\section1 flag_type(symbol)

Returns the name defined by the \c @type annotation for the passed flag. If this is not set, tries to
pluralize the passed name by adding an 's' at the end.

\target parse_doc(string)
\section1 parse_doc(string)

Parses the passed comment string and adds every javadoc command into its own group. Sentences
without tag are put into the 'description' group.

\badcode
{% with doc = comments|parse_doc -%}
{% if doc.brief %}    \brief {{doc.brief}}
{% endif %}

{% if doc.description %}
    {{doc.description}}
{% endif %}
{% endwith %}
\endcode

\target lowerfirst(string)
\section1 lowerfirst(string)

Only lowers the first character of the given string.

\target range_low(property)
\section1 range_low(property)

Returns the minimum value for the passed property using the \c @range or \c @minimum annotations.

\target range_high(property)
\section1 range_high(property)

Returns the maximum value for the passed property using the \c @range or \c @maximum annotations.

\target strip_QT(string)
\section1 strip_QT(string)

Removes the 'QT' at the beginning, if the string starts with it.

\target domain_values(symbol)
\section1 domain_values(symbol)

Returns the domain values for the passed property using the \c @domain annotation.

\target enum_value(value, module_name)
\section1 enum_value(value, module_name)

Returns the fully qualified C++ name of the given value. The passed module_name is used as C++ class
name containing the enum.

Also supports passing '|' connected values.

\target tag_by_path(symbol, path, default_value=False)
\section1 tag_by_path(symbol, path, default_value=False)

Find the tag given by its full path in the object hierarchy, like
\c property.config_sim.zones.right. If some parts of the path are missing, return \c None.

\target conf_sim_tag(symbol, path, default_value=False)
\section1 conf_sim_tag(symbol, path, default_value=False)

Find the tag, given by its path, located under the "config_simulator" sub-object. Returns \c None,
if parts of the path are missing.

\target jsonify(obj)
\section1 jsonify(obj)

Returns a JSON representation of the given obj.

\target has_domains(properties)
\section1 has_domains(properties)

Returns \c true if any of the given properties has \c @range or \c @domain annotations.

\target json_domain(properties)
\section1 json_domain(properties)

Returns the property domains for the given properties formated in JSON.

\target qml_type(interface)
\section1 qml_type(interface)

Returns the name of the interface for use in QML. This name is defined by the \c @qml_type
annotation. This annotation is optional: if not provided, the interface name is used.

\target qml_control(symbol, backend_obj)
\section1 qml_control(symbol, backend_obj)

Returns the QML code for the control (or group of controls) to represent the editing UI for the
passed symbol.

\target qml_binding_property(symbol)
\section1 qml_binding_property(symbol)

Returns the name of the property of the QML control to be bound with.

E.g. "value" for a Slider and "checked" for a CheckBox.

\target qml_control_signal_parameters(symbol)
\section1 qml_control_signal_parameters(symbol)

Returns the parameters for calling the signal using the values from the UI controls.

\target struct_includes(symbol)
\section1 struct_includes(symbol)

Returns the includes for the structs that the interface or a struct depends on. The returned
strings are complete and in format #include "struct.h".
*/