Changeset View
Changeset View
Standalone View
Standalone View
file_templates/classes/qobject/class.cpp
1 | {% extends "cpp_implementation.cpp" %} | 1 | {% extends "cpp_qobject_implementation.cpp" %} | ||
---|---|---|---|---|---|
2 | {% load kdev_filters %} | | |||
3 | | ||||
4 | {% block extra_definitions %} | | |||
5 | | ||||
6 | {% for method in private_functions %} | | |||
7 | | ||||
8 | {% include "method_definition_cpp.txt" %} | | |||
9 | { | | |||
10 | {% if method.type %} | | |||
11 | return {{ method.default_return_value }}; | | |||
12 | {% endif %} | | |||
13 | } | | |||
14 | | ||||
15 | {% endfor %} | | |||
16 | | ||||
17 | {% endblock extra_definitions %} | | |||
18 | | ||||
19 | {% block function_definitions %} | | |||
20 | | ||||
21 | {% for method in public_functions %} | | |||
22 | | ||||
23 | {% include "method_definition_cpp.txt" %} | | |||
24 | { | | |||
25 | {% if method.type %} | | |||
26 | return {{ method.default_return_value }}; | | |||
27 | {% endif %} | | |||
28 | } | | |||
29 | | ||||
30 | {% endfor %} | | |||
31 | | ||||
32 | {% for method in protected_functions %} | | |||
33 | | ||||
34 | {% include "method_definition_cpp.txt" %} | | |||
35 | { | | |||
36 | {% if method.type %} | | |||
37 | return {{ method.default_return_value }}; | | |||
38 | {% endif %} | | |||
39 | } | | |||
40 | | ||||
41 | {% endfor %} | | |||
42 | | ||||
43 | {% for property in members %} | | |||
44 | | ||||
45 | | ||||
46 | {% include "class_property_getter_definition_cpp.txt" %} | | |||
47 | { | | |||
48 | return m_{{ property.name }}; | | |||
49 | } | | |||
50 | | ||||
51 | | ||||
52 | {% include "class_property_setter_definition_cpp.txt" %} | | |||
53 | { | | |||
54 | if (m_{{ property.name }} == {{ property.name }}) { | | |||
55 | return; | | |||
56 | } | | |||
57 | | ||||
58 | | ||||
59 | m_{{ property.name }} = {{ property.name }}; | | |||
60 | emit {{ property.name }}Changed(m_{{ property.name }}); | | |||
61 | } | | |||
62 | | ||||
63 | {% endfor %} | | |||
64 | | ||||
65 | {% endblock function_definitions %} | |