Changeset View
Changeset View
Standalone View
Standalone View
file_templates/classes/qdialog_pimpl/class.cpp
1 | {% extends "cpp_implementation.cpp" %} | 1 | {% extends "cpp_qobject_pimpl_implementation.cpp" %} | ||
---|---|---|---|---|---|
2 | {% load kdev_filters %} | | |||
3 | 2 | | |||
4 | {% block includes %} | | |||
5 | #include "{{ output_file_header }}" | | |||
6 | #include "{{ output_file_privateheader }}" | | |||
7 | {% endblock includes %} | | |||
8 | 3 | | |||
9 | 4 | {% block public_constructor_body %} | |||
10 | {% block extra_definitions %} | 5 | {{ block.super }} | ||
11 | | ||||
12 | {% for method in private_functions %} | | |||
13 | {% with name|add:"Private" as name %} | | |||
14 | | ||||
15 | {% include "method_definition_cpp.txt" %} | | |||
16 | { | | |||
17 | {% if method.type %} | | |||
18 | return {{ method.default_return_value }}; | | |||
19 | {% endif %} | | |||
20 | } | | |||
21 | | ||||
22 | {% endwith %} | | |||
23 | {% endfor %} | | |||
24 | | ||||
25 | {% endblock extra_definitions %} | | |||
26 | | ||||
27 | {% block function_definitions %} | | |||
28 | | ||||
29 | {% for method in public_functions %} | | |||
30 | {% with method.arguments as arguments %} | | |||
31 | | ||||
32 | {% include "method_definition_cpp.txt" %} | | |||
33 | {% if method.isConstructor %} | | |||
34 | : d_ptr(new {{ name }}Private()) | | |||
35 | {% endif %} | | |||
36 | { | | |||
37 | {% if method.isConstructor %} | | |||
38 | d_ptr->ui.setupUi(this); | 6 | d_ptr->ui.setupUi(this); | ||
39 | {% endif %} | 7 | {% endblock public_constructor_body %} | ||
40 | {% if method.isDestructor %} | | |||
41 | delete d_ptr; | | |||
42 | {% endif %} | | |||
43 | {% if method.type %}return {{ method.default_return_value }}; | | |||
44 | {% endif %} | | |||
45 | } | | |||
46 | 8 | | |||
47 | {% endwith %} | | |||
48 | {% endfor %} | | |||
49 | 9 | | |||
50 | {% for method in protected_functions %} | 10 | {% block protected_constructor_body %} | ||
51 | {% with method.arguments as arguments %} | 11 | {{ block.super }} | ||
52 | | ||||
53 | {% include "method_definition_cpp.txt" %} | | |||
54 | {% if method.isConstructor %} | | |||
55 | : d_ptr(new {{ name }}Private()) | | |||
56 | {% endif %} | | |||
57 | { | | |||
58 | {% if method.isConstructor %} | | |||
59 | d_ptr->ui.setupUi(this); | 12 | d_ptr->ui.setupUi(this); | ||
60 | {% endif %} | 13 | {% endblock protected_constructor_body %} | ||
61 | {% if method.isDestructor %} | | |||
62 | delete d_ptr; | | |||
63 | {% endif %} | | |||
64 | {% if method.type %}return {{ method.default_return_value }}; | | |||
65 | {% endif %} | | |||
66 | } | | |||
67 | | ||||
68 | {% endwith %} | | |||
69 | {% endfor %} | | |||
70 | | ||||
71 | {% for property in members %} | | |||
72 | | ||||
73 | | ||||
74 | {% include "class_property_getter_definition_cpp.txt" %} | | |||
75 | { | | |||
76 | Q_D(const {{ name }}); | | |||
77 | return d->{{ property.name }}; | | |||
78 | } | | |||
79 | | ||||
80 | | ||||
81 | {% include "class_property_setter_definition_cpp.txt" %} | | |||
82 | { | | |||
83 | Q_D({{ name }}); | | |||
84 | if (d->{{ property.name }} == {{ property.name }}) { | | |||
85 | return; | | |||
86 | } | | |||
87 | | ||||
88 | | ||||
89 | d->{{ property.name }} = {{ property.name }}; | | |||
90 | emit {{ property.name }}Changed(d->{{ property.name }}); | | |||
91 | } | | |||
92 | | ||||
93 | {% endfor %} | | |||
94 | | ||||
95 | {% endblock function_definitions %} | |