##// END OF EJS Templates
Add possibility to set markers in legend in reverse order...
Titta Heikkala -
r2676:23bf915495bc
parent child
Show More
@@ -1,2119 +1,2124
1 import QtQuick.tooling 1.1
1 import QtQuick.tooling 1.1
2
2
3 // This file describes the plugin-supplied types contained in the library.
3 // This file describes the plugin-supplied types contained in the library.
4 // It is used for QML tooling purposes only.
4 // It is used for QML tooling purposes only.
5
5
6 Module {
6 Module {
7 Component {
7 Component {
8 name: "QGraphicsObject"
8 name: "QGraphicsObject"
9 defaultProperty: "children"
9 defaultProperty: "children"
10 prototype: "QObject"
10 prototype: "QObject"
11 Property { name: "parent"; type: "QGraphicsObject"; isPointer: true }
11 Property { name: "parent"; type: "QGraphicsObject"; isPointer: true }
12 Property { name: "opacity"; type: "double" }
12 Property { name: "opacity"; type: "double" }
13 Property { name: "enabled"; type: "bool" }
13 Property { name: "enabled"; type: "bool" }
14 Property { name: "visible"; type: "bool" }
14 Property { name: "visible"; type: "bool" }
15 Property { name: "pos"; type: "QPointF" }
15 Property { name: "pos"; type: "QPointF" }
16 Property { name: "x"; type: "double" }
16 Property { name: "x"; type: "double" }
17 Property { name: "y"; type: "double" }
17 Property { name: "y"; type: "double" }
18 Property { name: "z"; type: "double" }
18 Property { name: "z"; type: "double" }
19 Property { name: "rotation"; type: "double" }
19 Property { name: "rotation"; type: "double" }
20 Property { name: "scale"; type: "double" }
20 Property { name: "scale"; type: "double" }
21 Property { name: "transformOriginPoint"; type: "QPointF" }
21 Property { name: "transformOriginPoint"; type: "QPointF" }
22 Property { name: "effect"; type: "QGraphicsEffect"; isPointer: true }
22 Property { name: "effect"; type: "QGraphicsEffect"; isPointer: true }
23 Property {
23 Property {
24 name: "children"
24 name: "children"
25 type: "QDeclarativeListProperty<QGraphicsObject>"
25 type: "QDeclarativeListProperty<QGraphicsObject>"
26 isReadonly: true
26 isReadonly: true
27 }
27 }
28 Property { name: "width"; type: "double" }
28 Property { name: "width"; type: "double" }
29 Property { name: "height"; type: "double" }
29 Property { name: "height"; type: "double" }
30 }
30 }
31 Component {
31 Component {
32 name: "QGraphicsWidget"
32 name: "QGraphicsWidget"
33 defaultProperty: "children"
33 defaultProperty: "children"
34 prototype: "QGraphicsObject"
34 prototype: "QGraphicsObject"
35 Property { name: "palette"; type: "QPalette" }
35 Property { name: "palette"; type: "QPalette" }
36 Property { name: "font"; type: "QFont" }
36 Property { name: "font"; type: "QFont" }
37 Property { name: "layoutDirection"; type: "Qt::LayoutDirection" }
37 Property { name: "layoutDirection"; type: "Qt::LayoutDirection" }
38 Property { name: "size"; type: "QSizeF" }
38 Property { name: "size"; type: "QSizeF" }
39 Property { name: "minimumSize"; type: "QSizeF" }
39 Property { name: "minimumSize"; type: "QSizeF" }
40 Property { name: "preferredSize"; type: "QSizeF" }
40 Property { name: "preferredSize"; type: "QSizeF" }
41 Property { name: "maximumSize"; type: "QSizeF" }
41 Property { name: "maximumSize"; type: "QSizeF" }
42 Property { name: "sizePolicy"; type: "QSizePolicy" }
42 Property { name: "sizePolicy"; type: "QSizePolicy" }
43 Property { name: "focusPolicy"; type: "Qt::FocusPolicy" }
43 Property { name: "focusPolicy"; type: "Qt::FocusPolicy" }
44 Property { name: "windowFlags"; type: "Qt::WindowFlags" }
44 Property { name: "windowFlags"; type: "Qt::WindowFlags" }
45 Property { name: "windowTitle"; type: "string" }
45 Property { name: "windowTitle"; type: "string" }
46 Property { name: "geometry"; type: "QRectF" }
46 Property { name: "geometry"; type: "QRectF" }
47 Property { name: "autoFillBackground"; type: "bool" }
47 Property { name: "autoFillBackground"; type: "bool" }
48 Property { name: "layout"; type: "QGraphicsLayout"; isPointer: true }
48 Property { name: "layout"; type: "QGraphicsLayout"; isPointer: true }
49 Method { name: "close"; type: "bool" }
49 Method { name: "close"; type: "bool" }
50 }
50 }
51 Component {
51 Component {
52 name: "QtCommercialChart::DeclarativeAreaSeries"
52 name: "QtCommercialChart::DeclarativeAreaSeries"
53 prototype: "QtCommercialChart::QAreaSeries"
53 prototype: "QtCommercialChart::QAreaSeries"
54 exports: [
54 exports: [
55 "QtCommercial.Chart/AreaSeries 1.0",
55 "QtCommercial.Chart/AreaSeries 1.0",
56 "QtCommercial.Chart/AreaSeries 1.1",
56 "QtCommercial.Chart/AreaSeries 1.1",
57 "QtCommercial.Chart/AreaSeries 1.2",
57 "QtCommercial.Chart/AreaSeries 1.2",
58 "QtCommercial.Chart/AreaSeries 1.3"
58 "QtCommercial.Chart/AreaSeries 1.3"
59 ]
59 ]
60 exportMetaObjectRevisions: [0, 1, 2, 3]
60 exportMetaObjectRevisions: [0, 1, 2, 3]
61 Property { name: "upperSeries"; type: "DeclarativeLineSeries"; isPointer: true }
61 Property { name: "upperSeries"; type: "DeclarativeLineSeries"; isPointer: true }
62 Property { name: "lowerSeries"; type: "DeclarativeLineSeries"; isPointer: true }
62 Property { name: "lowerSeries"; type: "DeclarativeLineSeries"; isPointer: true }
63 Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true }
63 Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true }
64 Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true }
64 Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true }
65 Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true }
65 Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true }
66 Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true }
66 Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true }
67 Property { name: "axisAngular"; revision: 3; type: "QAbstractAxis"; isPointer: true }
67 Property { name: "axisAngular"; revision: 3; type: "QAbstractAxis"; isPointer: true }
68 Property { name: "axisRadial"; revision: 3; type: "QAbstractAxis"; isPointer: true }
68 Property { name: "axisRadial"; revision: 3; type: "QAbstractAxis"; isPointer: true }
69 Property { name: "borderWidth"; revision: 1; type: "double" }
69 Property { name: "borderWidth"; revision: 1; type: "double" }
70 Signal {
70 Signal {
71 name: "axisXChanged"
71 name: "axisXChanged"
72 revision: 1
72 revision: 1
73 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
73 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
74 }
74 }
75 Signal {
75 Signal {
76 name: "axisYChanged"
76 name: "axisYChanged"
77 revision: 1
77 revision: 1
78 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
78 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
79 }
79 }
80 Signal {
80 Signal {
81 name: "borderWidthChanged"
81 name: "borderWidthChanged"
82 revision: 1
82 revision: 1
83 Parameter { name: "width"; type: "double" }
83 Parameter { name: "width"; type: "double" }
84 }
84 }
85 Signal {
85 Signal {
86 name: "axisXTopChanged"
86 name: "axisXTopChanged"
87 revision: 2
87 revision: 2
88 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
88 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
89 }
89 }
90 Signal {
90 Signal {
91 name: "axisYRightChanged"
91 name: "axisYRightChanged"
92 revision: 2
92 revision: 2
93 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
93 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
94 }
94 }
95 Signal {
95 Signal {
96 name: "axisAngularChanged"
96 name: "axisAngularChanged"
97 revision: 3
97 revision: 3
98 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
98 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
99 }
99 }
100 Signal {
100 Signal {
101 name: "axisRadialChanged"
101 name: "axisRadialChanged"
102 revision: 3
102 revision: 3
103 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
103 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
104 }
104 }
105 }
105 }
106 Component {
106 Component {
107 name: "QtCommercialChart::DeclarativeAxes"
107 name: "QtCommercialChart::DeclarativeAxes"
108 prototype: "QObject"
108 prototype: "QObject"
109 exports: ["QtCommercial.Chart/DeclarativeAxes 1.0"]
109 exports: ["QtCommercial.Chart/DeclarativeAxes 1.0"]
110 isCreatable: false
110 isCreatable: false
111 exportMetaObjectRevisions: [0]
111 exportMetaObjectRevisions: [0]
112 Property { name: "axisX"; type: "QAbstractAxis"; isPointer: true }
112 Property { name: "axisX"; type: "QAbstractAxis"; isPointer: true }
113 Property { name: "axisY"; type: "QAbstractAxis"; isPointer: true }
113 Property { name: "axisY"; type: "QAbstractAxis"; isPointer: true }
114 Property { name: "axisXTop"; type: "QAbstractAxis"; isPointer: true }
114 Property { name: "axisXTop"; type: "QAbstractAxis"; isPointer: true }
115 Property { name: "axisYRight"; type: "QAbstractAxis"; isPointer: true }
115 Property { name: "axisYRight"; type: "QAbstractAxis"; isPointer: true }
116 Signal {
116 Signal {
117 name: "axisXChanged"
117 name: "axisXChanged"
118 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
118 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
119 }
119 }
120 Signal {
120 Signal {
121 name: "axisYChanged"
121 name: "axisYChanged"
122 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
122 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
123 }
123 }
124 Signal {
124 Signal {
125 name: "axisXTopChanged"
125 name: "axisXTopChanged"
126 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
126 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
127 }
127 }
128 Signal {
128 Signal {
129 name: "axisYRightChanged"
129 name: "axisYRightChanged"
130 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
130 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
131 }
131 }
132 }
132 }
133 Component {
133 Component {
134 name: "QtCommercialChart::DeclarativeBarSeries"
134 name: "QtCommercialChart::DeclarativeBarSeries"
135 defaultProperty: "seriesChildren"
135 defaultProperty: "seriesChildren"
136 prototype: "QtCommercialChart::QBarSeries"
136 prototype: "QtCommercialChart::QBarSeries"
137 exports: [
137 exports: [
138 "QtCommercial.Chart/BarSeries 1.0",
138 "QtCommercial.Chart/BarSeries 1.0",
139 "QtCommercial.Chart/BarSeries 1.1",
139 "QtCommercial.Chart/BarSeries 1.1",
140 "QtCommercial.Chart/BarSeries 1.2"
140 "QtCommercial.Chart/BarSeries 1.2"
141 ]
141 ]
142 exportMetaObjectRevisions: [0, 1, 2]
142 exportMetaObjectRevisions: [0, 1, 2]
143 Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true }
143 Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true }
144 Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true }
144 Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true }
145 Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true }
145 Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true }
146 Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true }
146 Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true }
147 Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true }
147 Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true }
148 Signal {
148 Signal {
149 name: "axisXChanged"
149 name: "axisXChanged"
150 revision: 1
150 revision: 1
151 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
151 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
152 }
152 }
153 Signal {
153 Signal {
154 name: "axisYChanged"
154 name: "axisYChanged"
155 revision: 1
155 revision: 1
156 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
156 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
157 }
157 }
158 Signal {
158 Signal {
159 name: "axisXTopChanged"
159 name: "axisXTopChanged"
160 revision: 2
160 revision: 2
161 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
161 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
162 }
162 }
163 Signal {
163 Signal {
164 name: "axisYRightChanged"
164 name: "axisYRightChanged"
165 revision: 2
165 revision: 2
166 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
166 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
167 }
167 }
168 Method {
168 Method {
169 name: "appendSeriesChildren"
169 name: "appendSeriesChildren"
170 Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true }
170 Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true }
171 Parameter { name: "element"; type: "QObject"; isPointer: true }
171 Parameter { name: "element"; type: "QObject"; isPointer: true }
172 }
172 }
173 Method {
173 Method {
174 name: "at"
174 name: "at"
175 type: "DeclarativeBarSet*"
175 type: "DeclarativeBarSet*"
176 Parameter { name: "index"; type: "int" }
176 Parameter { name: "index"; type: "int" }
177 }
177 }
178 Method {
178 Method {
179 name: "append"
179 name: "append"
180 type: "DeclarativeBarSet*"
180 type: "DeclarativeBarSet*"
181 Parameter { name: "label"; type: "string" }
181 Parameter { name: "label"; type: "string" }
182 Parameter { name: "values"; type: "QVariantList" }
182 Parameter { name: "values"; type: "QVariantList" }
183 }
183 }
184 Method {
184 Method {
185 name: "insert"
185 name: "insert"
186 type: "DeclarativeBarSet*"
186 type: "DeclarativeBarSet*"
187 Parameter { name: "index"; type: "int" }
187 Parameter { name: "index"; type: "int" }
188 Parameter { name: "label"; type: "string" }
188 Parameter { name: "label"; type: "string" }
189 Parameter { name: "values"; type: "QVariantList" }
189 Parameter { name: "values"; type: "QVariantList" }
190 }
190 }
191 Method {
191 Method {
192 name: "remove"
192 name: "remove"
193 type: "bool"
193 type: "bool"
194 Parameter { name: "barset"; type: "QBarSet"; isPointer: true }
194 Parameter { name: "barset"; type: "QBarSet"; isPointer: true }
195 }
195 }
196 Method { name: "clear" }
196 Method { name: "clear" }
197 }
197 }
198 Component {
198 Component {
199 name: "QtCommercialChart::DeclarativeBarSet"
199 name: "QtCommercialChart::DeclarativeBarSet"
200 prototype: "QtCommercialChart::QBarSet"
200 prototype: "QtCommercialChart::QBarSet"
201 exports: [
201 exports: [
202 "QtCommercial.Chart/BarSet 1.0",
202 "QtCommercial.Chart/BarSet 1.0",
203 "QtCommercial.Chart/BarSet 1.1"
203 "QtCommercial.Chart/BarSet 1.1"
204 ]
204 ]
205 exportMetaObjectRevisions: [0, 0]
205 exportMetaObjectRevisions: [0, 0]
206 Property { name: "values"; type: "QVariantList" }
206 Property { name: "values"; type: "QVariantList" }
207 Property { name: "borderWidth"; revision: 1; type: "double" }
207 Property { name: "borderWidth"; revision: 1; type: "double" }
208 Property { name: "count"; type: "int"; isReadonly: true }
208 Property { name: "count"; type: "int"; isReadonly: true }
209 Signal {
209 Signal {
210 name: "countChanged"
210 name: "countChanged"
211 Parameter { name: "count"; type: "int" }
211 Parameter { name: "count"; type: "int" }
212 }
212 }
213 Signal {
213 Signal {
214 name: "borderWidthChanged"
214 name: "borderWidthChanged"
215 revision: 1
215 revision: 1
216 Parameter { name: "width"; type: "double" }
216 Parameter { name: "width"; type: "double" }
217 }
217 }
218 Method {
218 Method {
219 name: "append"
219 name: "append"
220 Parameter { name: "value"; type: "double" }
220 Parameter { name: "value"; type: "double" }
221 }
221 }
222 Method {
222 Method {
223 name: "remove"
223 name: "remove"
224 Parameter { name: "index"; type: "int" }
224 Parameter { name: "index"; type: "int" }
225 Parameter { name: "count"; type: "int" }
225 Parameter { name: "count"; type: "int" }
226 }
226 }
227 Method {
227 Method {
228 name: "remove"
228 name: "remove"
229 Parameter { name: "index"; type: "int" }
229 Parameter { name: "index"; type: "int" }
230 }
230 }
231 Method {
231 Method {
232 name: "replace"
232 name: "replace"
233 Parameter { name: "index"; type: "int" }
233 Parameter { name: "index"; type: "int" }
234 Parameter { name: "value"; type: "double" }
234 Parameter { name: "value"; type: "double" }
235 }
235 }
236 Method {
236 Method {
237 name: "at"
237 name: "at"
238 type: "double"
238 type: "double"
239 Parameter { name: "index"; type: "int" }
239 Parameter { name: "index"; type: "int" }
240 }
240 }
241 }
241 }
242 Component {
242 Component {
243 name: "QtCommercialChart::DeclarativeBoxPlotSeries"
243 name: "QtCommercialChart::DeclarativeBoxPlotSeries"
244 defaultProperty: "seriesChildren"
244 defaultProperty: "seriesChildren"
245 prototype: "QtCommercialChart::QBoxPlotSeries"
245 prototype: "QtCommercialChart::QBoxPlotSeries"
246 exports: ["QtCommercial.Chart/BoxPlotSeries 1.3"]
246 exports: ["QtCommercial.Chart/BoxPlotSeries 1.3"]
247 exportMetaObjectRevisions: [0]
247 exportMetaObjectRevisions: [0]
248 Property { name: "axisX"; type: "QAbstractAxis"; isPointer: true }
248 Property { name: "axisX"; type: "QAbstractAxis"; isPointer: true }
249 Property { name: "axisY"; type: "QAbstractAxis"; isPointer: true }
249 Property { name: "axisY"; type: "QAbstractAxis"; isPointer: true }
250 Property { name: "axisXTop"; type: "QAbstractAxis"; isPointer: true }
250 Property { name: "axisXTop"; type: "QAbstractAxis"; isPointer: true }
251 Property { name: "axisYRight"; type: "QAbstractAxis"; isPointer: true }
251 Property { name: "axisYRight"; type: "QAbstractAxis"; isPointer: true }
252 Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true }
252 Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true }
253 Signal {
253 Signal {
254 name: "axisXChanged"
254 name: "axisXChanged"
255 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
255 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
256 }
256 }
257 Signal {
257 Signal {
258 name: "axisYChanged"
258 name: "axisYChanged"
259 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
259 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
260 }
260 }
261 Signal {
261 Signal {
262 name: "axisXTopChanged"
262 name: "axisXTopChanged"
263 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
263 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
264 }
264 }
265 Signal {
265 Signal {
266 name: "axisYRightChanged"
266 name: "axisYRightChanged"
267 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
267 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
268 }
268 }
269 Signal {
269 Signal {
270 name: "clicked"
270 name: "clicked"
271 Parameter { name: "boxset"; type: "DeclarativeBoxSet"; isPointer: true }
271 Parameter { name: "boxset"; type: "DeclarativeBoxSet"; isPointer: true }
272 }
272 }
273 Signal {
273 Signal {
274 name: "hovered"
274 name: "hovered"
275 Parameter { name: "status"; type: "bool" }
275 Parameter { name: "status"; type: "bool" }
276 Parameter { name: "boxset"; type: "DeclarativeBoxSet"; isPointer: true }
276 Parameter { name: "boxset"; type: "DeclarativeBoxSet"; isPointer: true }
277 }
277 }
278 Method {
278 Method {
279 name: "appendSeriesChildren"
279 name: "appendSeriesChildren"
280 Parameter { name: "list"; type: "QDECLARATIVE_LIST_PROPERTY<QObject>"; isPointer: true }
280 Parameter { name: "list"; type: "QDECLARATIVE_LIST_PROPERTY<QObject>"; isPointer: true }
281 Parameter { name: "element"; type: "QObject"; isPointer: true }
281 Parameter { name: "element"; type: "QObject"; isPointer: true }
282 }
282 }
283 Method {
283 Method {
284 name: "onHovered"
284 name: "onHovered"
285 Parameter { name: "status"; type: "bool" }
285 Parameter { name: "status"; type: "bool" }
286 Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true }
286 Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true }
287 }
287 }
288 Method {
288 Method {
289 name: "onClicked"
289 name: "onClicked"
290 Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true }
290 Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true }
291 }
291 }
292 Method {
292 Method {
293 name: "at"
293 name: "at"
294 type: "DeclarativeBoxSet*"
294 type: "DeclarativeBoxSet*"
295 Parameter { name: "index"; type: "int" }
295 Parameter { name: "index"; type: "int" }
296 }
296 }
297 Method {
297 Method {
298 name: "append"
298 name: "append"
299 type: "DeclarativeBoxSet*"
299 type: "DeclarativeBoxSet*"
300 Parameter { name: "label"; type: "string" }
300 Parameter { name: "label"; type: "string" }
301 Parameter { name: "values"; type: "QVariantList" }
301 Parameter { name: "values"; type: "QVariantList" }
302 }
302 }
303 Method {
303 Method {
304 name: "append"
304 name: "append"
305 Parameter { name: "box"; type: "DeclarativeBoxSet"; isPointer: true }
305 Parameter { name: "box"; type: "DeclarativeBoxSet"; isPointer: true }
306 }
306 }
307 Method {
307 Method {
308 name: "insert"
308 name: "insert"
309 type: "DeclarativeBoxSet*"
309 type: "DeclarativeBoxSet*"
310 Parameter { name: "index"; type: "int" }
310 Parameter { name: "index"; type: "int" }
311 Parameter { name: "label"; type: "string" }
311 Parameter { name: "label"; type: "string" }
312 Parameter { name: "values"; type: "QVariantList" }
312 Parameter { name: "values"; type: "QVariantList" }
313 }
313 }
314 Method {
314 Method {
315 name: "remove"
315 name: "remove"
316 type: "bool"
316 type: "bool"
317 Parameter { name: "box"; type: "DeclarativeBoxSet"; isPointer: true }
317 Parameter { name: "box"; type: "DeclarativeBoxSet"; isPointer: true }
318 }
318 }
319 Method { name: "clear" }
319 Method { name: "clear" }
320 }
320 }
321 Component {
321 Component {
322 name: "QtCommercialChart::DeclarativeBoxSet"
322 name: "QtCommercialChart::DeclarativeBoxSet"
323 prototype: "QtCommercialChart::QBoxSet"
323 prototype: "QtCommercialChart::QBoxSet"
324 exports: ["QtCommercial.Chart/BoxSet 1.3"]
324 exports: ["QtCommercial.Chart/BoxSet 1.3"]
325 exportMetaObjectRevisions: [0]
325 exportMetaObjectRevisions: [0]
326 Enum {
326 Enum {
327 name: "ValuePositions"
327 name: "ValuePositions"
328 values: {
328 values: {
329 "LowerExtreme": 0,
329 "LowerExtreme": 0,
330 "LowerQuartile": 1,
330 "LowerQuartile": 1,
331 "Median": 2,
331 "Median": 2,
332 "UpperQuartile": 3,
332 "UpperQuartile": 3,
333 "UpperExtreme": 4
333 "UpperExtreme": 4
334 }
334 }
335 }
335 }
336 Property { name: "values"; type: "QVariantList" }
336 Property { name: "values"; type: "QVariantList" }
337 Property { name: "label"; type: "string" }
337 Property { name: "label"; type: "string" }
338 Property { name: "count"; type: "int"; isReadonly: true }
338 Property { name: "count"; type: "int"; isReadonly: true }
339 Signal { name: "changedValues" }
339 Signal { name: "changedValues" }
340 Signal {
340 Signal {
341 name: "changedValue"
341 name: "changedValue"
342 Parameter { name: "index"; type: "int" }
342 Parameter { name: "index"; type: "int" }
343 }
343 }
344 Method {
344 Method {
345 name: "append"
345 name: "append"
346 Parameter { name: "value"; type: "double" }
346 Parameter { name: "value"; type: "double" }
347 }
347 }
348 Method { name: "clear" }
348 Method { name: "clear" }
349 Method {
349 Method {
350 name: "at"
350 name: "at"
351 type: "double"
351 type: "double"
352 Parameter { name: "index"; type: "int" }
352 Parameter { name: "index"; type: "int" }
353 }
353 }
354 Method {
354 Method {
355 name: "setValue"
355 name: "setValue"
356 Parameter { name: "index"; type: "int" }
356 Parameter { name: "index"; type: "int" }
357 Parameter { name: "value"; type: "double" }
357 Parameter { name: "value"; type: "double" }
358 }
358 }
359 }
359 }
360 Component {
360 Component {
361 name: "QtCommercialChart::DeclarativeCategoryAxis"
361 name: "QtCommercialChart::DeclarativeCategoryAxis"
362 defaultProperty: "axisChildren"
362 defaultProperty: "axisChildren"
363 prototype: "QtCommercialChart::QCategoryAxis"
363 prototype: "QtCommercialChart::QCategoryAxis"
364 exports: ["QtCommercial.Chart/CategoryAxis 1.1"]
364 exports: ["QtCommercial.Chart/CategoryAxis 1.1"]
365 exportMetaObjectRevisions: [0]
365 exportMetaObjectRevisions: [0]
366 Property { name: "axisChildren"; type: "QObject"; isList: true; isReadonly: true }
366 Property { name: "axisChildren"; type: "QObject"; isList: true; isReadonly: true }
367 Method {
367 Method {
368 name: "append"
368 name: "append"
369 Parameter { name: "label"; type: "string" }
369 Parameter { name: "label"; type: "string" }
370 Parameter { name: "categoryEndValue"; type: "double" }
370 Parameter { name: "categoryEndValue"; type: "double" }
371 }
371 }
372 Method {
372 Method {
373 name: "remove"
373 name: "remove"
374 Parameter { name: "label"; type: "string" }
374 Parameter { name: "label"; type: "string" }
375 }
375 }
376 Method {
376 Method {
377 name: "replace"
377 name: "replace"
378 Parameter { name: "oldLabel"; type: "string" }
378 Parameter { name: "oldLabel"; type: "string" }
379 Parameter { name: "newLabel"; type: "string" }
379 Parameter { name: "newLabel"; type: "string" }
380 }
380 }
381 Method {
381 Method {
382 name: "appendAxisChildren"
382 name: "appendAxisChildren"
383 Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true }
383 Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true }
384 Parameter { name: "element"; type: "QObject"; isPointer: true }
384 Parameter { name: "element"; type: "QObject"; isPointer: true }
385 }
385 }
386 }
386 }
387 Component {
387 Component {
388 name: "QtCommercialChart::DeclarativeCategoryRange"
388 name: "QtCommercialChart::DeclarativeCategoryRange"
389 prototype: "QObject"
389 prototype: "QObject"
390 exports: ["QtCommercial.Chart/CategoryRange 1.1"]
390 exports: ["QtCommercial.Chart/CategoryRange 1.1"]
391 exportMetaObjectRevisions: [0]
391 exportMetaObjectRevisions: [0]
392 Property { name: "endValue"; type: "double" }
392 Property { name: "endValue"; type: "double" }
393 Property { name: "label"; type: "string" }
393 Property { name: "label"; type: "string" }
394 }
394 }
395 Component {
395 Component {
396 name: "QtCommercialChart::DeclarativeChart"
396 name: "QtCommercialChart::DeclarativeChart"
397 defaultProperty: "data"
397 defaultProperty: "data"
398 prototype: "QQuickPaintedItem"
398 prototype: "QQuickPaintedItem"
399 exports: [
399 exports: [
400 "QtCommercial.Chart/ChartView 1.0",
400 "QtCommercial.Chart/ChartView 1.0",
401 "QtCommercial.Chart/ChartView 1.1",
401 "QtCommercial.Chart/ChartView 1.1",
402 "QtCommercial.Chart/ChartView 1.2",
402 "QtCommercial.Chart/ChartView 1.2",
403 "QtCommercial.Chart/ChartView 1.3"
403 "QtCommercial.Chart/ChartView 1.3"
404 ]
404 ]
405 exportMetaObjectRevisions: [0, 1, 2, 3]
405 exportMetaObjectRevisions: [0, 1, 2, 3]
406 Enum {
406 Enum {
407 name: "Theme"
407 name: "Theme"
408 values: {
408 values: {
409 "ChartThemeLight": 0,
409 "ChartThemeLight": 0,
410 "ChartThemeBlueCerulean": 1,
410 "ChartThemeBlueCerulean": 1,
411 "ChartThemeDark": 2,
411 "ChartThemeDark": 2,
412 "ChartThemeBrownSand": 3,
412 "ChartThemeBrownSand": 3,
413 "ChartThemeBlueNcs": 4,
413 "ChartThemeBlueNcs": 4,
414 "ChartThemeHighContrast": 5,
414 "ChartThemeHighContrast": 5,
415 "ChartThemeBlueIcy": 6,
415 "ChartThemeBlueIcy": 6,
416 "ChartThemeQt": 7
416 "ChartThemeQt": 7
417 }
417 }
418 }
418 }
419 Enum {
419 Enum {
420 name: "Animation"
420 name: "Animation"
421 values: {
421 values: {
422 "NoAnimation": 0,
422 "NoAnimation": 0,
423 "GridAxisAnimations": 1,
423 "GridAxisAnimations": 1,
424 "SeriesAnimations": 2,
424 "SeriesAnimations": 2,
425 "AllAnimations": 3
425 "AllAnimations": 3
426 }
426 }
427 }
427 }
428 Enum {
428 Enum {
429 name: "SeriesType"
429 name: "SeriesType"
430 values: {
430 values: {
431 "SeriesTypeLine": 0,
431 "SeriesTypeLine": 0,
432 "SeriesTypeArea": 1,
432 "SeriesTypeArea": 1,
433 "SeriesTypeBar": 2,
433 "SeriesTypeBar": 2,
434 "SeriesTypeStackedBar": 3,
434 "SeriesTypeStackedBar": 3,
435 "SeriesTypePercentBar": 4,
435 "SeriesTypePercentBar": 4,
436 "SeriesTypeBoxPlot": 5,
436 "SeriesTypeBoxPlot": 5,
437 "SeriesTypePie": 6,
437 "SeriesTypePie": 6,
438 "SeriesTypeScatter": 7,
438 "SeriesTypeScatter": 7,
439 "SeriesTypeSpline": 8,
439 "SeriesTypeSpline": 8,
440 "SeriesTypeHorizontalBar": 9,
440 "SeriesTypeHorizontalBar": 9,
441 "SeriesTypeHorizontalStackedBar": 10,
441 "SeriesTypeHorizontalStackedBar": 10,
442 "SeriesTypeHorizontalPercentBar": 11
442 "SeriesTypeHorizontalPercentBar": 11
443 }
443 }
444 }
444 }
445 Property { name: "theme"; type: "Theme" }
445 Property { name: "theme"; type: "Theme" }
446 Property { name: "animationOptions"; type: "Animation" }
446 Property { name: "animationOptions"; type: "Animation" }
447 Property { name: "title"; type: "string" }
447 Property { name: "title"; type: "string" }
448 Property { name: "titleFont"; type: "QFont" }
448 Property { name: "titleFont"; type: "QFont" }
449 Property { name: "titleColor"; type: "QColor" }
449 Property { name: "titleColor"; type: "QColor" }
450 Property { name: "legend"; type: "QLegend"; isReadonly: true; isPointer: true }
450 Property { name: "legend"; type: "QLegend"; isReadonly: true; isPointer: true }
451 Property { name: "count"; type: "int"; isReadonly: true }
451 Property { name: "count"; type: "int"; isReadonly: true }
452 Property { name: "backgroundColor"; type: "QColor" }
452 Property { name: "backgroundColor"; type: "QColor" }
453 Property { name: "dropShadowEnabled"; type: "bool" }
453 Property { name: "dropShadowEnabled"; type: "bool" }
454 Property { name: "backgroundRoundness"; revision: 3; type: "double" }
454 Property { name: "backgroundRoundness"; revision: 3; type: "double" }
455 Property { name: "topMargin"; type: "double"; isReadonly: true }
455 Property { name: "topMargin"; type: "double"; isReadonly: true }
456 Property { name: "bottomMargin"; type: "double"; isReadonly: true }
456 Property { name: "bottomMargin"; type: "double"; isReadonly: true }
457 Property { name: "leftMargin"; type: "double"; isReadonly: true }
457 Property { name: "leftMargin"; type: "double"; isReadonly: true }
458 Property { name: "rightMargin"; type: "double"; isReadonly: true }
458 Property { name: "rightMargin"; type: "double"; isReadonly: true }
459 Property {
459 Property {
460 name: "minimumMargins"
460 name: "minimumMargins"
461 revision: 1
461 revision: 1
462 type: "DeclarativeMargins"
462 type: "DeclarativeMargins"
463 isReadonly: true
463 isReadonly: true
464 isPointer: true
464 isPointer: true
465 }
465 }
466 Property {
466 Property {
467 name: "margins"
467 name: "margins"
468 revision: 2
468 revision: 2
469 type: "DeclarativeMargins"
469 type: "DeclarativeMargins"
470 isReadonly: true
470 isReadonly: true
471 isPointer: true
471 isPointer: true
472 }
472 }
473 Property { name: "plotArea"; revision: 1; type: "QRectF"; isReadonly: true }
473 Property { name: "plotArea"; revision: 1; type: "QRectF"; isReadonly: true }
474 Property { name: "plotAreaColor"; revision: 3; type: "QColor" }
474 Property { name: "plotAreaColor"; revision: 3; type: "QColor" }
475 Property { name: "axes"; revision: 2; type: "QAbstractAxis"; isList: true; isReadonly: true }
475 Property { name: "axes"; revision: 2; type: "QAbstractAxis"; isList: true; isReadonly: true }
476 Signal { name: "axisLabelsChanged" }
476 Signal { name: "axisLabelsChanged" }
477 Signal {
477 Signal {
478 name: "titleColorChanged"
478 name: "titleColorChanged"
479 Parameter { name: "color"; type: "QColor" }
479 Parameter { name: "color"; type: "QColor" }
480 }
480 }
481 Signal {
481 Signal {
482 name: "dropShadowEnabledChanged"
482 name: "dropShadowEnabledChanged"
483 Parameter { name: "enabled"; type: "bool" }
483 Parameter { name: "enabled"; type: "bool" }
484 }
484 }
485 Signal { name: "marginsChanged"; revision: 2 }
485 Signal { name: "marginsChanged"; revision: 2 }
486 Signal {
486 Signal {
487 name: "plotAreaChanged"
487 name: "plotAreaChanged"
488 Parameter { name: "plotArea"; type: "QRectF" }
488 Parameter { name: "plotArea"; type: "QRectF" }
489 }
489 }
490 Signal {
490 Signal {
491 name: "seriesAdded"
491 name: "seriesAdded"
492 Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true }
492 Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true }
493 }
493 }
494 Signal {
494 Signal {
495 name: "seriesRemoved"
495 name: "seriesRemoved"
496 Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true }
496 Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true }
497 }
497 }
498 Signal { name: "plotAreaColorChanged"; revision: 3 }
498 Signal { name: "plotAreaColorChanged"; revision: 3 }
499 Signal {
499 Signal {
500 name: "backgroundRoundnessChanged"
500 name: "backgroundRoundnessChanged"
501 revision: 3
501 revision: 3
502 Parameter { name: "diameter"; type: "double" }
502 Parameter { name: "diameter"; type: "double" }
503 }
503 }
504 Method {
504 Method {
505 name: "series"
505 name: "series"
506 type: "QAbstractSeries*"
506 type: "QAbstractSeries*"
507 Parameter { name: "index"; type: "int" }
507 Parameter { name: "index"; type: "int" }
508 }
508 }
509 Method {
509 Method {
510 name: "series"
510 name: "series"
511 type: "QAbstractSeries*"
511 type: "QAbstractSeries*"
512 Parameter { name: "seriesName"; type: "string" }
512 Parameter { name: "seriesName"; type: "string" }
513 }
513 }
514 Method {
514 Method {
515 name: "createSeries"
515 name: "createSeries"
516 type: "QAbstractSeries*"
516 type: "QAbstractSeries*"
517 Parameter { name: "type"; type: "int" }
517 Parameter { name: "type"; type: "int" }
518 Parameter { name: "name"; type: "string" }
518 Parameter { name: "name"; type: "string" }
519 Parameter { name: "axisX"; type: "QAbstractAxis"; isPointer: true }
519 Parameter { name: "axisX"; type: "QAbstractAxis"; isPointer: true }
520 Parameter { name: "axisY"; type: "QAbstractAxis"; isPointer: true }
520 Parameter { name: "axisY"; type: "QAbstractAxis"; isPointer: true }
521 }
521 }
522 Method {
522 Method {
523 name: "createSeries"
523 name: "createSeries"
524 type: "QAbstractSeries*"
524 type: "QAbstractSeries*"
525 Parameter { name: "type"; type: "int" }
525 Parameter { name: "type"; type: "int" }
526 Parameter { name: "name"; type: "string" }
526 Parameter { name: "name"; type: "string" }
527 Parameter { name: "axisX"; type: "QAbstractAxis"; isPointer: true }
527 Parameter { name: "axisX"; type: "QAbstractAxis"; isPointer: true }
528 }
528 }
529 Method {
529 Method {
530 name: "createSeries"
530 name: "createSeries"
531 type: "QAbstractSeries*"
531 type: "QAbstractSeries*"
532 Parameter { name: "type"; type: "int" }
532 Parameter { name: "type"; type: "int" }
533 Parameter { name: "name"; type: "string" }
533 Parameter { name: "name"; type: "string" }
534 }
534 }
535 Method {
535 Method {
536 name: "createSeries"
536 name: "createSeries"
537 type: "QAbstractSeries*"
537 type: "QAbstractSeries*"
538 Parameter { name: "type"; type: "int" }
538 Parameter { name: "type"; type: "int" }
539 }
539 }
540 Method {
540 Method {
541 name: "removeSeries"
541 name: "removeSeries"
542 Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true }
542 Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true }
543 }
543 }
544 Method { name: "removeAllSeries" }
544 Method { name: "removeAllSeries" }
545 Method {
545 Method {
546 name: "setAxisX"
546 name: "setAxisX"
547 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
547 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
548 Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true }
548 Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true }
549 }
549 }
550 Method {
550 Method {
551 name: "setAxisX"
551 name: "setAxisX"
552 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
552 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
553 }
553 }
554 Method {
554 Method {
555 name: "setAxisY"
555 name: "setAxisY"
556 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
556 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
557 Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true }
557 Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true }
558 }
558 }
559 Method {
559 Method {
560 name: "setAxisY"
560 name: "setAxisY"
561 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
561 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
562 }
562 }
563 Method { name: "createDefaultAxes" }
563 Method { name: "createDefaultAxes" }
564 Method {
564 Method {
565 name: "axisX"
565 name: "axisX"
566 type: "QAbstractAxis*"
566 type: "QAbstractAxis*"
567 Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true }
567 Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true }
568 }
568 }
569 Method { name: "axisX"; type: "QAbstractAxis*" }
569 Method { name: "axisX"; type: "QAbstractAxis*" }
570 Method {
570 Method {
571 name: "axisY"
571 name: "axisY"
572 type: "QAbstractAxis*"
572 type: "QAbstractAxis*"
573 Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true }
573 Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true }
574 }
574 }
575 Method { name: "axisY"; type: "QAbstractAxis*" }
575 Method { name: "axisY"; type: "QAbstractAxis*" }
576 Method {
576 Method {
577 name: "zoom"
577 name: "zoom"
578 Parameter { name: "factor"; type: "double" }
578 Parameter { name: "factor"; type: "double" }
579 }
579 }
580 Method {
580 Method {
581 name: "scrollLeft"
581 name: "scrollLeft"
582 Parameter { name: "pixels"; type: "double" }
582 Parameter { name: "pixels"; type: "double" }
583 }
583 }
584 Method {
584 Method {
585 name: "scrollRight"
585 name: "scrollRight"
586 Parameter { name: "pixels"; type: "double" }
586 Parameter { name: "pixels"; type: "double" }
587 }
587 }
588 Method {
588 Method {
589 name: "scrollUp"
589 name: "scrollUp"
590 Parameter { name: "pixels"; type: "double" }
590 Parameter { name: "pixels"; type: "double" }
591 }
591 }
592 Method {
592 Method {
593 name: "scrollDown"
593 name: "scrollDown"
594 Parameter { name: "pixels"; type: "double" }
594 Parameter { name: "pixels"; type: "double" }
595 }
595 }
596 }
596 }
597 Component {
597 Component {
598 name: "QtCommercialChart::DeclarativeHorizontalBarSeries"
598 name: "QtCommercialChart::DeclarativeHorizontalBarSeries"
599 defaultProperty: "seriesChildren"
599 defaultProperty: "seriesChildren"
600 prototype: "QtCommercialChart::QHorizontalBarSeries"
600 prototype: "QtCommercialChart::QHorizontalBarSeries"
601 exports: [
601 exports: [
602 "QtCommercial.Chart/HorizontalBarSeries 1.1",
602 "QtCommercial.Chart/HorizontalBarSeries 1.1",
603 "QtCommercial.Chart/HorizontalBarSeries 1.2"
603 "QtCommercial.Chart/HorizontalBarSeries 1.2"
604 ]
604 ]
605 exportMetaObjectRevisions: [1, 2]
605 exportMetaObjectRevisions: [1, 2]
606 Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true }
606 Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true }
607 Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true }
607 Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true }
608 Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true }
608 Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true }
609 Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true }
609 Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true }
610 Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true }
610 Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true }
611 Signal {
611 Signal {
612 name: "axisXChanged"
612 name: "axisXChanged"
613 revision: 1
613 revision: 1
614 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
614 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
615 }
615 }
616 Signal {
616 Signal {
617 name: "axisYChanged"
617 name: "axisYChanged"
618 revision: 1
618 revision: 1
619 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
619 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
620 }
620 }
621 Signal {
621 Signal {
622 name: "axisXTopChanged"
622 name: "axisXTopChanged"
623 revision: 2
623 revision: 2
624 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
624 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
625 }
625 }
626 Signal {
626 Signal {
627 name: "axisYRightChanged"
627 name: "axisYRightChanged"
628 revision: 2
628 revision: 2
629 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
629 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
630 }
630 }
631 Method {
631 Method {
632 name: "appendSeriesChildren"
632 name: "appendSeriesChildren"
633 Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true }
633 Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true }
634 Parameter { name: "element"; type: "QObject"; isPointer: true }
634 Parameter { name: "element"; type: "QObject"; isPointer: true }
635 }
635 }
636 Method {
636 Method {
637 name: "at"
637 name: "at"
638 type: "DeclarativeBarSet*"
638 type: "DeclarativeBarSet*"
639 Parameter { name: "index"; type: "int" }
639 Parameter { name: "index"; type: "int" }
640 }
640 }
641 Method {
641 Method {
642 name: "append"
642 name: "append"
643 type: "DeclarativeBarSet*"
643 type: "DeclarativeBarSet*"
644 Parameter { name: "label"; type: "string" }
644 Parameter { name: "label"; type: "string" }
645 Parameter { name: "values"; type: "QVariantList" }
645 Parameter { name: "values"; type: "QVariantList" }
646 }
646 }
647 Method {
647 Method {
648 name: "insert"
648 name: "insert"
649 type: "DeclarativeBarSet*"
649 type: "DeclarativeBarSet*"
650 Parameter { name: "index"; type: "int" }
650 Parameter { name: "index"; type: "int" }
651 Parameter { name: "label"; type: "string" }
651 Parameter { name: "label"; type: "string" }
652 Parameter { name: "values"; type: "QVariantList" }
652 Parameter { name: "values"; type: "QVariantList" }
653 }
653 }
654 Method {
654 Method {
655 name: "remove"
655 name: "remove"
656 type: "bool"
656 type: "bool"
657 Parameter { name: "barset"; type: "QBarSet"; isPointer: true }
657 Parameter { name: "barset"; type: "QBarSet"; isPointer: true }
658 }
658 }
659 Method { name: "clear" }
659 Method { name: "clear" }
660 }
660 }
661 Component {
661 Component {
662 name: "QtCommercialChart::DeclarativeHorizontalPercentBarSeries"
662 name: "QtCommercialChart::DeclarativeHorizontalPercentBarSeries"
663 defaultProperty: "seriesChildren"
663 defaultProperty: "seriesChildren"
664 prototype: "QtCommercialChart::QHorizontalPercentBarSeries"
664 prototype: "QtCommercialChart::QHorizontalPercentBarSeries"
665 exports: [
665 exports: [
666 "QtCommercial.Chart/HorizontalPercentBarSeries 1.1",
666 "QtCommercial.Chart/HorizontalPercentBarSeries 1.1",
667 "QtCommercial.Chart/HorizontalPercentBarSeries 1.2"
667 "QtCommercial.Chart/HorizontalPercentBarSeries 1.2"
668 ]
668 ]
669 exportMetaObjectRevisions: [1, 2]
669 exportMetaObjectRevisions: [1, 2]
670 Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true }
670 Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true }
671 Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true }
671 Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true }
672 Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true }
672 Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true }
673 Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true }
673 Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true }
674 Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true }
674 Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true }
675 Signal {
675 Signal {
676 name: "axisXChanged"
676 name: "axisXChanged"
677 revision: 1
677 revision: 1
678 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
678 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
679 }
679 }
680 Signal {
680 Signal {
681 name: "axisYChanged"
681 name: "axisYChanged"
682 revision: 1
682 revision: 1
683 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
683 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
684 }
684 }
685 Signal {
685 Signal {
686 name: "axisXTopChanged"
686 name: "axisXTopChanged"
687 revision: 2
687 revision: 2
688 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
688 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
689 }
689 }
690 Signal {
690 Signal {
691 name: "axisYRightChanged"
691 name: "axisYRightChanged"
692 revision: 2
692 revision: 2
693 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
693 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
694 }
694 }
695 Method {
695 Method {
696 name: "appendSeriesChildren"
696 name: "appendSeriesChildren"
697 Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true }
697 Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true }
698 Parameter { name: "element"; type: "QObject"; isPointer: true }
698 Parameter { name: "element"; type: "QObject"; isPointer: true }
699 }
699 }
700 Method {
700 Method {
701 name: "at"
701 name: "at"
702 type: "DeclarativeBarSet*"
702 type: "DeclarativeBarSet*"
703 Parameter { name: "index"; type: "int" }
703 Parameter { name: "index"; type: "int" }
704 }
704 }
705 Method {
705 Method {
706 name: "append"
706 name: "append"
707 type: "DeclarativeBarSet*"
707 type: "DeclarativeBarSet*"
708 Parameter { name: "label"; type: "string" }
708 Parameter { name: "label"; type: "string" }
709 Parameter { name: "values"; type: "QVariantList" }
709 Parameter { name: "values"; type: "QVariantList" }
710 }
710 }
711 Method {
711 Method {
712 name: "insert"
712 name: "insert"
713 type: "DeclarativeBarSet*"
713 type: "DeclarativeBarSet*"
714 Parameter { name: "index"; type: "int" }
714 Parameter { name: "index"; type: "int" }
715 Parameter { name: "label"; type: "string" }
715 Parameter { name: "label"; type: "string" }
716 Parameter { name: "values"; type: "QVariantList" }
716 Parameter { name: "values"; type: "QVariantList" }
717 }
717 }
718 Method {
718 Method {
719 name: "remove"
719 name: "remove"
720 type: "bool"
720 type: "bool"
721 Parameter { name: "barset"; type: "QBarSet"; isPointer: true }
721 Parameter { name: "barset"; type: "QBarSet"; isPointer: true }
722 }
722 }
723 Method { name: "clear" }
723 Method { name: "clear" }
724 }
724 }
725 Component {
725 Component {
726 name: "QtCommercialChart::DeclarativeHorizontalStackedBarSeries"
726 name: "QtCommercialChart::DeclarativeHorizontalStackedBarSeries"
727 defaultProperty: "seriesChildren"
727 defaultProperty: "seriesChildren"
728 prototype: "QtCommercialChart::QHorizontalStackedBarSeries"
728 prototype: "QtCommercialChart::QHorizontalStackedBarSeries"
729 exports: [
729 exports: [
730 "QtCommercial.Chart/HorizontalStackedBarSeries 1.1",
730 "QtCommercial.Chart/HorizontalStackedBarSeries 1.1",
731 "QtCommercial.Chart/HorizontalStackedBarSeries 1.2"
731 "QtCommercial.Chart/HorizontalStackedBarSeries 1.2"
732 ]
732 ]
733 exportMetaObjectRevisions: [1, 2]
733 exportMetaObjectRevisions: [1, 2]
734 Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true }
734 Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true }
735 Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true }
735 Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true }
736 Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true }
736 Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true }
737 Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true }
737 Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true }
738 Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true }
738 Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true }
739 Signal {
739 Signal {
740 name: "axisXChanged"
740 name: "axisXChanged"
741 revision: 1
741 revision: 1
742 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
742 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
743 }
743 }
744 Signal {
744 Signal {
745 name: "axisYChanged"
745 name: "axisYChanged"
746 revision: 1
746 revision: 1
747 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
747 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
748 }
748 }
749 Signal {
749 Signal {
750 name: "axisXTopChanged"
750 name: "axisXTopChanged"
751 revision: 2
751 revision: 2
752 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
752 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
753 }
753 }
754 Signal {
754 Signal {
755 name: "axisYRightChanged"
755 name: "axisYRightChanged"
756 revision: 2
756 revision: 2
757 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
757 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
758 }
758 }
759 Method {
759 Method {
760 name: "appendSeriesChildren"
760 name: "appendSeriesChildren"
761 Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true }
761 Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true }
762 Parameter { name: "element"; type: "QObject"; isPointer: true }
762 Parameter { name: "element"; type: "QObject"; isPointer: true }
763 }
763 }
764 Method {
764 Method {
765 name: "at"
765 name: "at"
766 type: "DeclarativeBarSet*"
766 type: "DeclarativeBarSet*"
767 Parameter { name: "index"; type: "int" }
767 Parameter { name: "index"; type: "int" }
768 }
768 }
769 Method {
769 Method {
770 name: "append"
770 name: "append"
771 type: "DeclarativeBarSet*"
771 type: "DeclarativeBarSet*"
772 Parameter { name: "label"; type: "string" }
772 Parameter { name: "label"; type: "string" }
773 Parameter { name: "values"; type: "QVariantList" }
773 Parameter { name: "values"; type: "QVariantList" }
774 }
774 }
775 Method {
775 Method {
776 name: "insert"
776 name: "insert"
777 type: "DeclarativeBarSet*"
777 type: "DeclarativeBarSet*"
778 Parameter { name: "index"; type: "int" }
778 Parameter { name: "index"; type: "int" }
779 Parameter { name: "label"; type: "string" }
779 Parameter { name: "label"; type: "string" }
780 Parameter { name: "values"; type: "QVariantList" }
780 Parameter { name: "values"; type: "QVariantList" }
781 }
781 }
782 Method {
782 Method {
783 name: "remove"
783 name: "remove"
784 type: "bool"
784 type: "bool"
785 Parameter { name: "barset"; type: "QBarSet"; isPointer: true }
785 Parameter { name: "barset"; type: "QBarSet"; isPointer: true }
786 }
786 }
787 Method { name: "clear" }
787 Method { name: "clear" }
788 }
788 }
789 Component {
789 Component {
790 name: "QtCommercialChart::DeclarativeLineSeries"
790 name: "QtCommercialChart::DeclarativeLineSeries"
791 defaultProperty: "declarativeChildren"
791 defaultProperty: "declarativeChildren"
792 prototype: "QtCommercialChart::QLineSeries"
792 prototype: "QtCommercialChart::QLineSeries"
793 exports: [
793 exports: [
794 "QtCommercial.Chart/LineSeries 1.0",
794 "QtCommercial.Chart/LineSeries 1.0",
795 "QtCommercial.Chart/LineSeries 1.1",
795 "QtCommercial.Chart/LineSeries 1.1",
796 "QtCommercial.Chart/LineSeries 1.2",
796 "QtCommercial.Chart/LineSeries 1.2",
797 "QtCommercial.Chart/LineSeries 1.3"
797 "QtCommercial.Chart/LineSeries 1.3"
798 ]
798 ]
799 exportMetaObjectRevisions: [0, 1, 2, 3]
799 exportMetaObjectRevisions: [0, 1, 2, 3]
800 Property { name: "count"; type: "int"; isReadonly: true }
800 Property { name: "count"; type: "int"; isReadonly: true }
801 Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true }
801 Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true }
802 Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true }
802 Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true }
803 Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true }
803 Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true }
804 Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true }
804 Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true }
805 Property { name: "axisAngular"; revision: 3; type: "QAbstractAxis"; isPointer: true }
805 Property { name: "axisAngular"; revision: 3; type: "QAbstractAxis"; isPointer: true }
806 Property { name: "axisRadial"; revision: 3; type: "QAbstractAxis"; isPointer: true }
806 Property { name: "axisRadial"; revision: 3; type: "QAbstractAxis"; isPointer: true }
807 Property { name: "width"; revision: 1; type: "double" }
807 Property { name: "width"; revision: 1; type: "double" }
808 Property { name: "style"; revision: 1; type: "Qt::PenStyle" }
808 Property { name: "style"; revision: 1; type: "Qt::PenStyle" }
809 Property { name: "capStyle"; revision: 1; type: "Qt::PenCapStyle" }
809 Property { name: "capStyle"; revision: 1; type: "Qt::PenCapStyle" }
810 Property { name: "declarativeChildren"; type: "QObject"; isList: true; isReadonly: true }
810 Property { name: "declarativeChildren"; type: "QObject"; isList: true; isReadonly: true }
811 Signal {
811 Signal {
812 name: "countChanged"
812 name: "countChanged"
813 Parameter { name: "count"; type: "int" }
813 Parameter { name: "count"; type: "int" }
814 }
814 }
815 Signal {
815 Signal {
816 name: "axisXChanged"
816 name: "axisXChanged"
817 revision: 1
817 revision: 1
818 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
818 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
819 }
819 }
820 Signal {
820 Signal {
821 name: "axisYChanged"
821 name: "axisYChanged"
822 revision: 1
822 revision: 1
823 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
823 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
824 }
824 }
825 Signal {
825 Signal {
826 name: "axisXTopChanged"
826 name: "axisXTopChanged"
827 revision: 2
827 revision: 2
828 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
828 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
829 }
829 }
830 Signal {
830 Signal {
831 name: "axisYRightChanged"
831 name: "axisYRightChanged"
832 revision: 2
832 revision: 2
833 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
833 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
834 }
834 }
835 Signal {
835 Signal {
836 name: "axisAngularChanged"
836 name: "axisAngularChanged"
837 revision: 3
837 revision: 3
838 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
838 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
839 }
839 }
840 Signal {
840 Signal {
841 name: "axisRadialChanged"
841 name: "axisRadialChanged"
842 revision: 3
842 revision: 3
843 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
843 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
844 }
844 }
845 Signal {
845 Signal {
846 name: "widthChanged"
846 name: "widthChanged"
847 revision: 1
847 revision: 1
848 Parameter { name: "width"; type: "double" }
848 Parameter { name: "width"; type: "double" }
849 }
849 }
850 Signal {
850 Signal {
851 name: "styleChanged"
851 name: "styleChanged"
852 revision: 1
852 revision: 1
853 Parameter { name: "style"; type: "Qt::PenStyle" }
853 Parameter { name: "style"; type: "Qt::PenStyle" }
854 }
854 }
855 Signal {
855 Signal {
856 name: "capStyleChanged"
856 name: "capStyleChanged"
857 revision: 1
857 revision: 1
858 Parameter { name: "capStyle"; type: "Qt::PenCapStyle" }
858 Parameter { name: "capStyle"; type: "Qt::PenCapStyle" }
859 }
859 }
860 Method {
860 Method {
861 name: "appendDeclarativeChildren"
861 name: "appendDeclarativeChildren"
862 Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true }
862 Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true }
863 Parameter { name: "element"; type: "QObject"; isPointer: true }
863 Parameter { name: "element"; type: "QObject"; isPointer: true }
864 }
864 }
865 Method {
865 Method {
866 name: "handleCountChanged"
866 name: "handleCountChanged"
867 Parameter { name: "index"; type: "int" }
867 Parameter { name: "index"; type: "int" }
868 }
868 }
869 Method {
869 Method {
870 name: "append"
870 name: "append"
871 Parameter { name: "x"; type: "double" }
871 Parameter { name: "x"; type: "double" }
872 Parameter { name: "y"; type: "double" }
872 Parameter { name: "y"; type: "double" }
873 }
873 }
874 Method {
874 Method {
875 name: "replace"
875 name: "replace"
876 Parameter { name: "oldX"; type: "double" }
876 Parameter { name: "oldX"; type: "double" }
877 Parameter { name: "oldY"; type: "double" }
877 Parameter { name: "oldY"; type: "double" }
878 Parameter { name: "newX"; type: "double" }
878 Parameter { name: "newX"; type: "double" }
879 Parameter { name: "newY"; type: "double" }
879 Parameter { name: "newY"; type: "double" }
880 }
880 }
881 Method {
881 Method {
882 name: "replace"
882 name: "replace"
883 revision: 3
883 revision: 3
884 Parameter { name: "index"; type: "int" }
884 Parameter { name: "index"; type: "int" }
885 Parameter { name: "newX"; type: "double" }
885 Parameter { name: "newX"; type: "double" }
886 Parameter { name: "newY"; type: "double" }
886 Parameter { name: "newY"; type: "double" }
887 }
887 }
888 Method {
888 Method {
889 name: "remove"
889 name: "remove"
890 Parameter { name: "x"; type: "double" }
890 Parameter { name: "x"; type: "double" }
891 Parameter { name: "y"; type: "double" }
891 Parameter { name: "y"; type: "double" }
892 }
892 }
893 Method {
893 Method {
894 name: "remove"
894 name: "remove"
895 revision: 3
895 revision: 3
896 Parameter { name: "index"; type: "int" }
896 Parameter { name: "index"; type: "int" }
897 }
897 }
898 Method {
898 Method {
899 name: "insert"
899 name: "insert"
900 Parameter { name: "index"; type: "int" }
900 Parameter { name: "index"; type: "int" }
901 Parameter { name: "x"; type: "double" }
901 Parameter { name: "x"; type: "double" }
902 Parameter { name: "y"; type: "double" }
902 Parameter { name: "y"; type: "double" }
903 }
903 }
904 Method { name: "clear" }
904 Method { name: "clear" }
905 Method {
905 Method {
906 name: "at"
906 name: "at"
907 type: "QPointF"
907 type: "QPointF"
908 Parameter { name: "index"; type: "int" }
908 Parameter { name: "index"; type: "int" }
909 }
909 }
910 }
910 }
911 Component {
911 Component {
912 name: "QtCommercialChart::DeclarativeMargins"
912 name: "QtCommercialChart::DeclarativeMargins"
913 prototype: "QObject"
913 prototype: "QObject"
914 exports: ["QtCommercial.Chart/Margins 1.1"]
914 exports: ["QtCommercial.Chart/Margins 1.1"]
915 isCreatable: false
915 isCreatable: false
916 exportMetaObjectRevisions: [0]
916 exportMetaObjectRevisions: [0]
917 Property { name: "top"; type: "int" }
917 Property { name: "top"; type: "int" }
918 Property { name: "bottom"; type: "int" }
918 Property { name: "bottom"; type: "int" }
919 Property { name: "left"; type: "int" }
919 Property { name: "left"; type: "int" }
920 Property { name: "right"; type: "int" }
920 Property { name: "right"; type: "int" }
921 Signal {
921 Signal {
922 name: "topChanged"
922 name: "topChanged"
923 Parameter { name: "top"; type: "int" }
923 Parameter { name: "top"; type: "int" }
924 Parameter { name: "bottom"; type: "int" }
924 Parameter { name: "bottom"; type: "int" }
925 Parameter { name: "left"; type: "int" }
925 Parameter { name: "left"; type: "int" }
926 Parameter { name: "right"; type: "int" }
926 Parameter { name: "right"; type: "int" }
927 }
927 }
928 Signal {
928 Signal {
929 name: "bottomChanged"
929 name: "bottomChanged"
930 Parameter { name: "top"; type: "int" }
930 Parameter { name: "top"; type: "int" }
931 Parameter { name: "bottom"; type: "int" }
931 Parameter { name: "bottom"; type: "int" }
932 Parameter { name: "left"; type: "int" }
932 Parameter { name: "left"; type: "int" }
933 Parameter { name: "right"; type: "int" }
933 Parameter { name: "right"; type: "int" }
934 }
934 }
935 Signal {
935 Signal {
936 name: "leftChanged"
936 name: "leftChanged"
937 Parameter { name: "top"; type: "int" }
937 Parameter { name: "top"; type: "int" }
938 Parameter { name: "bottom"; type: "int" }
938 Parameter { name: "bottom"; type: "int" }
939 Parameter { name: "left"; type: "int" }
939 Parameter { name: "left"; type: "int" }
940 Parameter { name: "right"; type: "int" }
940 Parameter { name: "right"; type: "int" }
941 }
941 }
942 Signal {
942 Signal {
943 name: "rightChanged"
943 name: "rightChanged"
944 Parameter { name: "top"; type: "int" }
944 Parameter { name: "top"; type: "int" }
945 Parameter { name: "bottom"; type: "int" }
945 Parameter { name: "bottom"; type: "int" }
946 Parameter { name: "left"; type: "int" }
946 Parameter { name: "left"; type: "int" }
947 Parameter { name: "right"; type: "int" }
947 Parameter { name: "right"; type: "int" }
948 }
948 }
949 }
949 }
950 Component {
950 Component {
951 name: "QtCommercialChart::DeclarativePercentBarSeries"
951 name: "QtCommercialChart::DeclarativePercentBarSeries"
952 defaultProperty: "seriesChildren"
952 defaultProperty: "seriesChildren"
953 prototype: "QtCommercialChart::QPercentBarSeries"
953 prototype: "QtCommercialChart::QPercentBarSeries"
954 exports: [
954 exports: [
955 "QtCommercial.Chart/PercentBarSeries 1.0",
955 "QtCommercial.Chart/PercentBarSeries 1.0",
956 "QtCommercial.Chart/PercentBarSeries 1.1",
956 "QtCommercial.Chart/PercentBarSeries 1.1",
957 "QtCommercial.Chart/PercentBarSeries 1.2"
957 "QtCommercial.Chart/PercentBarSeries 1.2"
958 ]
958 ]
959 exportMetaObjectRevisions: [0, 1, 2]
959 exportMetaObjectRevisions: [0, 1, 2]
960 Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true }
960 Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true }
961 Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true }
961 Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true }
962 Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true }
962 Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true }
963 Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true }
963 Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true }
964 Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true }
964 Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true }
965 Signal {
965 Signal {
966 name: "axisXChanged"
966 name: "axisXChanged"
967 revision: 1
967 revision: 1
968 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
968 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
969 }
969 }
970 Signal {
970 Signal {
971 name: "axisYChanged"
971 name: "axisYChanged"
972 revision: 1
972 revision: 1
973 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
973 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
974 }
974 }
975 Signal {
975 Signal {
976 name: "axisXTopChanged"
976 name: "axisXTopChanged"
977 revision: 2
977 revision: 2
978 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
978 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
979 }
979 }
980 Signal {
980 Signal {
981 name: "axisYRightChanged"
981 name: "axisYRightChanged"
982 revision: 2
982 revision: 2
983 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
983 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
984 }
984 }
985 Method {
985 Method {
986 name: "appendSeriesChildren"
986 name: "appendSeriesChildren"
987 Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true }
987 Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true }
988 Parameter { name: "element"; type: "QObject"; isPointer: true }
988 Parameter { name: "element"; type: "QObject"; isPointer: true }
989 }
989 }
990 Method {
990 Method {
991 name: "at"
991 name: "at"
992 type: "DeclarativeBarSet*"
992 type: "DeclarativeBarSet*"
993 Parameter { name: "index"; type: "int" }
993 Parameter { name: "index"; type: "int" }
994 }
994 }
995 Method {
995 Method {
996 name: "append"
996 name: "append"
997 type: "DeclarativeBarSet*"
997 type: "DeclarativeBarSet*"
998 Parameter { name: "label"; type: "string" }
998 Parameter { name: "label"; type: "string" }
999 Parameter { name: "values"; type: "QVariantList" }
999 Parameter { name: "values"; type: "QVariantList" }
1000 }
1000 }
1001 Method {
1001 Method {
1002 name: "insert"
1002 name: "insert"
1003 type: "DeclarativeBarSet*"
1003 type: "DeclarativeBarSet*"
1004 Parameter { name: "index"; type: "int" }
1004 Parameter { name: "index"; type: "int" }
1005 Parameter { name: "label"; type: "string" }
1005 Parameter { name: "label"; type: "string" }
1006 Parameter { name: "values"; type: "QVariantList" }
1006 Parameter { name: "values"; type: "QVariantList" }
1007 }
1007 }
1008 Method {
1008 Method {
1009 name: "remove"
1009 name: "remove"
1010 type: "bool"
1010 type: "bool"
1011 Parameter { name: "barset"; type: "QBarSet"; isPointer: true }
1011 Parameter { name: "barset"; type: "QBarSet"; isPointer: true }
1012 }
1012 }
1013 Method { name: "clear" }
1013 Method { name: "clear" }
1014 }
1014 }
1015 Component {
1015 Component {
1016 name: "QtCommercialChart::DeclarativePieSeries"
1016 name: "QtCommercialChart::DeclarativePieSeries"
1017 defaultProperty: "seriesChildren"
1017 defaultProperty: "seriesChildren"
1018 prototype: "QtCommercialChart::QPieSeries"
1018 prototype: "QtCommercialChart::QPieSeries"
1019 exports: [
1019 exports: [
1020 "QtCommercial.Chart/PieSeries 1.0",
1020 "QtCommercial.Chart/PieSeries 1.0",
1021 "QtCommercial.Chart/PieSeries 1.1"
1021 "QtCommercial.Chart/PieSeries 1.1"
1022 ]
1022 ]
1023 exportMetaObjectRevisions: [0, 0]
1023 exportMetaObjectRevisions: [0, 0]
1024 Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true }
1024 Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true }
1025 Signal {
1025 Signal {
1026 name: "sliceAdded"
1026 name: "sliceAdded"
1027 Parameter { name: "slice"; type: "QPieSlice"; isPointer: true }
1027 Parameter { name: "slice"; type: "QPieSlice"; isPointer: true }
1028 }
1028 }
1029 Signal {
1029 Signal {
1030 name: "sliceRemoved"
1030 name: "sliceRemoved"
1031 Parameter { name: "slice"; type: "QPieSlice"; isPointer: true }
1031 Parameter { name: "slice"; type: "QPieSlice"; isPointer: true }
1032 }
1032 }
1033 Method {
1033 Method {
1034 name: "appendSeriesChildren"
1034 name: "appendSeriesChildren"
1035 Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true }
1035 Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true }
1036 Parameter { name: "element"; type: "QObject"; isPointer: true }
1036 Parameter { name: "element"; type: "QObject"; isPointer: true }
1037 }
1037 }
1038 Method {
1038 Method {
1039 name: "handleAdded"
1039 name: "handleAdded"
1040 Parameter { name: "slices"; type: "QList<QPieSlice*>" }
1040 Parameter { name: "slices"; type: "QList<QPieSlice*>" }
1041 }
1041 }
1042 Method {
1042 Method {
1043 name: "handleRemoved"
1043 name: "handleRemoved"
1044 Parameter { name: "slices"; type: "QList<QPieSlice*>" }
1044 Parameter { name: "slices"; type: "QList<QPieSlice*>" }
1045 }
1045 }
1046 Method {
1046 Method {
1047 name: "at"
1047 name: "at"
1048 type: "QPieSlice*"
1048 type: "QPieSlice*"
1049 Parameter { name: "index"; type: "int" }
1049 Parameter { name: "index"; type: "int" }
1050 }
1050 }
1051 Method {
1051 Method {
1052 name: "find"
1052 name: "find"
1053 type: "QPieSlice*"
1053 type: "QPieSlice*"
1054 Parameter { name: "label"; type: "string" }
1054 Parameter { name: "label"; type: "string" }
1055 }
1055 }
1056 Method {
1056 Method {
1057 name: "append"
1057 name: "append"
1058 type: "QPieSlice*"
1058 type: "QPieSlice*"
1059 Parameter { name: "label"; type: "string" }
1059 Parameter { name: "label"; type: "string" }
1060 Parameter { name: "value"; type: "double" }
1060 Parameter { name: "value"; type: "double" }
1061 }
1061 }
1062 Method {
1062 Method {
1063 name: "remove"
1063 name: "remove"
1064 type: "bool"
1064 type: "bool"
1065 Parameter { name: "slice"; type: "QPieSlice"; isPointer: true }
1065 Parameter { name: "slice"; type: "QPieSlice"; isPointer: true }
1066 }
1066 }
1067 Method { name: "clear" }
1067 Method { name: "clear" }
1068 }
1068 }
1069 Component {
1069 Component {
1070 name: "QtCommercialChart::DeclarativePolarChart"
1070 name: "QtCommercialChart::DeclarativePolarChart"
1071 defaultProperty: "data"
1071 defaultProperty: "data"
1072 prototype: "QtCommercialChart::DeclarativeChart"
1072 prototype: "QtCommercialChart::DeclarativeChart"
1073 exports: ["QtCommercial.Chart/PolarChartView 1.3"]
1073 exports: ["QtCommercial.Chart/PolarChartView 1.3"]
1074 exportMetaObjectRevisions: [1]
1074 exportMetaObjectRevisions: [1]
1075 }
1075 }
1076 Component {
1076 Component {
1077 name: "QtCommercialChart::DeclarativeScatterSeries"
1077 name: "QtCommercialChart::DeclarativeScatterSeries"
1078 defaultProperty: "declarativeChildren"
1078 defaultProperty: "declarativeChildren"
1079 prototype: "QtCommercialChart::QScatterSeries"
1079 prototype: "QtCommercialChart::QScatterSeries"
1080 exports: [
1080 exports: [
1081 "QtCommercial.Chart/ScatterSeries 1.0",
1081 "QtCommercial.Chart/ScatterSeries 1.0",
1082 "QtCommercial.Chart/ScatterSeries 1.1",
1082 "QtCommercial.Chart/ScatterSeries 1.1",
1083 "QtCommercial.Chart/ScatterSeries 1.2",
1083 "QtCommercial.Chart/ScatterSeries 1.2",
1084 "QtCommercial.Chart/ScatterSeries 1.3"
1084 "QtCommercial.Chart/ScatterSeries 1.3"
1085 ]
1085 ]
1086 exportMetaObjectRevisions: [0, 1, 2, 3]
1086 exportMetaObjectRevisions: [0, 1, 2, 3]
1087 Property { name: "count"; type: "int"; isReadonly: true }
1087 Property { name: "count"; type: "int"; isReadonly: true }
1088 Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true }
1088 Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true }
1089 Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true }
1089 Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true }
1090 Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true }
1090 Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true }
1091 Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true }
1091 Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true }
1092 Property { name: "axisAngular"; revision: 3; type: "QAbstractAxis"; isPointer: true }
1092 Property { name: "axisAngular"; revision: 3; type: "QAbstractAxis"; isPointer: true }
1093 Property { name: "axisRadial"; revision: 3; type: "QAbstractAxis"; isPointer: true }
1093 Property { name: "axisRadial"; revision: 3; type: "QAbstractAxis"; isPointer: true }
1094 Property { name: "borderWidth"; revision: 1; type: "double" }
1094 Property { name: "borderWidth"; revision: 1; type: "double" }
1095 Property { name: "declarativeChildren"; type: "QObject"; isList: true; isReadonly: true }
1095 Property { name: "declarativeChildren"; type: "QObject"; isList: true; isReadonly: true }
1096 Signal {
1096 Signal {
1097 name: "countChanged"
1097 name: "countChanged"
1098 Parameter { name: "count"; type: "int" }
1098 Parameter { name: "count"; type: "int" }
1099 }
1099 }
1100 Signal {
1100 Signal {
1101 name: "axisXChanged"
1101 name: "axisXChanged"
1102 revision: 1
1102 revision: 1
1103 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1103 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1104 }
1104 }
1105 Signal {
1105 Signal {
1106 name: "axisYChanged"
1106 name: "axisYChanged"
1107 revision: 1
1107 revision: 1
1108 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1108 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1109 }
1109 }
1110 Signal {
1110 Signal {
1111 name: "borderWidthChanged"
1111 name: "borderWidthChanged"
1112 revision: 1
1112 revision: 1
1113 Parameter { name: "width"; type: "double" }
1113 Parameter { name: "width"; type: "double" }
1114 }
1114 }
1115 Signal {
1115 Signal {
1116 name: "axisXTopChanged"
1116 name: "axisXTopChanged"
1117 revision: 2
1117 revision: 2
1118 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1118 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1119 }
1119 }
1120 Signal {
1120 Signal {
1121 name: "axisYRightChanged"
1121 name: "axisYRightChanged"
1122 revision: 2
1122 revision: 2
1123 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1123 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1124 }
1124 }
1125 Signal {
1125 Signal {
1126 name: "axisAngularChanged"
1126 name: "axisAngularChanged"
1127 revision: 3
1127 revision: 3
1128 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1128 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1129 }
1129 }
1130 Signal {
1130 Signal {
1131 name: "axisRadialChanged"
1131 name: "axisRadialChanged"
1132 revision: 3
1132 revision: 3
1133 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1133 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1134 }
1134 }
1135 Method {
1135 Method {
1136 name: "appendDeclarativeChildren"
1136 name: "appendDeclarativeChildren"
1137 Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true }
1137 Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true }
1138 Parameter { name: "element"; type: "QObject"; isPointer: true }
1138 Parameter { name: "element"; type: "QObject"; isPointer: true }
1139 }
1139 }
1140 Method {
1140 Method {
1141 name: "handleCountChanged"
1141 name: "handleCountChanged"
1142 Parameter { name: "index"; type: "int" }
1142 Parameter { name: "index"; type: "int" }
1143 }
1143 }
1144 Method {
1144 Method {
1145 name: "append"
1145 name: "append"
1146 Parameter { name: "x"; type: "double" }
1146 Parameter { name: "x"; type: "double" }
1147 Parameter { name: "y"; type: "double" }
1147 Parameter { name: "y"; type: "double" }
1148 }
1148 }
1149 Method {
1149 Method {
1150 name: "replace"
1150 name: "replace"
1151 Parameter { name: "oldX"; type: "double" }
1151 Parameter { name: "oldX"; type: "double" }
1152 Parameter { name: "oldY"; type: "double" }
1152 Parameter { name: "oldY"; type: "double" }
1153 Parameter { name: "newX"; type: "double" }
1153 Parameter { name: "newX"; type: "double" }
1154 Parameter { name: "newY"; type: "double" }
1154 Parameter { name: "newY"; type: "double" }
1155 }
1155 }
1156 Method {
1156 Method {
1157 name: "replace"
1157 name: "replace"
1158 revision: 3
1158 revision: 3
1159 Parameter { name: "index"; type: "int" }
1159 Parameter { name: "index"; type: "int" }
1160 Parameter { name: "newX"; type: "double" }
1160 Parameter { name: "newX"; type: "double" }
1161 Parameter { name: "newY"; type: "double" }
1161 Parameter { name: "newY"; type: "double" }
1162 }
1162 }
1163 Method {
1163 Method {
1164 name: "remove"
1164 name: "remove"
1165 Parameter { name: "x"; type: "double" }
1165 Parameter { name: "x"; type: "double" }
1166 Parameter { name: "y"; type: "double" }
1166 Parameter { name: "y"; type: "double" }
1167 }
1167 }
1168 Method {
1168 Method {
1169 name: "remove"
1169 name: "remove"
1170 revision: 3
1170 revision: 3
1171 Parameter { name: "index"; type: "int" }
1171 Parameter { name: "index"; type: "int" }
1172 }
1172 }
1173 Method {
1173 Method {
1174 name: "insert"
1174 name: "insert"
1175 Parameter { name: "index"; type: "int" }
1175 Parameter { name: "index"; type: "int" }
1176 Parameter { name: "x"; type: "double" }
1176 Parameter { name: "x"; type: "double" }
1177 Parameter { name: "y"; type: "double" }
1177 Parameter { name: "y"; type: "double" }
1178 }
1178 }
1179 Method { name: "clear" }
1179 Method { name: "clear" }
1180 Method {
1180 Method {
1181 name: "at"
1181 name: "at"
1182 type: "QPointF"
1182 type: "QPointF"
1183 Parameter { name: "index"; type: "int" }
1183 Parameter { name: "index"; type: "int" }
1184 }
1184 }
1185 }
1185 }
1186 Component {
1186 Component {
1187 name: "QtCommercialChart::DeclarativeSplineSeries"
1187 name: "QtCommercialChart::DeclarativeSplineSeries"
1188 defaultProperty: "declarativeChildren"
1188 defaultProperty: "declarativeChildren"
1189 prototype: "QtCommercialChart::QSplineSeries"
1189 prototype: "QtCommercialChart::QSplineSeries"
1190 exports: [
1190 exports: [
1191 "QtCommercial.Chart/SplineSeries 1.0",
1191 "QtCommercial.Chart/SplineSeries 1.0",
1192 "QtCommercial.Chart/SplineSeries 1.1",
1192 "QtCommercial.Chart/SplineSeries 1.1",
1193 "QtCommercial.Chart/SplineSeries 1.2",
1193 "QtCommercial.Chart/SplineSeries 1.2",
1194 "QtCommercial.Chart/SplineSeries 1.3"
1194 "QtCommercial.Chart/SplineSeries 1.3"
1195 ]
1195 ]
1196 exportMetaObjectRevisions: [0, 1, 2, 3]
1196 exportMetaObjectRevisions: [0, 1, 2, 3]
1197 Property { name: "count"; type: "int"; isReadonly: true }
1197 Property { name: "count"; type: "int"; isReadonly: true }
1198 Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true }
1198 Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true }
1199 Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true }
1199 Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true }
1200 Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true }
1200 Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true }
1201 Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true }
1201 Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true }
1202 Property { name: "axisAngular"; revision: 3; type: "QAbstractAxis"; isPointer: true }
1202 Property { name: "axisAngular"; revision: 3; type: "QAbstractAxis"; isPointer: true }
1203 Property { name: "axisRadial"; revision: 3; type: "QAbstractAxis"; isPointer: true }
1203 Property { name: "axisRadial"; revision: 3; type: "QAbstractAxis"; isPointer: true }
1204 Property { name: "width"; revision: 1; type: "double" }
1204 Property { name: "width"; revision: 1; type: "double" }
1205 Property { name: "style"; revision: 1; type: "Qt::PenStyle" }
1205 Property { name: "style"; revision: 1; type: "Qt::PenStyle" }
1206 Property { name: "capStyle"; revision: 1; type: "Qt::PenCapStyle" }
1206 Property { name: "capStyle"; revision: 1; type: "Qt::PenCapStyle" }
1207 Property { name: "declarativeChildren"; type: "QObject"; isList: true; isReadonly: true }
1207 Property { name: "declarativeChildren"; type: "QObject"; isList: true; isReadonly: true }
1208 Signal {
1208 Signal {
1209 name: "countChanged"
1209 name: "countChanged"
1210 Parameter { name: "count"; type: "int" }
1210 Parameter { name: "count"; type: "int" }
1211 }
1211 }
1212 Signal {
1212 Signal {
1213 name: "axisXChanged"
1213 name: "axisXChanged"
1214 revision: 1
1214 revision: 1
1215 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1215 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1216 }
1216 }
1217 Signal {
1217 Signal {
1218 name: "axisYChanged"
1218 name: "axisYChanged"
1219 revision: 1
1219 revision: 1
1220 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1220 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1221 }
1221 }
1222 Signal {
1222 Signal {
1223 name: "axisXTopChanged"
1223 name: "axisXTopChanged"
1224 revision: 2
1224 revision: 2
1225 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1225 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1226 }
1226 }
1227 Signal {
1227 Signal {
1228 name: "axisYRightChanged"
1228 name: "axisYRightChanged"
1229 revision: 2
1229 revision: 2
1230 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1230 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1231 }
1231 }
1232 Signal {
1232 Signal {
1233 name: "axisAngularChanged"
1233 name: "axisAngularChanged"
1234 revision: 3
1234 revision: 3
1235 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1235 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1236 }
1236 }
1237 Signal {
1237 Signal {
1238 name: "axisRadialChanged"
1238 name: "axisRadialChanged"
1239 revision: 3
1239 revision: 3
1240 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1240 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1241 }
1241 }
1242 Signal {
1242 Signal {
1243 name: "widthChanged"
1243 name: "widthChanged"
1244 revision: 1
1244 revision: 1
1245 Parameter { name: "width"; type: "double" }
1245 Parameter { name: "width"; type: "double" }
1246 }
1246 }
1247 Signal {
1247 Signal {
1248 name: "styleChanged"
1248 name: "styleChanged"
1249 revision: 1
1249 revision: 1
1250 Parameter { name: "style"; type: "Qt::PenStyle" }
1250 Parameter { name: "style"; type: "Qt::PenStyle" }
1251 }
1251 }
1252 Signal {
1252 Signal {
1253 name: "capStyleChanged"
1253 name: "capStyleChanged"
1254 revision: 1
1254 revision: 1
1255 Parameter { name: "capStyle"; type: "Qt::PenCapStyle" }
1255 Parameter { name: "capStyle"; type: "Qt::PenCapStyle" }
1256 }
1256 }
1257 Method {
1257 Method {
1258 name: "appendDeclarativeChildren"
1258 name: "appendDeclarativeChildren"
1259 Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true }
1259 Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true }
1260 Parameter { name: "element"; type: "QObject"; isPointer: true }
1260 Parameter { name: "element"; type: "QObject"; isPointer: true }
1261 }
1261 }
1262 Method {
1262 Method {
1263 name: "handleCountChanged"
1263 name: "handleCountChanged"
1264 Parameter { name: "index"; type: "int" }
1264 Parameter { name: "index"; type: "int" }
1265 }
1265 }
1266 Method {
1266 Method {
1267 name: "append"
1267 name: "append"
1268 Parameter { name: "x"; type: "double" }
1268 Parameter { name: "x"; type: "double" }
1269 Parameter { name: "y"; type: "double" }
1269 Parameter { name: "y"; type: "double" }
1270 }
1270 }
1271 Method {
1271 Method {
1272 name: "replace"
1272 name: "replace"
1273 Parameter { name: "oldX"; type: "double" }
1273 Parameter { name: "oldX"; type: "double" }
1274 Parameter { name: "oldY"; type: "double" }
1274 Parameter { name: "oldY"; type: "double" }
1275 Parameter { name: "newX"; type: "double" }
1275 Parameter { name: "newX"; type: "double" }
1276 Parameter { name: "newY"; type: "double" }
1276 Parameter { name: "newY"; type: "double" }
1277 }
1277 }
1278 Method {
1278 Method {
1279 name: "replace"
1279 name: "replace"
1280 revision: 3
1280 revision: 3
1281 Parameter { name: "index"; type: "int" }
1281 Parameter { name: "index"; type: "int" }
1282 Parameter { name: "newX"; type: "double" }
1282 Parameter { name: "newX"; type: "double" }
1283 Parameter { name: "newY"; type: "double" }
1283 Parameter { name: "newY"; type: "double" }
1284 }
1284 }
1285 Method {
1285 Method {
1286 name: "remove"
1286 name: "remove"
1287 Parameter { name: "x"; type: "double" }
1287 Parameter { name: "x"; type: "double" }
1288 Parameter { name: "y"; type: "double" }
1288 Parameter { name: "y"; type: "double" }
1289 }
1289 }
1290 Method {
1290 Method {
1291 name: "remove"
1291 name: "remove"
1292 revision: 3
1292 revision: 3
1293 Parameter { name: "index"; type: "int" }
1293 Parameter { name: "index"; type: "int" }
1294 }
1294 }
1295 Method {
1295 Method {
1296 name: "insert"
1296 name: "insert"
1297 Parameter { name: "index"; type: "int" }
1297 Parameter { name: "index"; type: "int" }
1298 Parameter { name: "x"; type: "double" }
1298 Parameter { name: "x"; type: "double" }
1299 Parameter { name: "y"; type: "double" }
1299 Parameter { name: "y"; type: "double" }
1300 }
1300 }
1301 Method { name: "clear" }
1301 Method { name: "clear" }
1302 Method {
1302 Method {
1303 name: "at"
1303 name: "at"
1304 type: "QPointF"
1304 type: "QPointF"
1305 Parameter { name: "index"; type: "int" }
1305 Parameter { name: "index"; type: "int" }
1306 }
1306 }
1307 }
1307 }
1308 Component {
1308 Component {
1309 name: "QtCommercialChart::DeclarativeStackedBarSeries"
1309 name: "QtCommercialChart::DeclarativeStackedBarSeries"
1310 defaultProperty: "seriesChildren"
1310 defaultProperty: "seriesChildren"
1311 prototype: "QtCommercialChart::QStackedBarSeries"
1311 prototype: "QtCommercialChart::QStackedBarSeries"
1312 exports: [
1312 exports: [
1313 "QtCommercial.Chart/StackedBarSeries 1.0",
1313 "QtCommercial.Chart/StackedBarSeries 1.0",
1314 "QtCommercial.Chart/StackedBarSeries 1.1",
1314 "QtCommercial.Chart/StackedBarSeries 1.1",
1315 "QtCommercial.Chart/StackedBarSeries 1.2"
1315 "QtCommercial.Chart/StackedBarSeries 1.2"
1316 ]
1316 ]
1317 exportMetaObjectRevisions: [0, 1, 2]
1317 exportMetaObjectRevisions: [0, 1, 2]
1318 Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true }
1318 Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true }
1319 Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true }
1319 Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true }
1320 Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true }
1320 Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true }
1321 Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true }
1321 Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true }
1322 Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true }
1322 Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true }
1323 Signal {
1323 Signal {
1324 name: "axisXChanged"
1324 name: "axisXChanged"
1325 revision: 1
1325 revision: 1
1326 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1326 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1327 }
1327 }
1328 Signal {
1328 Signal {
1329 name: "axisYChanged"
1329 name: "axisYChanged"
1330 revision: 1
1330 revision: 1
1331 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1331 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1332 }
1332 }
1333 Signal {
1333 Signal {
1334 name: "axisXTopChanged"
1334 name: "axisXTopChanged"
1335 revision: 2
1335 revision: 2
1336 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1336 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1337 }
1337 }
1338 Signal {
1338 Signal {
1339 name: "axisYRightChanged"
1339 name: "axisYRightChanged"
1340 revision: 2
1340 revision: 2
1341 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1341 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1342 }
1342 }
1343 Method {
1343 Method {
1344 name: "appendSeriesChildren"
1344 name: "appendSeriesChildren"
1345 Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true }
1345 Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true }
1346 Parameter { name: "element"; type: "QObject"; isPointer: true }
1346 Parameter { name: "element"; type: "QObject"; isPointer: true }
1347 }
1347 }
1348 Method {
1348 Method {
1349 name: "at"
1349 name: "at"
1350 type: "DeclarativeBarSet*"
1350 type: "DeclarativeBarSet*"
1351 Parameter { name: "index"; type: "int" }
1351 Parameter { name: "index"; type: "int" }
1352 }
1352 }
1353 Method {
1353 Method {
1354 name: "append"
1354 name: "append"
1355 type: "DeclarativeBarSet*"
1355 type: "DeclarativeBarSet*"
1356 Parameter { name: "label"; type: "string" }
1356 Parameter { name: "label"; type: "string" }
1357 Parameter { name: "values"; type: "QVariantList" }
1357 Parameter { name: "values"; type: "QVariantList" }
1358 }
1358 }
1359 Method {
1359 Method {
1360 name: "insert"
1360 name: "insert"
1361 type: "DeclarativeBarSet*"
1361 type: "DeclarativeBarSet*"
1362 Parameter { name: "index"; type: "int" }
1362 Parameter { name: "index"; type: "int" }
1363 Parameter { name: "label"; type: "string" }
1363 Parameter { name: "label"; type: "string" }
1364 Parameter { name: "values"; type: "QVariantList" }
1364 Parameter { name: "values"; type: "QVariantList" }
1365 }
1365 }
1366 Method {
1366 Method {
1367 name: "remove"
1367 name: "remove"
1368 type: "bool"
1368 type: "bool"
1369 Parameter { name: "barset"; type: "QBarSet"; isPointer: true }
1369 Parameter { name: "barset"; type: "QBarSet"; isPointer: true }
1370 }
1370 }
1371 Method { name: "clear" }
1371 Method { name: "clear" }
1372 }
1372 }
1373 Component {
1373 Component {
1374 name: "QtCommercialChart::DeclarativeXYPoint"
1374 name: "QtCommercialChart::DeclarativeXYPoint"
1375 prototype: "QObject"
1375 prototype: "QObject"
1376 exports: ["QtCommercial.Chart/XYPoint 1.0"]
1376 exports: ["QtCommercial.Chart/XYPoint 1.0"]
1377 exportMetaObjectRevisions: [0]
1377 exportMetaObjectRevisions: [0]
1378 Property { name: "x"; type: "double" }
1378 Property { name: "x"; type: "double" }
1379 Property { name: "y"; type: "double" }
1379 Property { name: "y"; type: "double" }
1380 }
1380 }
1381 Component {
1381 Component {
1382 name: "QtCommercialChart::LegendScroller"
1382 name: "QtCommercialChart::LegendScroller"
1383 defaultProperty: "children"
1383 defaultProperty: "children"
1384 prototype: "QtCommercialChart::QLegend"
1384 prototype: "QtCommercialChart::QLegend"
1385 }
1385 }
1386 Component {
1386 Component {
1387 name: "QtCommercialChart::QAbstractAxis"
1387 name: "QtCommercialChart::QAbstractAxis"
1388 prototype: "QObject"
1388 prototype: "QObject"
1389 exports: ["QtCommercial.Chart/AbstractAxis 1.0"]
1389 exports: ["QtCommercial.Chart/AbstractAxis 1.0"]
1390 isCreatable: false
1390 isCreatable: false
1391 exportMetaObjectRevisions: [0]
1391 exportMetaObjectRevisions: [0]
1392 Property { name: "visible"; type: "bool" }
1392 Property { name: "visible"; type: "bool" }
1393 Property { name: "lineVisible"; type: "bool" }
1393 Property { name: "lineVisible"; type: "bool" }
1394 Property { name: "linePen"; type: "QPen" }
1394 Property { name: "linePen"; type: "QPen" }
1395 Property { name: "color"; type: "QColor" }
1395 Property { name: "color"; type: "QColor" }
1396 Property { name: "labelsVisible"; type: "bool" }
1396 Property { name: "labelsVisible"; type: "bool" }
1397 Property { name: "labelsPen"; type: "QPen" }
1397 Property { name: "labelsPen"; type: "QPen" }
1398 Property { name: "labelsBrush"; type: "QBrush" }
1398 Property { name: "labelsBrush"; type: "QBrush" }
1399 Property { name: "labelsAngle"; type: "int" }
1399 Property { name: "labelsAngle"; type: "int" }
1400 Property { name: "labelsFont"; type: "QFont" }
1400 Property { name: "labelsFont"; type: "QFont" }
1401 Property { name: "labelsColor"; type: "QColor" }
1401 Property { name: "labelsColor"; type: "QColor" }
1402 Property { name: "gridVisible"; type: "bool" }
1402 Property { name: "gridVisible"; type: "bool" }
1403 Property { name: "gridLinePen"; type: "QPen" }
1403 Property { name: "gridLinePen"; type: "QPen" }
1404 Property { name: "shadesVisible"; type: "bool" }
1404 Property { name: "shadesVisible"; type: "bool" }
1405 Property { name: "shadesColor"; type: "QColor" }
1405 Property { name: "shadesColor"; type: "QColor" }
1406 Property { name: "shadesBorderColor"; type: "QColor" }
1406 Property { name: "shadesBorderColor"; type: "QColor" }
1407 Property { name: "shadesPen"; type: "QPen" }
1407 Property { name: "shadesPen"; type: "QPen" }
1408 Property { name: "shadesBrush"; type: "QBrush" }
1408 Property { name: "shadesBrush"; type: "QBrush" }
1409 Property { name: "titleText"; type: "string" }
1409 Property { name: "titleText"; type: "string" }
1410 Property { name: "titlePen"; type: "QPen" }
1410 Property { name: "titlePen"; type: "QPen" }
1411 Property { name: "titleBrush"; type: "QBrush" }
1411 Property { name: "titleBrush"; type: "QBrush" }
1412 Property { name: "titleVisible"; type: "bool" }
1412 Property { name: "titleVisible"; type: "bool" }
1413 Property { name: "titleFont"; type: "QFont" }
1413 Property { name: "titleFont"; type: "QFont" }
1414 Property { name: "orientation"; type: "Qt::Orientation"; isReadonly: true }
1414 Property { name: "orientation"; type: "Qt::Orientation"; isReadonly: true }
1415 Property { name: "alignment"; type: "Qt::Alignment"; isReadonly: true }
1415 Property { name: "alignment"; type: "Qt::Alignment"; isReadonly: true }
1416 Signal {
1416 Signal {
1417 name: "visibleChanged"
1417 name: "visibleChanged"
1418 Parameter { name: "visible"; type: "bool" }
1418 Parameter { name: "visible"; type: "bool" }
1419 }
1419 }
1420 Signal {
1420 Signal {
1421 name: "linePenChanged"
1421 name: "linePenChanged"
1422 Parameter { name: "pen"; type: "QPen" }
1422 Parameter { name: "pen"; type: "QPen" }
1423 }
1423 }
1424 Signal {
1424 Signal {
1425 name: "lineVisibleChanged"
1425 name: "lineVisibleChanged"
1426 Parameter { name: "visible"; type: "bool" }
1426 Parameter { name: "visible"; type: "bool" }
1427 }
1427 }
1428 Signal {
1428 Signal {
1429 name: "labelsVisibleChanged"
1429 name: "labelsVisibleChanged"
1430 Parameter { name: "visible"; type: "bool" }
1430 Parameter { name: "visible"; type: "bool" }
1431 }
1431 }
1432 Signal {
1432 Signal {
1433 name: "labelsPenChanged"
1433 name: "labelsPenChanged"
1434 Parameter { name: "pen"; type: "QPen" }
1434 Parameter { name: "pen"; type: "QPen" }
1435 }
1435 }
1436 Signal {
1436 Signal {
1437 name: "labelsBrushChanged"
1437 name: "labelsBrushChanged"
1438 Parameter { name: "brush"; type: "QBrush" }
1438 Parameter { name: "brush"; type: "QBrush" }
1439 }
1439 }
1440 Signal {
1440 Signal {
1441 name: "labelsFontChanged"
1441 name: "labelsFontChanged"
1442 Parameter { name: "pen"; type: "QFont" }
1442 Parameter { name: "pen"; type: "QFont" }
1443 }
1443 }
1444 Signal {
1444 Signal {
1445 name: "labelsAngleChanged"
1445 name: "labelsAngleChanged"
1446 Parameter { name: "angle"; type: "int" }
1446 Parameter { name: "angle"; type: "int" }
1447 }
1447 }
1448 Signal {
1448 Signal {
1449 name: "gridLinePenChanged"
1449 name: "gridLinePenChanged"
1450 Parameter { name: "pen"; type: "QPen" }
1450 Parameter { name: "pen"; type: "QPen" }
1451 }
1451 }
1452 Signal {
1452 Signal {
1453 name: "gridVisibleChanged"
1453 name: "gridVisibleChanged"
1454 Parameter { name: "visible"; type: "bool" }
1454 Parameter { name: "visible"; type: "bool" }
1455 }
1455 }
1456 Signal {
1456 Signal {
1457 name: "colorChanged"
1457 name: "colorChanged"
1458 Parameter { name: "color"; type: "QColor" }
1458 Parameter { name: "color"; type: "QColor" }
1459 }
1459 }
1460 Signal {
1460 Signal {
1461 name: "labelsColorChanged"
1461 name: "labelsColorChanged"
1462 Parameter { name: "color"; type: "QColor" }
1462 Parameter { name: "color"; type: "QColor" }
1463 }
1463 }
1464 Signal {
1464 Signal {
1465 name: "titleTextChanged"
1465 name: "titleTextChanged"
1466 Parameter { name: "title"; type: "string" }
1466 Parameter { name: "title"; type: "string" }
1467 }
1467 }
1468 Signal {
1468 Signal {
1469 name: "titlePenChanged"
1469 name: "titlePenChanged"
1470 Parameter { name: "pen"; type: "QPen" }
1470 Parameter { name: "pen"; type: "QPen" }
1471 }
1471 }
1472 Signal {
1472 Signal {
1473 name: "titleBrushChanged"
1473 name: "titleBrushChanged"
1474 Parameter { name: "brush"; type: "QBrush" }
1474 Parameter { name: "brush"; type: "QBrush" }
1475 }
1475 }
1476 Signal {
1476 Signal {
1477 name: "titleVisibleChanged"
1477 name: "titleVisibleChanged"
1478 Parameter { name: "visible"; type: "bool" }
1478 Parameter { name: "visible"; type: "bool" }
1479 }
1479 }
1480 Signal {
1480 Signal {
1481 name: "titleFontChanged"
1481 name: "titleFontChanged"
1482 Parameter { name: "font"; type: "QFont" }
1482 Parameter { name: "font"; type: "QFont" }
1483 }
1483 }
1484 Signal {
1484 Signal {
1485 name: "shadesVisibleChanged"
1485 name: "shadesVisibleChanged"
1486 Parameter { name: "visible"; type: "bool" }
1486 Parameter { name: "visible"; type: "bool" }
1487 }
1487 }
1488 Signal {
1488 Signal {
1489 name: "shadesColorChanged"
1489 name: "shadesColorChanged"
1490 Parameter { name: "color"; type: "QColor" }
1490 Parameter { name: "color"; type: "QColor" }
1491 }
1491 }
1492 Signal {
1492 Signal {
1493 name: "shadesBorderColorChanged"
1493 name: "shadesBorderColorChanged"
1494 Parameter { name: "color"; type: "QColor" }
1494 Parameter { name: "color"; type: "QColor" }
1495 }
1495 }
1496 Signal {
1496 Signal {
1497 name: "shadesPenChanged"
1497 name: "shadesPenChanged"
1498 Parameter { name: "pen"; type: "QPen" }
1498 Parameter { name: "pen"; type: "QPen" }
1499 }
1499 }
1500 Signal {
1500 Signal {
1501 name: "shadesBrushChanged"
1501 name: "shadesBrushChanged"
1502 Parameter { name: "brush"; type: "QBrush" }
1502 Parameter { name: "brush"; type: "QBrush" }
1503 }
1503 }
1504 }
1504 }
1505 Component {
1505 Component {
1506 name: "QtCommercialChart::QAbstractBarSeries"
1506 name: "QtCommercialChart::QAbstractBarSeries"
1507 prototype: "QtCommercialChart::QAbstractSeries"
1507 prototype: "QtCommercialChart::QAbstractSeries"
1508 exports: ["QtCommercial.Chart/AbstractBarSeries 1.0"]
1508 exports: ["QtCommercial.Chart/AbstractBarSeries 1.0"]
1509 isCreatable: false
1509 isCreatable: false
1510 exportMetaObjectRevisions: [0]
1510 exportMetaObjectRevisions: [0]
1511 Property { name: "barWidth"; type: "double" }
1511 Property { name: "barWidth"; type: "double" }
1512 Property { name: "count"; type: "int"; isReadonly: true }
1512 Property { name: "count"; type: "int"; isReadonly: true }
1513 Property { name: "labelsVisible"; type: "bool" }
1513 Property { name: "labelsVisible"; type: "bool" }
1514 Signal {
1514 Signal {
1515 name: "clicked"
1515 name: "clicked"
1516 Parameter { name: "index"; type: "int" }
1516 Parameter { name: "index"; type: "int" }
1517 Parameter { name: "barset"; type: "QBarSet"; isPointer: true }
1517 Parameter { name: "barset"; type: "QBarSet"; isPointer: true }
1518 }
1518 }
1519 Signal {
1519 Signal {
1520 name: "hovered"
1520 name: "hovered"
1521 Parameter { name: "status"; type: "bool" }
1521 Parameter { name: "status"; type: "bool" }
1522 Parameter { name: "barset"; type: "QBarSet"; isPointer: true }
1522 Parameter { name: "barset"; type: "QBarSet"; isPointer: true }
1523 }
1523 }
1524 Signal {
1524 Signal {
1525 name: "hovered"
1525 name: "hovered"
1526 Parameter { name: "status"; type: "bool" }
1526 Parameter { name: "status"; type: "bool" }
1527 Parameter { name: "index"; type: "int" }
1527 Parameter { name: "index"; type: "int" }
1528 Parameter { name: "barset"; type: "QBarSet"; isPointer: true }
1528 Parameter { name: "barset"; type: "QBarSet"; isPointer: true }
1529 }
1529 }
1530 Signal {
1530 Signal {
1531 name: "barsetsAdded"
1531 name: "barsetsAdded"
1532 Parameter { name: "sets"; type: "QList<QBarSet*>" }
1532 Parameter { name: "sets"; type: "QList<QBarSet*>" }
1533 }
1533 }
1534 Signal {
1534 Signal {
1535 name: "barsetsRemoved"
1535 name: "barsetsRemoved"
1536 Parameter { name: "sets"; type: "QList<QBarSet*>" }
1536 Parameter { name: "sets"; type: "QList<QBarSet*>" }
1537 }
1537 }
1538 }
1538 }
1539 Component {
1539 Component {
1540 name: "QtCommercialChart::QAbstractSeries"
1540 name: "QtCommercialChart::QAbstractSeries"
1541 prototype: "QObject"
1541 prototype: "QObject"
1542 exports: ["QtCommercial.Chart/AbstractSeries 1.0"]
1542 exports: ["QtCommercial.Chart/AbstractSeries 1.0"]
1543 isCreatable: false
1543 isCreatable: false
1544 exportMetaObjectRevisions: [0]
1544 exportMetaObjectRevisions: [0]
1545 Enum {
1545 Enum {
1546 name: "SeriesType"
1546 name: "SeriesType"
1547 values: {
1547 values: {
1548 "SeriesTypeLine": 0,
1548 "SeriesTypeLine": 0,
1549 "SeriesTypeArea": 1,
1549 "SeriesTypeArea": 1,
1550 "SeriesTypeBar": 2,
1550 "SeriesTypeBar": 2,
1551 "SeriesTypeStackedBar": 3,
1551 "SeriesTypeStackedBar": 3,
1552 "SeriesTypePercentBar": 4,
1552 "SeriesTypePercentBar": 4,
1553 "SeriesTypePie": 5,
1553 "SeriesTypePie": 5,
1554 "SeriesTypeScatter": 6,
1554 "SeriesTypeScatter": 6,
1555 "SeriesTypeSpline": 7,
1555 "SeriesTypeSpline": 7,
1556 "SeriesTypeHorizontalBar": 8,
1556 "SeriesTypeHorizontalBar": 8,
1557 "SeriesTypeHorizontalStackedBar": 9,
1557 "SeriesTypeHorizontalStackedBar": 9,
1558 "SeriesTypeHorizontalPercentBar": 10,
1558 "SeriesTypeHorizontalPercentBar": 10,
1559 "SeriesTypeBoxPlot": 11
1559 "SeriesTypeBoxPlot": 11
1560 }
1560 }
1561 }
1561 }
1562 Property { name: "name"; type: "string" }
1562 Property { name: "name"; type: "string" }
1563 Property { name: "visible"; type: "bool" }
1563 Property { name: "visible"; type: "bool" }
1564 Property { name: "opacity"; type: "double" }
1564 Property { name: "opacity"; type: "double" }
1565 Property { name: "type"; type: "SeriesType"; isReadonly: true }
1565 Property { name: "type"; type: "SeriesType"; isReadonly: true }
1566 }
1566 }
1567 Component {
1567 Component {
1568 name: "QtCommercialChart::QAreaSeries"
1568 name: "QtCommercialChart::QAreaSeries"
1569 prototype: "QtCommercialChart::QAbstractSeries"
1569 prototype: "QtCommercialChart::QAbstractSeries"
1570 Property { name: "upperSeries"; type: "QLineSeries"; isReadonly: true; isPointer: true }
1570 Property { name: "upperSeries"; type: "QLineSeries"; isReadonly: true; isPointer: true }
1571 Property { name: "lowerSeries"; type: "QLineSeries"; isReadonly: true; isPointer: true }
1571 Property { name: "lowerSeries"; type: "QLineSeries"; isReadonly: true; isPointer: true }
1572 Property { name: "color"; type: "QColor" }
1572 Property { name: "color"; type: "QColor" }
1573 Property { name: "borderColor"; type: "QColor" }
1573 Property { name: "borderColor"; type: "QColor" }
1574 Signal {
1574 Signal {
1575 name: "clicked"
1575 name: "clicked"
1576 Parameter { name: "point"; type: "QPointF" }
1576 Parameter { name: "point"; type: "QPointF" }
1577 }
1577 }
1578 Signal {
1578 Signal {
1579 name: "hovered"
1579 name: "hovered"
1580 Parameter { name: "point"; type: "QPointF" }
1580 Parameter { name: "point"; type: "QPointF" }
1581 Parameter { name: "state"; type: "bool" }
1581 Parameter { name: "state"; type: "bool" }
1582 }
1582 }
1583 Signal { name: "selected" }
1583 Signal { name: "selected" }
1584 Signal {
1584 Signal {
1585 name: "colorChanged"
1585 name: "colorChanged"
1586 Parameter { name: "color"; type: "QColor" }
1586 Parameter { name: "color"; type: "QColor" }
1587 }
1587 }
1588 Signal {
1588 Signal {
1589 name: "borderColorChanged"
1589 name: "borderColorChanged"
1590 Parameter { name: "color"; type: "QColor" }
1590 Parameter { name: "color"; type: "QColor" }
1591 }
1591 }
1592 }
1592 }
1593 Component {
1593 Component {
1594 name: "QtCommercialChart::QBarCategoryAxis"
1594 name: "QtCommercialChart::QBarCategoryAxis"
1595 prototype: "QtCommercialChart::QAbstractAxis"
1595 prototype: "QtCommercialChart::QAbstractAxis"
1596 exports: [
1596 exports: [
1597 "QtCommercial.Chart/BarCategoriesAxis 1.0",
1597 "QtCommercial.Chart/BarCategoriesAxis 1.0",
1598 "QtCommercial.Chart/BarCategoryAxis 1.1"
1598 "QtCommercial.Chart/BarCategoryAxis 1.1"
1599 ]
1599 ]
1600 exportMetaObjectRevisions: [0, 0]
1600 exportMetaObjectRevisions: [0, 0]
1601 Property { name: "categories"; type: "QStringList" }
1601 Property { name: "categories"; type: "QStringList" }
1602 Property { name: "min"; type: "string" }
1602 Property { name: "min"; type: "string" }
1603 Property { name: "max"; type: "string" }
1603 Property { name: "max"; type: "string" }
1604 Property { name: "count"; type: "int"; isReadonly: true }
1604 Property { name: "count"; type: "int"; isReadonly: true }
1605 Signal {
1605 Signal {
1606 name: "minChanged"
1606 name: "minChanged"
1607 Parameter { name: "min"; type: "string" }
1607 Parameter { name: "min"; type: "string" }
1608 }
1608 }
1609 Signal {
1609 Signal {
1610 name: "maxChanged"
1610 name: "maxChanged"
1611 Parameter { name: "max"; type: "string" }
1611 Parameter { name: "max"; type: "string" }
1612 }
1612 }
1613 Signal {
1613 Signal {
1614 name: "rangeChanged"
1614 name: "rangeChanged"
1615 Parameter { name: "min"; type: "string" }
1615 Parameter { name: "min"; type: "string" }
1616 Parameter { name: "max"; type: "string" }
1616 Parameter { name: "max"; type: "string" }
1617 }
1617 }
1618 }
1618 }
1619 Component {
1619 Component {
1620 name: "QtCommercialChart::QBarModelMapper"
1620 name: "QtCommercialChart::QBarModelMapper"
1621 prototype: "QObject"
1621 prototype: "QObject"
1622 exports: ["QtCommercial.Chart/BarModelMapper 1.0"]
1622 exports: ["QtCommercial.Chart/BarModelMapper 1.0"]
1623 isCreatable: false
1623 isCreatable: false
1624 exportMetaObjectRevisions: [0]
1624 exportMetaObjectRevisions: [0]
1625 }
1625 }
1626 Component {
1626 Component {
1627 name: "QtCommercialChart::QBarSeries"
1627 name: "QtCommercialChart::QBarSeries"
1628 prototype: "QtCommercialChart::QAbstractBarSeries"
1628 prototype: "QtCommercialChart::QAbstractBarSeries"
1629 }
1629 }
1630 Component {
1630 Component {
1631 name: "QtCommercialChart::QBarSet"
1631 name: "QtCommercialChart::QBarSet"
1632 prototype: "QObject"
1632 prototype: "QObject"
1633 exports: ["QtCommercial.Chart/BarSetBase 1.0"]
1633 exports: ["QtCommercial.Chart/BarSetBase 1.0"]
1634 isCreatable: false
1634 isCreatable: false
1635 exportMetaObjectRevisions: [0]
1635 exportMetaObjectRevisions: [0]
1636 Property { name: "label"; type: "string" }
1636 Property { name: "label"; type: "string" }
1637 Property { name: "pen"; type: "QPen" }
1637 Property { name: "pen"; type: "QPen" }
1638 Property { name: "brush"; type: "QBrush" }
1638 Property { name: "brush"; type: "QBrush" }
1639 Property { name: "labelBrush"; type: "QBrush" }
1639 Property { name: "labelBrush"; type: "QBrush" }
1640 Property { name: "labelFont"; type: "QFont" }
1640 Property { name: "labelFont"; type: "QFont" }
1641 Property { name: "color"; type: "QColor" }
1641 Property { name: "color"; type: "QColor" }
1642 Property { name: "borderColor"; type: "QColor" }
1642 Property { name: "borderColor"; type: "QColor" }
1643 Property { name: "labelColor"; type: "QColor" }
1643 Property { name: "labelColor"; type: "QColor" }
1644 Signal {
1644 Signal {
1645 name: "clicked"
1645 name: "clicked"
1646 Parameter { name: "index"; type: "int" }
1646 Parameter { name: "index"; type: "int" }
1647 }
1647 }
1648 Signal {
1648 Signal {
1649 name: "hovered"
1649 name: "hovered"
1650 Parameter { name: "status"; type: "bool" }
1650 Parameter { name: "status"; type: "bool" }
1651 }
1651 }
1652 Signal {
1652 Signal {
1653 name: "hovered"
1653 name: "hovered"
1654 Parameter { name: "status"; type: "bool" }
1654 Parameter { name: "status"; type: "bool" }
1655 Parameter { name: "index"; type: "int" }
1655 Parameter { name: "index"; type: "int" }
1656 }
1656 }
1657 Signal {
1657 Signal {
1658 name: "colorChanged"
1658 name: "colorChanged"
1659 Parameter { name: "color"; type: "QColor" }
1659 Parameter { name: "color"; type: "QColor" }
1660 }
1660 }
1661 Signal {
1661 Signal {
1662 name: "borderColorChanged"
1662 name: "borderColorChanged"
1663 Parameter { name: "color"; type: "QColor" }
1663 Parameter { name: "color"; type: "QColor" }
1664 }
1664 }
1665 Signal {
1665 Signal {
1666 name: "labelColorChanged"
1666 name: "labelColorChanged"
1667 Parameter { name: "color"; type: "QColor" }
1667 Parameter { name: "color"; type: "QColor" }
1668 }
1668 }
1669 Signal {
1669 Signal {
1670 name: "valuesAdded"
1670 name: "valuesAdded"
1671 Parameter { name: "index"; type: "int" }
1671 Parameter { name: "index"; type: "int" }
1672 Parameter { name: "count"; type: "int" }
1672 Parameter { name: "count"; type: "int" }
1673 }
1673 }
1674 Signal {
1674 Signal {
1675 name: "valuesRemoved"
1675 name: "valuesRemoved"
1676 Parameter { name: "index"; type: "int" }
1676 Parameter { name: "index"; type: "int" }
1677 Parameter { name: "count"; type: "int" }
1677 Parameter { name: "count"; type: "int" }
1678 }
1678 }
1679 Signal {
1679 Signal {
1680 name: "valueChanged"
1680 name: "valueChanged"
1681 Parameter { name: "index"; type: "int" }
1681 Parameter { name: "index"; type: "int" }
1682 }
1682 }
1683 }
1683 }
1684 Component {
1684 Component {
1685 name: "QtCommercialChart::QBoxPlotSeries"
1685 name: "QtCommercialChart::QBoxPlotSeries"
1686 prototype: "QtCommercialChart::QAbstractSeries"
1686 prototype: "QtCommercialChart::QAbstractSeries"
1687 Property { name: "boxOutlineVisible"; type: "bool" }
1687 Property { name: "boxOutlineVisible"; type: "bool" }
1688 Property { name: "boxWidth"; type: "double" }
1688 Property { name: "boxWidth"; type: "double" }
1689 Property { name: "pen"; type: "QPen" }
1689 Property { name: "pen"; type: "QPen" }
1690 Property { name: "brush"; type: "QBrush" }
1690 Property { name: "brush"; type: "QBrush" }
1691 Signal {
1691 Signal {
1692 name: "clicked"
1692 name: "clicked"
1693 Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true }
1693 Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true }
1694 }
1694 }
1695 Signal {
1695 Signal {
1696 name: "hovered"
1696 name: "hovered"
1697 Parameter { name: "status"; type: "bool" }
1697 Parameter { name: "status"; type: "bool" }
1698 Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true }
1698 Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true }
1699 }
1699 }
1700 Signal { name: "countChanged" }
1700 Signal { name: "countChanged" }
1701 Signal { name: "boxOutlineVisibilityChanged" }
1701 Signal { name: "boxOutlineVisibilityChanged" }
1702 Signal {
1702 Signal {
1703 name: "boxsetsAdded"
1703 name: "boxsetsAdded"
1704 Parameter { name: "sets"; type: "QList<QBoxSet*>" }
1704 Parameter { name: "sets"; type: "QList<QBoxSet*>" }
1705 }
1705 }
1706 Signal {
1706 Signal {
1707 name: "boxsetsRemoved"
1707 name: "boxsetsRemoved"
1708 Parameter { name: "sets"; type: "QList<QBoxSet*>" }
1708 Parameter { name: "sets"; type: "QList<QBoxSet*>" }
1709 }
1709 }
1710 }
1710 }
1711 Component {
1711 Component {
1712 name: "QtCommercialChart::QBoxSet"
1712 name: "QtCommercialChart::QBoxSet"
1713 prototype: "QObject"
1713 prototype: "QObject"
1714 Property { name: "pen"; type: "QPen" }
1714 Property { name: "pen"; type: "QPen" }
1715 Property { name: "brush"; type: "QBrush" }
1715 Property { name: "brush"; type: "QBrush" }
1716 Signal { name: "clicked" }
1716 Signal { name: "clicked" }
1717 Signal {
1717 Signal {
1718 name: "hovered"
1718 name: "hovered"
1719 Parameter { name: "status"; type: "bool" }
1719 Parameter { name: "status"; type: "bool" }
1720 }
1720 }
1721 Signal { name: "valuesChanged" }
1721 Signal { name: "valuesChanged" }
1722 Signal {
1722 Signal {
1723 name: "valueChanged"
1723 name: "valueChanged"
1724 Parameter { name: "index"; type: "int" }
1724 Parameter { name: "index"; type: "int" }
1725 }
1725 }
1726 Signal { name: "cleared" }
1726 Signal { name: "cleared" }
1727 }
1727 }
1728 Component {
1728 Component {
1729 name: "QtCommercialChart::QCategoryAxis"
1729 name: "QtCommercialChart::QCategoryAxis"
1730 prototype: "QtCommercialChart::QValueAxis"
1730 prototype: "QtCommercialChart::QValueAxis"
1731 Property { name: "startValue"; type: "double" }
1731 Property { name: "startValue"; type: "double" }
1732 Property { name: "count"; type: "int"; isReadonly: true }
1732 Property { name: "count"; type: "int"; isReadonly: true }
1733 Property { name: "categoriesLabels"; type: "QStringList"; isReadonly: true }
1733 Property { name: "categoriesLabels"; type: "QStringList"; isReadonly: true }
1734 Signal { name: "categoriesChanged" }
1734 Signal { name: "categoriesChanged" }
1735 }
1735 }
1736 Component {
1736 Component {
1737 name: "QtCommercialChart::QDateTimeAxis"
1737 name: "QtCommercialChart::QDateTimeAxis"
1738 prototype: "QtCommercialChart::QAbstractAxis"
1738 prototype: "QtCommercialChart::QAbstractAxis"
1739 exports: ["QtCommercial.Chart/DateTimeAxis 1.1"]
1739 exports: ["QtCommercial.Chart/DateTimeAxis 1.1"]
1740 exportMetaObjectRevisions: [0]
1740 exportMetaObjectRevisions: [0]
1741 Property { name: "tickCount"; type: "int" }
1741 Property { name: "tickCount"; type: "int" }
1742 Property { name: "min"; type: "QDateTime" }
1742 Property { name: "min"; type: "QDateTime" }
1743 Property { name: "max"; type: "QDateTime" }
1743 Property { name: "max"; type: "QDateTime" }
1744 Property { name: "format"; type: "string" }
1744 Property { name: "format"; type: "string" }
1745 Signal {
1745 Signal {
1746 name: "minChanged"
1746 name: "minChanged"
1747 Parameter { name: "min"; type: "QDateTime" }
1747 Parameter { name: "min"; type: "QDateTime" }
1748 }
1748 }
1749 Signal {
1749 Signal {
1750 name: "maxChanged"
1750 name: "maxChanged"
1751 Parameter { name: "max"; type: "QDateTime" }
1751 Parameter { name: "max"; type: "QDateTime" }
1752 }
1752 }
1753 Signal {
1753 Signal {
1754 name: "rangeChanged"
1754 name: "rangeChanged"
1755 Parameter { name: "min"; type: "QDateTime" }
1755 Parameter { name: "min"; type: "QDateTime" }
1756 Parameter { name: "max"; type: "QDateTime" }
1756 Parameter { name: "max"; type: "QDateTime" }
1757 }
1757 }
1758 Signal {
1758 Signal {
1759 name: "formatChanged"
1759 name: "formatChanged"
1760 Parameter { name: "format"; type: "string" }
1760 Parameter { name: "format"; type: "string" }
1761 }
1761 }
1762 Signal {
1762 Signal {
1763 name: "tickCountChanged"
1763 name: "tickCountChanged"
1764 Parameter { name: "tick"; type: "int" }
1764 Parameter { name: "tick"; type: "int" }
1765 }
1765 }
1766 }
1766 }
1767 Component {
1767 Component {
1768 name: "QtCommercialChart::QHBarModelMapper"
1768 name: "QtCommercialChart::QHBarModelMapper"
1769 prototype: "QtCommercialChart::QBarModelMapper"
1769 prototype: "QtCommercialChart::QBarModelMapper"
1770 exports: ["QtCommercial.Chart/HBarModelMapper 1.0"]
1770 exports: ["QtCommercial.Chart/HBarModelMapper 1.0"]
1771 exportMetaObjectRevisions: [0]
1771 exportMetaObjectRevisions: [0]
1772 Property { name: "series"; type: "QAbstractBarSeries"; isPointer: true }
1772 Property { name: "series"; type: "QAbstractBarSeries"; isPointer: true }
1773 Property { name: "model"; type: "QAbstractItemModel"; isPointer: true }
1773 Property { name: "model"; type: "QAbstractItemModel"; isPointer: true }
1774 Property { name: "firstBarSetRow"; type: "int" }
1774 Property { name: "firstBarSetRow"; type: "int" }
1775 Property { name: "lastBarSetRow"; type: "int" }
1775 Property { name: "lastBarSetRow"; type: "int" }
1776 Property { name: "firstColumn"; type: "int" }
1776 Property { name: "firstColumn"; type: "int" }
1777 Property { name: "columnCount"; type: "int" }
1777 Property { name: "columnCount"; type: "int" }
1778 Signal { name: "seriesReplaced" }
1778 Signal { name: "seriesReplaced" }
1779 Signal { name: "modelReplaced" }
1779 Signal { name: "modelReplaced" }
1780 }
1780 }
1781 Component {
1781 Component {
1782 name: "QtCommercialChart::QHPieModelMapper"
1782 name: "QtCommercialChart::QHPieModelMapper"
1783 prototype: "QtCommercialChart::QPieModelMapper"
1783 prototype: "QtCommercialChart::QPieModelMapper"
1784 exports: ["QtCommercial.Chart/HPieModelMapper 1.0"]
1784 exports: ["QtCommercial.Chart/HPieModelMapper 1.0"]
1785 exportMetaObjectRevisions: [0]
1785 exportMetaObjectRevisions: [0]
1786 Property { name: "series"; type: "QPieSeries"; isPointer: true }
1786 Property { name: "series"; type: "QPieSeries"; isPointer: true }
1787 Property { name: "model"; type: "QAbstractItemModel"; isPointer: true }
1787 Property { name: "model"; type: "QAbstractItemModel"; isPointer: true }
1788 Property { name: "valuesRow"; type: "int" }
1788 Property { name: "valuesRow"; type: "int" }
1789 Property { name: "labelsRow"; type: "int" }
1789 Property { name: "labelsRow"; type: "int" }
1790 Property { name: "firstColumn"; type: "int" }
1790 Property { name: "firstColumn"; type: "int" }
1791 Property { name: "columnCount"; type: "int" }
1791 Property { name: "columnCount"; type: "int" }
1792 Signal { name: "seriesReplaced" }
1792 Signal { name: "seriesReplaced" }
1793 Signal { name: "modelReplaced" }
1793 Signal { name: "modelReplaced" }
1794 }
1794 }
1795 Component {
1795 Component {
1796 name: "QtCommercialChart::QHXYModelMapper"
1796 name: "QtCommercialChart::QHXYModelMapper"
1797 prototype: "QtCommercialChart::QXYModelMapper"
1797 prototype: "QtCommercialChart::QXYModelMapper"
1798 exports: ["QtCommercial.Chart/HXYModelMapper 1.0"]
1798 exports: ["QtCommercial.Chart/HXYModelMapper 1.0"]
1799 exportMetaObjectRevisions: [0]
1799 exportMetaObjectRevisions: [0]
1800 Property { name: "series"; type: "QXYSeries"; isPointer: true }
1800 Property { name: "series"; type: "QXYSeries"; isPointer: true }
1801 Property { name: "model"; type: "QAbstractItemModel"; isPointer: true }
1801 Property { name: "model"; type: "QAbstractItemModel"; isPointer: true }
1802 Property { name: "xRow"; type: "int" }
1802 Property { name: "xRow"; type: "int" }
1803 Property { name: "yRow"; type: "int" }
1803 Property { name: "yRow"; type: "int" }
1804 Property { name: "firstColumn"; type: "int" }
1804 Property { name: "firstColumn"; type: "int" }
1805 Property { name: "columnCount"; type: "int" }
1805 Property { name: "columnCount"; type: "int" }
1806 Signal { name: "seriesReplaced" }
1806 Signal { name: "seriesReplaced" }
1807 Signal { name: "modelReplaced" }
1807 Signal { name: "modelReplaced" }
1808 }
1808 }
1809 Component {
1809 Component {
1810 name: "QtCommercialChart::QHorizontalBarSeries"
1810 name: "QtCommercialChart::QHorizontalBarSeries"
1811 prototype: "QtCommercialChart::QAbstractBarSeries"
1811 prototype: "QtCommercialChart::QAbstractBarSeries"
1812 }
1812 }
1813 Component {
1813 Component {
1814 name: "QtCommercialChart::QHorizontalPercentBarSeries"
1814 name: "QtCommercialChart::QHorizontalPercentBarSeries"
1815 prototype: "QtCommercialChart::QAbstractBarSeries"
1815 prototype: "QtCommercialChart::QAbstractBarSeries"
1816 }
1816 }
1817 Component {
1817 Component {
1818 name: "QtCommercialChart::QHorizontalStackedBarSeries"
1818 name: "QtCommercialChart::QHorizontalStackedBarSeries"
1819 prototype: "QtCommercialChart::QAbstractBarSeries"
1819 prototype: "QtCommercialChart::QAbstractBarSeries"
1820 }
1820 }
1821 Component {
1821 Component {
1822 name: "QtCommercialChart::QLegend"
1822 name: "QtCommercialChart::QLegend"
1823 defaultProperty: "children"
1823 defaultProperty: "children"
1824 prototype: "QGraphicsWidget"
1824 prototype: "QGraphicsWidget"
1825 exports: ["QtCommercial.Chart/Legend 1.0"]
1825 exports: ["QtCommercial.Chart/Legend 1.0"]
1826 isCreatable: false
1826 isCreatable: false
1827 exportMetaObjectRevisions: [0]
1827 exportMetaObjectRevisions: [0]
1828 Property { name: "alignment"; type: "Qt::Alignment" }
1828 Property { name: "alignment"; type: "Qt::Alignment" }
1829 Property { name: "backgroundVisible"; type: "bool" }
1829 Property { name: "backgroundVisible"; type: "bool" }
1830 Property { name: "color"; type: "QColor" }
1830 Property { name: "color"; type: "QColor" }
1831 Property { name: "borderColor"; type: "QColor" }
1831 Property { name: "borderColor"; type: "QColor" }
1832 Property { name: "font"; type: "QFont" }
1832 Property { name: "font"; type: "QFont" }
1833 Property { name: "labelColor"; type: "QColor" }
1833 Property { name: "labelColor"; type: "QColor" }
1834 Property { name: "reverseMarkers"; type: "bool" }
1834 Signal {
1835 Signal {
1835 name: "backgroundVisibleChanged"
1836 name: "backgroundVisibleChanged"
1836 Parameter { name: "visible"; type: "bool" }
1837 Parameter { name: "visible"; type: "bool" }
1837 }
1838 }
1838 Signal {
1839 Signal {
1839 name: "colorChanged"
1840 name: "colorChanged"
1840 Parameter { name: "color"; type: "QColor" }
1841 Parameter { name: "color"; type: "QColor" }
1841 }
1842 }
1842 Signal {
1843 Signal {
1843 name: "borderColorChanged"
1844 name: "borderColorChanged"
1844 Parameter { name: "color"; type: "QColor" }
1845 Parameter { name: "color"; type: "QColor" }
1845 }
1846 }
1846 Signal {
1847 Signal {
1847 name: "fontChanged"
1848 name: "fontChanged"
1848 Parameter { name: "font"; type: "QFont" }
1849 Parameter { name: "font"; type: "QFont" }
1849 }
1850 }
1850 Signal {
1851 Signal {
1851 name: "labelColorChanged"
1852 name: "labelColorChanged"
1852 Parameter { name: "color"; type: "QColor" }
1853 Parameter { name: "color"; type: "QColor" }
1853 }
1854 }
1855 Signal {
1856 name: "reverseMarkersChanged"
1857 Parameter { name: "reverseMarkers"; type: "bool" }
1858 }
1854 }
1859 }
1855 Component { name: "QtCommercialChart::QLineSeries"; prototype: "QtCommercialChart::QXYSeries" }
1860 Component { name: "QtCommercialChart::QLineSeries"; prototype: "QtCommercialChart::QXYSeries" }
1856 Component {
1861 Component {
1857 name: "QtCommercialChart::QLogValueAxis"
1862 name: "QtCommercialChart::QLogValueAxis"
1858 prototype: "QtCommercialChart::QAbstractAxis"
1863 prototype: "QtCommercialChart::QAbstractAxis"
1859 exports: ["QtCommercial.Chart/LogValueAxis 1.3"]
1864 exports: ["QtCommercial.Chart/LogValueAxis 1.3"]
1860 exportMetaObjectRevisions: [0]
1865 exportMetaObjectRevisions: [0]
1861 Property { name: "min"; type: "double" }
1866 Property { name: "min"; type: "double" }
1862 Property { name: "max"; type: "double" }
1867 Property { name: "max"; type: "double" }
1863 Property { name: "labelFormat"; type: "string" }
1868 Property { name: "labelFormat"; type: "string" }
1864 Property { name: "base"; type: "double" }
1869 Property { name: "base"; type: "double" }
1865 Signal {
1870 Signal {
1866 name: "minChanged"
1871 name: "minChanged"
1867 Parameter { name: "min"; type: "double" }
1872 Parameter { name: "min"; type: "double" }
1868 }
1873 }
1869 Signal {
1874 Signal {
1870 name: "maxChanged"
1875 name: "maxChanged"
1871 Parameter { name: "max"; type: "double" }
1876 Parameter { name: "max"; type: "double" }
1872 }
1877 }
1873 Signal {
1878 Signal {
1874 name: "rangeChanged"
1879 name: "rangeChanged"
1875 Parameter { name: "min"; type: "double" }
1880 Parameter { name: "min"; type: "double" }
1876 Parameter { name: "max"; type: "double" }
1881 Parameter { name: "max"; type: "double" }
1877 }
1882 }
1878 Signal {
1883 Signal {
1879 name: "labelFormatChanged"
1884 name: "labelFormatChanged"
1880 Parameter { name: "format"; type: "string" }
1885 Parameter { name: "format"; type: "string" }
1881 }
1886 }
1882 Signal {
1887 Signal {
1883 name: "baseChanged"
1888 name: "baseChanged"
1884 Parameter { name: "base"; type: "double" }
1889 Parameter { name: "base"; type: "double" }
1885 }
1890 }
1886 }
1891 }
1887 Component {
1892 Component {
1888 name: "QtCommercialChart::QPercentBarSeries"
1893 name: "QtCommercialChart::QPercentBarSeries"
1889 prototype: "QtCommercialChart::QAbstractBarSeries"
1894 prototype: "QtCommercialChart::QAbstractBarSeries"
1890 }
1895 }
1891 Component {
1896 Component {
1892 name: "QtCommercialChart::QPieModelMapper"
1897 name: "QtCommercialChart::QPieModelMapper"
1893 prototype: "QObject"
1898 prototype: "QObject"
1894 exports: ["QtCommercial.Chart/PieModelMapper 1.0"]
1899 exports: ["QtCommercial.Chart/PieModelMapper 1.0"]
1895 isCreatable: false
1900 isCreatable: false
1896 exportMetaObjectRevisions: [0]
1901 exportMetaObjectRevisions: [0]
1897 }
1902 }
1898 Component {
1903 Component {
1899 name: "QtCommercialChart::QPieSeries"
1904 name: "QtCommercialChart::QPieSeries"
1900 prototype: "QtCommercialChart::QAbstractSeries"
1905 prototype: "QtCommercialChart::QAbstractSeries"
1901 exports: ["QtCommercial.Chart/QPieSeries 1.0"]
1906 exports: ["QtCommercial.Chart/QPieSeries 1.0"]
1902 isCreatable: false
1907 isCreatable: false
1903 exportMetaObjectRevisions: [0]
1908 exportMetaObjectRevisions: [0]
1904 Property { name: "horizontalPosition"; type: "double" }
1909 Property { name: "horizontalPosition"; type: "double" }
1905 Property { name: "verticalPosition"; type: "double" }
1910 Property { name: "verticalPosition"; type: "double" }
1906 Property { name: "size"; type: "double" }
1911 Property { name: "size"; type: "double" }
1907 Property { name: "startAngle"; type: "double" }
1912 Property { name: "startAngle"; type: "double" }
1908 Property { name: "endAngle"; type: "double" }
1913 Property { name: "endAngle"; type: "double" }
1909 Property { name: "count"; type: "int"; isReadonly: true }
1914 Property { name: "count"; type: "int"; isReadonly: true }
1910 Property { name: "sum"; type: "double"; isReadonly: true }
1915 Property { name: "sum"; type: "double"; isReadonly: true }
1911 Property { name: "holeSize"; type: "double" }
1916 Property { name: "holeSize"; type: "double" }
1912 Signal {
1917 Signal {
1913 name: "added"
1918 name: "added"
1914 Parameter { name: "slices"; type: "QList<QPieSlice*>" }
1919 Parameter { name: "slices"; type: "QList<QPieSlice*>" }
1915 }
1920 }
1916 Signal {
1921 Signal {
1917 name: "removed"
1922 name: "removed"
1918 Parameter { name: "slices"; type: "QList<QPieSlice*>" }
1923 Parameter { name: "slices"; type: "QList<QPieSlice*>" }
1919 }
1924 }
1920 Signal {
1925 Signal {
1921 name: "clicked"
1926 name: "clicked"
1922 Parameter { name: "slice"; type: "QPieSlice"; isPointer: true }
1927 Parameter { name: "slice"; type: "QPieSlice"; isPointer: true }
1923 }
1928 }
1924 Signal {
1929 Signal {
1925 name: "hovered"
1930 name: "hovered"
1926 Parameter { name: "slice"; type: "QPieSlice"; isPointer: true }
1931 Parameter { name: "slice"; type: "QPieSlice"; isPointer: true }
1927 Parameter { name: "state"; type: "bool" }
1932 Parameter { name: "state"; type: "bool" }
1928 }
1933 }
1929 }
1934 }
1930 Component {
1935 Component {
1931 name: "QtCommercialChart::QPieSlice"
1936 name: "QtCommercialChart::QPieSlice"
1932 prototype: "QObject"
1937 prototype: "QObject"
1933 exports: ["QtCommercial.Chart/PieSlice 1.0"]
1938 exports: ["QtCommercial.Chart/PieSlice 1.0"]
1934 exportMetaObjectRevisions: [0]
1939 exportMetaObjectRevisions: [0]
1935 Enum {
1940 Enum {
1936 name: "LabelPosition"
1941 name: "LabelPosition"
1937 values: {
1942 values: {
1938 "LabelOutside": 0,
1943 "LabelOutside": 0,
1939 "LabelInsideHorizontal": 1,
1944 "LabelInsideHorizontal": 1,
1940 "LabelInsideTangential": 2,
1945 "LabelInsideTangential": 2,
1941 "LabelInsideNormal": 3
1946 "LabelInsideNormal": 3
1942 }
1947 }
1943 }
1948 }
1944 Property { name: "label"; type: "string" }
1949 Property { name: "label"; type: "string" }
1945 Property { name: "value"; type: "double" }
1950 Property { name: "value"; type: "double" }
1946 Property { name: "labelVisible"; type: "bool" }
1951 Property { name: "labelVisible"; type: "bool" }
1947 Property { name: "labelPosition"; type: "LabelPosition" }
1952 Property { name: "labelPosition"; type: "LabelPosition" }
1948 Property { name: "exploded"; type: "bool" }
1953 Property { name: "exploded"; type: "bool" }
1949 Property { name: "pen"; type: "QPen" }
1954 Property { name: "pen"; type: "QPen" }
1950 Property { name: "borderColor"; type: "QColor" }
1955 Property { name: "borderColor"; type: "QColor" }
1951 Property { name: "borderWidth"; type: "int" }
1956 Property { name: "borderWidth"; type: "int" }
1952 Property { name: "brush"; type: "QBrush" }
1957 Property { name: "brush"; type: "QBrush" }
1953 Property { name: "color"; type: "QColor" }
1958 Property { name: "color"; type: "QColor" }
1954 Property { name: "labelBrush"; type: "QBrush" }
1959 Property { name: "labelBrush"; type: "QBrush" }
1955 Property { name: "labelColor"; type: "QColor" }
1960 Property { name: "labelColor"; type: "QColor" }
1956 Property { name: "labelFont"; type: "QFont" }
1961 Property { name: "labelFont"; type: "QFont" }
1957 Property { name: "labelArmLengthFactor"; type: "double" }
1962 Property { name: "labelArmLengthFactor"; type: "double" }
1958 Property { name: "explodeDistanceFactor"; type: "double" }
1963 Property { name: "explodeDistanceFactor"; type: "double" }
1959 Property { name: "percentage"; type: "double"; isReadonly: true }
1964 Property { name: "percentage"; type: "double"; isReadonly: true }
1960 Property { name: "startAngle"; type: "double"; isReadonly: true }
1965 Property { name: "startAngle"; type: "double"; isReadonly: true }
1961 Property { name: "angleSpan"; type: "double"; isReadonly: true }
1966 Property { name: "angleSpan"; type: "double"; isReadonly: true }
1962 Signal { name: "clicked" }
1967 Signal { name: "clicked" }
1963 Signal {
1968 Signal {
1964 name: "hovered"
1969 name: "hovered"
1965 Parameter { name: "state"; type: "bool" }
1970 Parameter { name: "state"; type: "bool" }
1966 }
1971 }
1967 }
1972 }
1968 Component {
1973 Component {
1969 name: "QtCommercialChart::QScatterSeries"
1974 name: "QtCommercialChart::QScatterSeries"
1970 prototype: "QtCommercialChart::QXYSeries"
1975 prototype: "QtCommercialChart::QXYSeries"
1971 Enum {
1976 Enum {
1972 name: "MarkerShape"
1977 name: "MarkerShape"
1973 values: {
1978 values: {
1974 "MarkerShapeCircle": 0,
1979 "MarkerShapeCircle": 0,
1975 "MarkerShapeRectangle": 1
1980 "MarkerShapeRectangle": 1
1976 }
1981 }
1977 }
1982 }
1978 Property { name: "color"; type: "QColor" }
1983 Property { name: "color"; type: "QColor" }
1979 Property { name: "borderColor"; type: "QColor" }
1984 Property { name: "borderColor"; type: "QColor" }
1980 Property { name: "markerShape"; type: "MarkerShape" }
1985 Property { name: "markerShape"; type: "MarkerShape" }
1981 Property { name: "markerSize"; type: "double" }
1986 Property { name: "markerSize"; type: "double" }
1982 Signal {
1987 Signal {
1983 name: "colorChanged"
1988 name: "colorChanged"
1984 Parameter { name: "color"; type: "QColor" }
1989 Parameter { name: "color"; type: "QColor" }
1985 }
1990 }
1986 Signal {
1991 Signal {
1987 name: "borderColorChanged"
1992 name: "borderColorChanged"
1988 Parameter { name: "color"; type: "QColor" }
1993 Parameter { name: "color"; type: "QColor" }
1989 }
1994 }
1990 }
1995 }
1991 Component {
1996 Component {
1992 name: "QtCommercialChart::QSplineSeries"
1997 name: "QtCommercialChart::QSplineSeries"
1993 prototype: "QtCommercialChart::QLineSeries"
1998 prototype: "QtCommercialChart::QLineSeries"
1994 }
1999 }
1995 Component {
2000 Component {
1996 name: "QtCommercialChart::QStackedBarSeries"
2001 name: "QtCommercialChart::QStackedBarSeries"
1997 prototype: "QtCommercialChart::QAbstractBarSeries"
2002 prototype: "QtCommercialChart::QAbstractBarSeries"
1998 }
2003 }
1999 Component {
2004 Component {
2000 name: "QtCommercialChart::QVBarModelMapper"
2005 name: "QtCommercialChart::QVBarModelMapper"
2001 prototype: "QtCommercialChart::QBarModelMapper"
2006 prototype: "QtCommercialChart::QBarModelMapper"
2002 exports: ["QtCommercial.Chart/VBarModelMapper 1.0"]
2007 exports: ["QtCommercial.Chart/VBarModelMapper 1.0"]
2003 exportMetaObjectRevisions: [0]
2008 exportMetaObjectRevisions: [0]
2004 Property { name: "series"; type: "QAbstractBarSeries"; isPointer: true }
2009 Property { name: "series"; type: "QAbstractBarSeries"; isPointer: true }
2005 Property { name: "model"; type: "QAbstractItemModel"; isPointer: true }
2010 Property { name: "model"; type: "QAbstractItemModel"; isPointer: true }
2006 Property { name: "firstBarSetColumn"; type: "int" }
2011 Property { name: "firstBarSetColumn"; type: "int" }
2007 Property { name: "lastBarSetColumn"; type: "int" }
2012 Property { name: "lastBarSetColumn"; type: "int" }
2008 Property { name: "firstRow"; type: "int" }
2013 Property { name: "firstRow"; type: "int" }
2009 Property { name: "rowCount"; type: "int" }
2014 Property { name: "rowCount"; type: "int" }
2010 Signal { name: "seriesReplaced" }
2015 Signal { name: "seriesReplaced" }
2011 Signal { name: "modelReplaced" }
2016 Signal { name: "modelReplaced" }
2012 }
2017 }
2013 Component {
2018 Component {
2014 name: "QtCommercialChart::QVPieModelMapper"
2019 name: "QtCommercialChart::QVPieModelMapper"
2015 prototype: "QtCommercialChart::QPieModelMapper"
2020 prototype: "QtCommercialChart::QPieModelMapper"
2016 exports: ["QtCommercial.Chart/VPieModelMapper 1.0"]
2021 exports: ["QtCommercial.Chart/VPieModelMapper 1.0"]
2017 exportMetaObjectRevisions: [0]
2022 exportMetaObjectRevisions: [0]
2018 Property { name: "series"; type: "QPieSeries"; isPointer: true }
2023 Property { name: "series"; type: "QPieSeries"; isPointer: true }
2019 Property { name: "model"; type: "QAbstractItemModel"; isPointer: true }
2024 Property { name: "model"; type: "QAbstractItemModel"; isPointer: true }
2020 Property { name: "valuesColumn"; type: "int" }
2025 Property { name: "valuesColumn"; type: "int" }
2021 Property { name: "labelsColumn"; type: "int" }
2026 Property { name: "labelsColumn"; type: "int" }
2022 Property { name: "firstRow"; type: "int" }
2027 Property { name: "firstRow"; type: "int" }
2023 Property { name: "rowCount"; type: "int" }
2028 Property { name: "rowCount"; type: "int" }
2024 Signal { name: "seriesReplaced" }
2029 Signal { name: "seriesReplaced" }
2025 Signal { name: "modelReplaced" }
2030 Signal { name: "modelReplaced" }
2026 }
2031 }
2027 Component {
2032 Component {
2028 name: "QtCommercialChart::QVXYModelMapper"
2033 name: "QtCommercialChart::QVXYModelMapper"
2029 prototype: "QtCommercialChart::QXYModelMapper"
2034 prototype: "QtCommercialChart::QXYModelMapper"
2030 exports: ["QtCommercial.Chart/VXYModelMapper 1.0"]
2035 exports: ["QtCommercial.Chart/VXYModelMapper 1.0"]
2031 exportMetaObjectRevisions: [0]
2036 exportMetaObjectRevisions: [0]
2032 Property { name: "series"; type: "QXYSeries"; isPointer: true }
2037 Property { name: "series"; type: "QXYSeries"; isPointer: true }
2033 Property { name: "model"; type: "QAbstractItemModel"; isPointer: true }
2038 Property { name: "model"; type: "QAbstractItemModel"; isPointer: true }
2034 Property { name: "xColumn"; type: "int" }
2039 Property { name: "xColumn"; type: "int" }
2035 Property { name: "yColumn"; type: "int" }
2040 Property { name: "yColumn"; type: "int" }
2036 Property { name: "firstRow"; type: "int" }
2041 Property { name: "firstRow"; type: "int" }
2037 Property { name: "rowCount"; type: "int" }
2042 Property { name: "rowCount"; type: "int" }
2038 Signal { name: "seriesReplaced" }
2043 Signal { name: "seriesReplaced" }
2039 Signal { name: "modelReplaced" }
2044 Signal { name: "modelReplaced" }
2040 }
2045 }
2041 Component {
2046 Component {
2042 name: "QtCommercialChart::QValueAxis"
2047 name: "QtCommercialChart::QValueAxis"
2043 prototype: "QtCommercialChart::QAbstractAxis"
2048 prototype: "QtCommercialChart::QAbstractAxis"
2044 exports: [
2049 exports: [
2045 "QtCommercial.Chart/ValueAxis 1.1",
2050 "QtCommercial.Chart/ValueAxis 1.1",
2046 "QtCommercial.Chart/ValuesAxis 1.0"
2051 "QtCommercial.Chart/ValuesAxis 1.0"
2047 ]
2052 ]
2048 exportMetaObjectRevisions: [0, 0]
2053 exportMetaObjectRevisions: [0, 0]
2049 Property { name: "tickCount"; type: "int" }
2054 Property { name: "tickCount"; type: "int" }
2050 Property { name: "niceNumbersEnabled"; type: "bool" }
2055 Property { name: "niceNumbersEnabled"; type: "bool" }
2051 Property { name: "min"; type: "double" }
2056 Property { name: "min"; type: "double" }
2052 Property { name: "max"; type: "double" }
2057 Property { name: "max"; type: "double" }
2053 Property { name: "labelFormat"; type: "string" }
2058 Property { name: "labelFormat"; type: "string" }
2054 Signal {
2059 Signal {
2055 name: "minChanged"
2060 name: "minChanged"
2056 Parameter { name: "min"; type: "double" }
2061 Parameter { name: "min"; type: "double" }
2057 }
2062 }
2058 Signal {
2063 Signal {
2059 name: "maxChanged"
2064 name: "maxChanged"
2060 Parameter { name: "max"; type: "double" }
2065 Parameter { name: "max"; type: "double" }
2061 }
2066 }
2062 Signal {
2067 Signal {
2063 name: "rangeChanged"
2068 name: "rangeChanged"
2064 Parameter { name: "min"; type: "double" }
2069 Parameter { name: "min"; type: "double" }
2065 Parameter { name: "max"; type: "double" }
2070 Parameter { name: "max"; type: "double" }
2066 }
2071 }
2067 Signal {
2072 Signal {
2068 name: "tickCountChanged"
2073 name: "tickCountChanged"
2069 Parameter { name: "tickCount"; type: "int" }
2074 Parameter { name: "tickCount"; type: "int" }
2070 }
2075 }
2071 Signal {
2076 Signal {
2072 name: "labelFormatChanged"
2077 name: "labelFormatChanged"
2073 Parameter { name: "format"; type: "string" }
2078 Parameter { name: "format"; type: "string" }
2074 }
2079 }
2075 Method { name: "applyNiceNumbers" }
2080 Method { name: "applyNiceNumbers" }
2076 }
2081 }
2077 Component {
2082 Component {
2078 name: "QtCommercialChart::QXYModelMapper"
2083 name: "QtCommercialChart::QXYModelMapper"
2079 prototype: "QObject"
2084 prototype: "QObject"
2080 exports: ["QtCommercial.Chart/XYModelMapper 1.0"]
2085 exports: ["QtCommercial.Chart/XYModelMapper 1.0"]
2081 isCreatable: false
2086 isCreatable: false
2082 exportMetaObjectRevisions: [0]
2087 exportMetaObjectRevisions: [0]
2083 }
2088 }
2084 Component {
2089 Component {
2085 name: "QtCommercialChart::QXYSeries"
2090 name: "QtCommercialChart::QXYSeries"
2086 prototype: "QtCommercialChart::QAbstractSeries"
2091 prototype: "QtCommercialChart::QAbstractSeries"
2087 exports: ["QtCommercial.Chart/XYSeries 1.0"]
2092 exports: ["QtCommercial.Chart/XYSeries 1.0"]
2088 isCreatable: false
2093 isCreatable: false
2089 exportMetaObjectRevisions: [0]
2094 exportMetaObjectRevisions: [0]
2090 Property { name: "pointsVisible"; type: "bool" }
2095 Property { name: "pointsVisible"; type: "bool" }
2091 Property { name: "color"; type: "QColor" }
2096 Property { name: "color"; type: "QColor" }
2092 Signal {
2097 Signal {
2093 name: "clicked"
2098 name: "clicked"
2094 Parameter { name: "point"; type: "QPointF" }
2099 Parameter { name: "point"; type: "QPointF" }
2095 }
2100 }
2096 Signal {
2101 Signal {
2097 name: "hovered"
2102 name: "hovered"
2098 Parameter { name: "point"; type: "QPointF" }
2103 Parameter { name: "point"; type: "QPointF" }
2099 Parameter { name: "state"; type: "bool" }
2104 Parameter { name: "state"; type: "bool" }
2100 }
2105 }
2101 Signal {
2106 Signal {
2102 name: "pointReplaced"
2107 name: "pointReplaced"
2103 Parameter { name: "index"; type: "int" }
2108 Parameter { name: "index"; type: "int" }
2104 }
2109 }
2105 Signal {
2110 Signal {
2106 name: "pointRemoved"
2111 name: "pointRemoved"
2107 Parameter { name: "index"; type: "int" }
2112 Parameter { name: "index"; type: "int" }
2108 }
2113 }
2109 Signal {
2114 Signal {
2110 name: "pointAdded"
2115 name: "pointAdded"
2111 Parameter { name: "index"; type: "int" }
2116 Parameter { name: "index"; type: "int" }
2112 }
2117 }
2113 Signal {
2118 Signal {
2114 name: "colorChanged"
2119 name: "colorChanged"
2115 Parameter { name: "color"; type: "QColor" }
2120 Parameter { name: "color"; type: "QColor" }
2116 }
2121 }
2117 Signal { name: "pointsReplaced" }
2122 Signal { name: "pointsReplaced" }
2118 }
2123 }
2119 }
2124 }
@@ -1,493 +1,506
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2013 Digia Plc
3 ** Copyright (C) 2013 Digia Plc
4 ** All rights reserved.
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
6 **
7 ** This file is part of the Qt Enterprise Charts Add-on.
7 ** This file is part of the Qt Enterprise Charts Add-on.
8 **
8 **
9 ** $QT_BEGIN_LICENSE$
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
11 ** accordance with the Qt Enterprise License Agreement provided with the
11 ** accordance with the Qt Enterprise License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
13 ** a written agreement between you and Digia.
14 **
14 **
15 ** If you have questions regarding the use of this file, please use
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
17 ** $QT_END_LICENSE$
18 **
18 **
19 ****************************************************************************/
19 ****************************************************************************/
20
20
21 #include "legendlayout_p.h"
21 #include "legendlayout_p.h"
22 #include "chartpresenter_p.h"
22 #include "chartpresenter_p.h"
23 #include "qlegend_p.h"
23 #include "qlegend_p.h"
24 #include "abstractchartlayout_p.h"
24 #include "abstractchartlayout_p.h"
25
25
26 #include "qlegendmarker_p.h"
26 #include "qlegendmarker_p.h"
27 #include "legendmarkeritem_p.h"
27 #include "legendmarkeritem_p.h"
28 #include "qlegendmarker.h"
28 #include "qlegendmarker.h"
29
29
30 QTCOMMERCIALCHART_BEGIN_NAMESPACE
30 QTCOMMERCIALCHART_BEGIN_NAMESPACE
31
31
32 LegendLayout::LegendLayout(QLegend *legend)
32 LegendLayout::LegendLayout(QLegend *legend)
33 : m_legend(legend),
33 : m_legend(legend),
34 m_offsetX(0),
34 m_offsetX(0),
35 m_offsetY(0)
35 m_offsetY(0)
36 {
36 {
37
37
38 }
38 }
39
39
40 LegendLayout::~LegendLayout()
40 LegendLayout::~LegendLayout()
41 {
41 {
42
42
43 }
43 }
44
44
45 void LegendLayout::setOffset(qreal x, qreal y)
45 void LegendLayout::setOffset(qreal x, qreal y)
46 {
46 {
47 bool scrollHorizontal = true;
47 bool scrollHorizontal = true;
48 switch (m_legend->alignment()) {
48 switch (m_legend->alignment()) {
49 case Qt::AlignTop:
49 case Qt::AlignTop:
50 case Qt::AlignBottom:
50 case Qt::AlignBottom:
51 scrollHorizontal = true;
51 scrollHorizontal = true;
52 break;
52 break;
53 case Qt::AlignLeft:
53 case Qt::AlignLeft:
54 case Qt::AlignRight:
54 case Qt::AlignRight:
55 scrollHorizontal = false;
55 scrollHorizontal = false;
56 break;
56 break;
57 }
57 }
58
58
59 // If detached, the scrolling direction is vertical instead of horizontal and vice versa.
59 // If detached, the scrolling direction is vertical instead of horizontal and vice versa.
60 if (!m_legend->isAttachedToChart())
60 if (!m_legend->isAttachedToChart())
61 scrollHorizontal = !scrollHorizontal;
61 scrollHorizontal = !scrollHorizontal;
62
62
63 QRectF boundingRect = geometry();
63 QRectF boundingRect = geometry();
64 qreal left, top, right, bottom;
64 qreal left, top, right, bottom;
65 getContentsMargins(&left, &top, &right, &bottom);
65 getContentsMargins(&left, &top, &right, &bottom);
66 boundingRect.adjust(left, top, -right, -bottom);
66 boundingRect.adjust(left, top, -right, -bottom);
67
67
68 // Limit offset between m_minOffset and m_maxOffset
68 // Limit offset between m_minOffset and m_maxOffset
69 if (scrollHorizontal) {
69 if (scrollHorizontal) {
70 if (m_width <= boundingRect.width())
70 if (m_width <= boundingRect.width())
71 return;
71 return;
72
72
73 if (x != m_offsetX) {
73 if (x != m_offsetX) {
74 m_offsetX = qBound(m_minOffsetX, x, m_maxOffsetX);
74 m_offsetX = qBound(m_minOffsetX, x, m_maxOffsetX);
75 m_legend->d_ptr->items()->setPos(-m_offsetX, boundingRect.top());
75 m_legend->d_ptr->items()->setPos(-m_offsetX, boundingRect.top());
76 }
76 }
77 } else {
77 } else {
78 if (m_height <= boundingRect.height())
78 if (m_height <= boundingRect.height())
79 return;
79 return;
80
80
81 if (y != m_offsetY) {
81 if (y != m_offsetY) {
82 m_offsetY = qBound(m_minOffsetY, y, m_maxOffsetY);
82 m_offsetY = qBound(m_minOffsetY, y, m_maxOffsetY);
83 m_legend->d_ptr->items()->setPos(boundingRect.left(), -m_offsetY);
83 m_legend->d_ptr->items()->setPos(boundingRect.left(), -m_offsetY);
84 }
84 }
85 }
85 }
86 }
86 }
87
87
88 QPointF LegendLayout::offset() const
88 QPointF LegendLayout::offset() const
89 {
89 {
90 return QPointF(m_offsetX, m_offsetY);
90 return QPointF(m_offsetX, m_offsetY);
91 }
91 }
92
92
93 void LegendLayout::invalidate()
93 void LegendLayout::invalidate()
94 {
94 {
95 QGraphicsLayout::invalidate();
95 QGraphicsLayout::invalidate();
96 if (m_legend->isAttachedToChart())
96 if (m_legend->isAttachedToChart())
97 m_legend->d_ptr->m_presenter->layout()->invalidate();
97 m_legend->d_ptr->m_presenter->layout()->invalidate();
98 }
98 }
99
99
100 void LegendLayout::setGeometry(const QRectF &rect)
100 void LegendLayout::setGeometry(const QRectF &rect)
101 {
101 {
102 m_legend->d_ptr->items()->setVisible(m_legend->isVisible());
102 m_legend->d_ptr->items()->setVisible(m_legend->isVisible());
103
103
104 QGraphicsLayout::setGeometry(rect);
104 QGraphicsLayout::setGeometry(rect);
105
105
106 if (m_legend->isAttachedToChart())
106 if (m_legend->isAttachedToChart())
107 setAttachedGeometry(rect);
107 setAttachedGeometry(rect);
108 else
108 else
109 setDettachedGeometry(rect);
109 setDettachedGeometry(rect);
110 }
110 }
111
111
112 void LegendLayout::setAttachedGeometry(const QRectF &rect)
112 void LegendLayout::setAttachedGeometry(const QRectF &rect)
113 {
113 {
114 if (!rect.isValid())
114 if (!rect.isValid())
115 return;
115 return;
116
116
117 qreal oldOffsetX = m_offsetX;
117 qreal oldOffsetX = m_offsetX;
118 qreal oldOffsetY = m_offsetY;
118 qreal oldOffsetY = m_offsetY;
119 m_offsetX = 0;
119 m_offsetX = 0;
120 m_offsetY = 0;
120 m_offsetY = 0;
121
121
122 QSizeF size(0, 0);
122 QSizeF size(0, 0);
123
123
124 if (m_legend->d_ptr->markers().isEmpty()) {
124 if (m_legend->d_ptr->markers().isEmpty()) {
125 return;
125 return;
126 }
126 }
127
127
128 m_width = 0;
128 m_width = 0;
129 m_height = 0;
129 m_height = 0;
130
130
131 qreal left, top, right, bottom;
131 qreal left, top, right, bottom;
132 getContentsMargins(&left, &top, &right, &bottom);
132 getContentsMargins(&left, &top, &right, &bottom);
133
133
134 QRectF geometry = rect.adjusted(left, top, -right, -bottom);
134 QRectF geometry = rect.adjusted(left, top, -right, -bottom);
135
135
136 switch(m_legend->alignment()) {
136 switch(m_legend->alignment()) {
137 case Qt::AlignTop:
137 case Qt::AlignTop:
138 case Qt::AlignBottom: {
138 case Qt::AlignBottom: {
139 // Calculate the space required for items and add them to a sorted list.
139 // Calculate the space required for items and add them to a sorted list.
140 qreal markerItemsWidth = 0;
140 qreal markerItemsWidth = 0;
141 qreal itemMargins = 0;
141 qreal itemMargins = 0;
142 QList<LegendWidthStruct *> legendWidthList;
142 QList<LegendWidthStruct *> legendWidthList;
143 foreach (QLegendMarker *marker, m_legend->d_ptr->markers()) {
143 foreach (QLegendMarker *marker, m_legend->d_ptr->markers()) {
144 LegendMarkerItem *item = marker->d_ptr->item();
144 LegendMarkerItem *item = marker->d_ptr->item();
145 if (item->isVisible()) {
145 if (item->isVisible()) {
146 QSizeF dummySize;
146 QSizeF dummySize;
147 qreal itemWidth = item->sizeHint(Qt::PreferredSize, dummySize).width();
147 qreal itemWidth = item->sizeHint(Qt::PreferredSize, dummySize).width();
148 LegendWidthStruct *structItem = new LegendWidthStruct;
148 LegendWidthStruct *structItem = new LegendWidthStruct;
149 structItem->item = item;
149 structItem->item = item;
150 structItem->width = itemWidth;
150 structItem->width = itemWidth;
151 legendWidthList.append(structItem);
151 legendWidthList.append(structItem);
152 markerItemsWidth += itemWidth;
152 markerItemsWidth += itemWidth;
153 itemMargins += marker->d_ptr->item()->m_margin;
153 itemMargins += marker->d_ptr->item()->m_margin;
154 }
154 }
155 }
155 }
156 qSort(legendWidthList.begin(), legendWidthList.end(), widthLongerThan);
156 qSort(legendWidthList.begin(), legendWidthList.end(), widthLongerThan);
157
157
158 // If the items would occupy more space than is available, start truncating them
158 // If the items would occupy more space than is available, start truncating them
159 // from the longest one.
159 // from the longest one.
160 qreal availableGeometry = geometry.width() - right - left * 2 - itemMargins;
160 qreal availableGeometry = geometry.width() - right - left * 2 - itemMargins;
161 if (markerItemsWidth >= availableGeometry && legendWidthList.count() > 0) {
161 if (markerItemsWidth >= availableGeometry && legendWidthList.count() > 0) {
162 bool truncated(false);
162 bool truncated(false);
163 int count = legendWidthList.count();
163 int count = legendWidthList.count();
164 for (int i = 1; i < count; i++) {
164 for (int i = 1; i < count; i++) {
165 int truncateIndex = i - 1;
165 int truncateIndex = i - 1;
166
166
167 while (legendWidthList.at(truncateIndex)->width >= legendWidthList.at(i)->width
167 while (legendWidthList.at(truncateIndex)->width >= legendWidthList.at(i)->width
168 && !truncated) {
168 && !truncated) {
169 legendWidthList.at(truncateIndex)->width--;
169 legendWidthList.at(truncateIndex)->width--;
170 markerItemsWidth--;
170 markerItemsWidth--;
171 if (i > 1) {
171 if (i > 1) {
172 // Truncate the items that are before the truncated one in the list.
172 // Truncate the items that are before the truncated one in the list.
173 for (int j = truncateIndex - 1; j >= 0; j--) {
173 for (int j = truncateIndex - 1; j >= 0; j--) {
174 if (legendWidthList.at(truncateIndex)->width
174 if (legendWidthList.at(truncateIndex)->width
175 < legendWidthList.at(j)->width) {
175 < legendWidthList.at(j)->width) {
176 legendWidthList.at(j)->width--;
176 legendWidthList.at(j)->width--;
177 markerItemsWidth--;
177 markerItemsWidth--;
178 }
178 }
179 }
179 }
180 }
180 }
181 if (markerItemsWidth < availableGeometry)
181 if (markerItemsWidth < availableGeometry)
182 truncated = true;
182 truncated = true;
183 }
183 }
184 // Truncate the last item if needed.
184 // Truncate the last item if needed.
185 if (i == count - 1) {
185 if (i == count - 1) {
186 if (legendWidthList.at(count - 1)->width
186 if (legendWidthList.at(count - 1)->width
187 > legendWidthList.at(truncateIndex)->width) {
187 > legendWidthList.at(truncateIndex)->width) {
188 legendWidthList.at(count - 1)->width--;
188 legendWidthList.at(count - 1)->width--;
189 markerItemsWidth--;
189 markerItemsWidth--;
190 }
190 }
191 }
191 }
192
192
193 if (truncated)
193 if (truncated)
194 break;
194 break;
195 }
195 }
196 // Items are of same width and all of them need to be truncated
196 // Items are of same width and all of them need to be truncated
197 // or there is just one item that is truncated.
197 // or there is just one item that is truncated.
198 while (markerItemsWidth >= availableGeometry) {
198 while (markerItemsWidth >= availableGeometry) {
199 for (int i = 0; i < count; i++) {
199 for (int i = 0; i < count; i++) {
200 legendWidthList.at(i)->width--;
200 legendWidthList.at(i)->width--;
201 markerItemsWidth--;
201 markerItemsWidth--;
202 }
202 }
203 }
203 }
204 }
204 }
205
205
206 QPointF point(0,0);
206 QPointF point(0,0);
207 foreach (QLegendMarker *marker, m_legend->d_ptr->markers()) {
207
208 int markerCount = m_legend->d_ptr->markers().count();
209 for (int i = 0; i < markerCount; i++) {
210 QLegendMarker *marker;
211 if (m_legend->d_ptr->m_reverseMarkers)
212 marker = m_legend->d_ptr->markers().at(markerCount - 1 - i);
213 else
214 marker = m_legend->d_ptr->markers().at(i);
208 LegendMarkerItem *item = marker->d_ptr->item();
215 LegendMarkerItem *item = marker->d_ptr->item();
209 if (item->isVisible()) {
216 if (item->isVisible()) {
210 QRectF itemRect = geometry;
217 QRectF itemRect = geometry;
211 qreal availableWidth = 0;
218 qreal availableWidth = 0;
212 for (int i = 0; i < legendWidthList.size(); ++i) {
219 for (int i = 0; i < legendWidthList.size(); ++i) {
213 if (legendWidthList.at(i)->item == item) {
220 if (legendWidthList.at(i)->item == item) {
214 availableWidth = legendWidthList.at(i)->width;
221 availableWidth = legendWidthList.at(i)->width;
215 break;
222 break;
216 }
223 }
217 }
224 }
218 itemRect.setWidth(availableWidth);
225 itemRect.setWidth(availableWidth);
219 item->setGeometry(itemRect);
226 item->setGeometry(itemRect);
220 item->setPos(point.x(),geometry.height()/2 - item->boundingRect().height()/2);
227 item->setPos(point.x(),geometry.height()/2 - item->boundingRect().height()/2);
221 const QRectF &rect = item->boundingRect();
228 const QRectF &rect = item->boundingRect();
222 size = size.expandedTo(rect.size());
229 size = size.expandedTo(rect.size());
223 qreal w = rect.width();
230 qreal w = rect.width();
224 m_width = m_width + w - item->m_margin;
231 m_width = m_width + w - item->m_margin;
225 point.setX(point.x() + w);
232 point.setX(point.x() + w);
226 }
233 }
227 }
234 }
228 // Delete structs from the container
235 // Delete structs from the container
229 qDeleteAll(legendWidthList);
236 qDeleteAll(legendWidthList);
230
237
231 if (m_width < geometry.width())
238 if (m_width < geometry.width())
232 m_legend->d_ptr->items()->setPos(geometry.width() / 2 - m_width / 2, geometry.top());
239 m_legend->d_ptr->items()->setPos(geometry.width() / 2 - m_width / 2, geometry.top());
233 else
240 else
234 m_legend->d_ptr->items()->setPos(geometry.topLeft());
241 m_legend->d_ptr->items()->setPos(geometry.topLeft());
235 m_height = size.height();
242 m_height = size.height();
236 }
243 }
237 break;
244 break;
238 case Qt::AlignLeft:
245 case Qt::AlignLeft:
239 case Qt::AlignRight: {
246 case Qt::AlignRight: {
240 QPointF point(0,0);
247 QPointF point(0,0);
241 foreach (QLegendMarker *marker, m_legend->d_ptr->markers()) {
248 int markerCount = m_legend->d_ptr->markers().count();
249 for (int i = 0; i < markerCount; i++) {
250 QLegendMarker *marker;
251 if (m_legend->d_ptr->m_reverseMarkers)
252 marker = m_legend->d_ptr->markers().at(markerCount - 1 - i);
253 else
254 marker = m_legend->d_ptr->markers().at(i);
242 LegendMarkerItem *item = marker->d_ptr->item();
255 LegendMarkerItem *item = marker->d_ptr->item();
243 if (item->isVisible()) {
256 if (item->isVisible()) {
244 item->setGeometry(geometry);
257 item->setGeometry(geometry);
245 item->setPos(point);
258 item->setPos(point);
246 const QRectF &rect = item->boundingRect();
259 const QRectF &rect = item->boundingRect();
247 qreal h = rect.height();
260 qreal h = rect.height();
248 size = size.expandedTo(rect.size());
261 size = size.expandedTo(rect.size());
249 m_height+=h;
262 m_height+=h;
250 point.setY(point.y() + h);
263 point.setY(point.y() + h);
251 }
264 }
252 }
265 }
253
266
254 if (m_height < geometry.height())
267 if (m_height < geometry.height())
255 m_legend->d_ptr->items()->setPos(geometry.left(), geometry.height() / 2 - m_height / 2);
268 m_legend->d_ptr->items()->setPos(geometry.left(), geometry.height() / 2 - m_height / 2);
256 else
269 else
257 m_legend->d_ptr->items()->setPos(geometry.topLeft());
270 m_legend->d_ptr->items()->setPos(geometry.topLeft());
258 m_width = size.width();
271 m_width = size.width();
259 break;
272 break;
260 }
273 }
261 }
274 }
262
275
263 m_minOffsetX = -left;
276 m_minOffsetX = -left;
264 m_minOffsetY = - top;
277 m_minOffsetY = - top;
265 m_maxOffsetX = m_width - geometry.width() - right;
278 m_maxOffsetX = m_width - geometry.width() - right;
266 m_maxOffsetY = m_height - geometry.height() - bottom;
279 m_maxOffsetY = m_height - geometry.height() - bottom;
267
280
268 setOffset(oldOffsetX, oldOffsetY);
281 setOffset(oldOffsetX, oldOffsetY);
269 }
282 }
270
283
271 void LegendLayout::setDettachedGeometry(const QRectF &rect)
284 void LegendLayout::setDettachedGeometry(const QRectF &rect)
272 {
285 {
273 if (!rect.isValid())
286 if (!rect.isValid())
274 return;
287 return;
275
288
276 // Detached layout is different.
289 // Detached layout is different.
277 // In detached mode legend may have multiple rows and columns, so layout calculations
290 // In detached mode legend may have multiple rows and columns, so layout calculations
278 // differ a log from attached mode.
291 // differ a log from attached mode.
279 // Also the scrolling logic is bit different.
292 // Also the scrolling logic is bit different.
280
293
281 qreal oldOffsetX = m_offsetX;
294 qreal oldOffsetX = m_offsetX;
282 qreal oldOffsetY = m_offsetY;
295 qreal oldOffsetY = m_offsetY;
283 m_offsetX = 0;
296 m_offsetX = 0;
284 m_offsetY = 0;
297 m_offsetY = 0;
285
298
286 qreal left, top, right, bottom;
299 qreal left, top, right, bottom;
287 getContentsMargins(&left, &top, &right, &bottom);
300 getContentsMargins(&left, &top, &right, &bottom);
288 QRectF geometry = rect.adjusted(left, top, -right, -bottom);
301 QRectF geometry = rect.adjusted(left, top, -right, -bottom);
289
302
290 QSizeF size(0, 0);
303 QSizeF size(0, 0);
291
304
292 QList<QLegendMarker *> markers = m_legend->d_ptr->markers();
305 QList<QLegendMarker *> markers = m_legend->d_ptr->markers();
293
306
294 if (markers.isEmpty())
307 if (markers.isEmpty())
295 return;
308 return;
296
309
297 switch (m_legend->alignment()) {
310 switch (m_legend->alignment()) {
298 case Qt::AlignTop: {
311 case Qt::AlignTop: {
299 QPointF point(0, 0);
312 QPointF point(0, 0);
300 m_width = 0;
313 m_width = 0;
301 m_height = 0;
314 m_height = 0;
302 for (int i = 0; i < markers.count(); i++) {
315 for (int i = 0; i < markers.count(); i++) {
303 LegendMarkerItem *item = markers.at(i)->d_ptr->item();
316 LegendMarkerItem *item = markers.at(i)->d_ptr->item();
304 if (item->isVisible()) {
317 if (item->isVisible()) {
305 item->setGeometry(geometry);
318 item->setGeometry(geometry);
306 item->setPos(point.x(),point.y());
319 item->setPos(point.x(),point.y());
307 const QRectF &boundingRect = item->boundingRect();
320 const QRectF &boundingRect = item->boundingRect();
308 qreal w = boundingRect.width();
321 qreal w = boundingRect.width();
309 qreal h = boundingRect.height();
322 qreal h = boundingRect.height();
310 m_width = qMax(m_width,w);
323 m_width = qMax(m_width,w);
311 m_height = qMax(m_height,h);
324 m_height = qMax(m_height,h);
312 point.setX(point.x() + w);
325 point.setX(point.x() + w);
313 if (point.x() + w > geometry.left() + geometry.width() - right) {
326 if (point.x() + w > geometry.left() + geometry.width() - right) {
314 // Next item would go off rect.
327 // Next item would go off rect.
315 point.setX(0);
328 point.setX(0);
316 point.setY(point.y() + h);
329 point.setY(point.y() + h);
317 if (i+1 < markers.count()) {
330 if (i+1 < markers.count()) {
318 m_height += h;
331 m_height += h;
319 }
332 }
320 }
333 }
321 }
334 }
322 }
335 }
323 m_legend->d_ptr->items()->setPos(geometry.topLeft());
336 m_legend->d_ptr->items()->setPos(geometry.topLeft());
324
337
325 m_minOffsetX = -left;
338 m_minOffsetX = -left;
326 m_minOffsetY = -top;
339 m_minOffsetY = -top;
327 m_maxOffsetX = m_width - geometry.width() - right;
340 m_maxOffsetX = m_width - geometry.width() - right;
328 m_maxOffsetY = m_height - geometry.height() - bottom;
341 m_maxOffsetY = m_height - geometry.height() - bottom;
329 }
342 }
330 break;
343 break;
331 case Qt::AlignBottom: {
344 case Qt::AlignBottom: {
332 QPointF point(0, geometry.height());
345 QPointF point(0, geometry.height());
333 m_width = 0;
346 m_width = 0;
334 m_height = 0;
347 m_height = 0;
335 for (int i = 0; i < markers.count(); i++) {
348 for (int i = 0; i < markers.count(); i++) {
336 LegendMarkerItem *item = markers.at(i)->d_ptr->item();
349 LegendMarkerItem *item = markers.at(i)->d_ptr->item();
337 if (item->isVisible()) {
350 if (item->isVisible()) {
338 item->setGeometry(geometry);
351 item->setGeometry(geometry);
339 const QRectF &boundingRect = item->boundingRect();
352 const QRectF &boundingRect = item->boundingRect();
340 qreal w = boundingRect.width();
353 qreal w = boundingRect.width();
341 qreal h = boundingRect.height();
354 qreal h = boundingRect.height();
342 m_width = qMax(m_width,w);
355 m_width = qMax(m_width,w);
343 m_height = qMax(m_height,h);
356 m_height = qMax(m_height,h);
344 item->setPos(point.x(),point.y() - h);
357 item->setPos(point.x(),point.y() - h);
345 point.setX(point.x() + w);
358 point.setX(point.x() + w);
346 if (point.x() + w > geometry.left() + geometry.width() - right) {
359 if (point.x() + w > geometry.left() + geometry.width() - right) {
347 // Next item would go off rect.
360 // Next item would go off rect.
348 point.setX(0);
361 point.setX(0);
349 point.setY(point.y() - h);
362 point.setY(point.y() - h);
350 if (i+1 < markers.count()) {
363 if (i+1 < markers.count()) {
351 m_height += h;
364 m_height += h;
352 }
365 }
353 }
366 }
354 }
367 }
355 }
368 }
356 m_legend->d_ptr->items()->setPos(geometry.topLeft());
369 m_legend->d_ptr->items()->setPos(geometry.topLeft());
357
370
358 m_minOffsetX = -left;
371 m_minOffsetX = -left;
359 m_minOffsetY = -m_height + geometry.height() - top;
372 m_minOffsetY = -m_height + geometry.height() - top;
360 m_maxOffsetX = m_width - geometry.width() - right;
373 m_maxOffsetX = m_width - geometry.width() - right;
361 m_maxOffsetY = -bottom;
374 m_maxOffsetY = -bottom;
362 }
375 }
363 break;
376 break;
364 case Qt::AlignLeft: {
377 case Qt::AlignLeft: {
365 QPointF point(0, 0);
378 QPointF point(0, 0);
366 m_width = 0;
379 m_width = 0;
367 m_height = 0;
380 m_height = 0;
368 qreal maxWidth = 0;
381 qreal maxWidth = 0;
369 for (int i = 0; i < markers.count(); i++) {
382 for (int i = 0; i < markers.count(); i++) {
370 LegendMarkerItem *item = markers.at(i)->d_ptr->item();
383 LegendMarkerItem *item = markers.at(i)->d_ptr->item();
371 if (item->isVisible()) {
384 if (item->isVisible()) {
372 item->setGeometry(geometry);
385 item->setGeometry(geometry);
373 const QRectF &boundingRect = item->boundingRect();
386 const QRectF &boundingRect = item->boundingRect();
374 qreal w = boundingRect.width();
387 qreal w = boundingRect.width();
375 qreal h = boundingRect.height();
388 qreal h = boundingRect.height();
376 m_height = qMax(m_height,h);
389 m_height = qMax(m_height,h);
377 maxWidth = qMax(maxWidth,w);
390 maxWidth = qMax(maxWidth,w);
378 item->setPos(point.x(),point.y());
391 item->setPos(point.x(),point.y());
379 point.setY(point.y() + h);
392 point.setY(point.y() + h);
380 if (point.y() + h > geometry.bottom() - bottom) {
393 if (point.y() + h > geometry.bottom() - bottom) {
381 // Next item would go off rect.
394 // Next item would go off rect.
382 point.setX(point.x() + maxWidth);
395 point.setX(point.x() + maxWidth);
383 point.setY(0);
396 point.setY(0);
384 if (i+1 < markers.count()) {
397 if (i+1 < markers.count()) {
385 m_width += maxWidth;
398 m_width += maxWidth;
386 maxWidth = 0;
399 maxWidth = 0;
387 }
400 }
388 }
401 }
389 }
402 }
390 }
403 }
391 m_width += maxWidth;
404 m_width += maxWidth;
392 m_legend->d_ptr->items()->setPos(geometry.topLeft());
405 m_legend->d_ptr->items()->setPos(geometry.topLeft());
393
406
394 m_minOffsetX = -left;
407 m_minOffsetX = -left;
395 m_minOffsetY = -top;
408 m_minOffsetY = -top;
396 m_maxOffsetX = m_width - geometry.width() - right;
409 m_maxOffsetX = m_width - geometry.width() - right;
397 m_maxOffsetY = m_height - geometry.height() - bottom;
410 m_maxOffsetY = m_height - geometry.height() - bottom;
398 }
411 }
399 break;
412 break;
400 case Qt::AlignRight: {
413 case Qt::AlignRight: {
401 QPointF point(geometry.width(), 0);
414 QPointF point(geometry.width(), 0);
402 m_width = 0;
415 m_width = 0;
403 m_height = 0;
416 m_height = 0;
404 qreal maxWidth = 0;
417 qreal maxWidth = 0;
405 for (int i = 0; i < markers.count(); i++) {
418 for (int i = 0; i < markers.count(); i++) {
406 LegendMarkerItem *item = markers.at(i)->d_ptr->item();
419 LegendMarkerItem *item = markers.at(i)->d_ptr->item();
407 if (item->isVisible()) {
420 if (item->isVisible()) {
408 item->setGeometry(geometry);
421 item->setGeometry(geometry);
409 const QRectF &boundingRect = item->boundingRect();
422 const QRectF &boundingRect = item->boundingRect();
410 qreal w = boundingRect.width();
423 qreal w = boundingRect.width();
411 qreal h = boundingRect.height();
424 qreal h = boundingRect.height();
412 m_height = qMax(m_height,h);
425 m_height = qMax(m_height,h);
413 maxWidth = qMax(maxWidth,w);
426 maxWidth = qMax(maxWidth,w);
414 item->setPos(point.x() - w,point.y());
427 item->setPos(point.x() - w,point.y());
415 point.setY(point.y() + h);
428 point.setY(point.y() + h);
416 if (point.y() + h > geometry.bottom()-bottom) {
429 if (point.y() + h > geometry.bottom()-bottom) {
417 // Next item would go off rect.
430 // Next item would go off rect.
418 point.setX(point.x() - maxWidth);
431 point.setX(point.x() - maxWidth);
419 point.setY(0);
432 point.setY(0);
420 if (i+1 < markers.count()) {
433 if (i+1 < markers.count()) {
421 m_width += maxWidth;
434 m_width += maxWidth;
422 maxWidth = 0;
435 maxWidth = 0;
423 }
436 }
424 }
437 }
425 }
438 }
426 }
439 }
427 m_width += maxWidth;
440 m_width += maxWidth;
428 m_legend->d_ptr->items()->setPos(geometry.topLeft());
441 m_legend->d_ptr->items()->setPos(geometry.topLeft());
429
442
430 m_minOffsetX = - m_width + geometry.width() - left;
443 m_minOffsetX = - m_width + geometry.width() - left;
431 m_minOffsetY = -top;
444 m_minOffsetY = -top;
432 m_maxOffsetX = - right;
445 m_maxOffsetX = - right;
433 m_maxOffsetY = m_height - geometry.height() - bottom;
446 m_maxOffsetY = m_height - geometry.height() - bottom;
434 }
447 }
435 break;
448 break;
436 default:
449 default:
437 break;
450 break;
438 }
451 }
439
452
440 setOffset(oldOffsetX, oldOffsetY);
453 setOffset(oldOffsetX, oldOffsetY);
441 }
454 }
442
455
443 QSizeF LegendLayout::sizeHint(Qt::SizeHint which, const QSizeF &constraint) const
456 QSizeF LegendLayout::sizeHint(Qt::SizeHint which, const QSizeF &constraint) const
444 {
457 {
445 QSizeF size(0, 0);
458 QSizeF size(0, 0);
446 qreal left, top, right, bottom;
459 qreal left, top, right, bottom;
447 getContentsMargins(&left, &top, &right, &bottom);
460 getContentsMargins(&left, &top, &right, &bottom);
448
461
449 if(constraint.isValid()) {
462 if(constraint.isValid()) {
450 foreach(QLegendMarker *marker, m_legend->d_ptr->markers()) {
463 foreach(QLegendMarker *marker, m_legend->d_ptr->markers()) {
451 LegendMarkerItem *item = marker->d_ptr->item();
464 LegendMarkerItem *item = marker->d_ptr->item();
452 size = size.expandedTo(item->effectiveSizeHint(which));
465 size = size.expandedTo(item->effectiveSizeHint(which));
453 }
466 }
454 size = size.boundedTo(constraint);
467 size = size.boundedTo(constraint);
455 }
468 }
456 else if (constraint.width() >= 0) {
469 else if (constraint.width() >= 0) {
457 qreal width = 0;
470 qreal width = 0;
458 qreal height = 0;
471 qreal height = 0;
459 foreach(QLegendMarker *marker, m_legend->d_ptr->markers()) {
472 foreach(QLegendMarker *marker, m_legend->d_ptr->markers()) {
460 LegendMarkerItem *item = marker->d_ptr->item();
473 LegendMarkerItem *item = marker->d_ptr->item();
461 width+=item->effectiveSizeHint(which).width();
474 width+=item->effectiveSizeHint(which).width();
462 height=qMax(height,item->effectiveSizeHint(which).height());
475 height=qMax(height,item->effectiveSizeHint(which).height());
463 }
476 }
464
477
465 size = QSizeF(qMin(constraint.width(),width), height);
478 size = QSizeF(qMin(constraint.width(),width), height);
466 }
479 }
467 else if (constraint.height() >= 0) {
480 else if (constraint.height() >= 0) {
468 qreal width = 0;
481 qreal width = 0;
469 qreal height = 0;
482 qreal height = 0;
470 foreach(QLegendMarker *marker, m_legend->d_ptr->markers()) {
483 foreach(QLegendMarker *marker, m_legend->d_ptr->markers()) {
471 LegendMarkerItem *item = marker->d_ptr->item();
484 LegendMarkerItem *item = marker->d_ptr->item();
472 width=qMax(width,item->effectiveSizeHint(which).width());
485 width=qMax(width,item->effectiveSizeHint(which).width());
473 height+=height,item->effectiveSizeHint(which).height();
486 height+=height,item->effectiveSizeHint(which).height();
474 }
487 }
475 size = QSizeF(width,qMin(constraint.height(),height));
488 size = QSizeF(width,qMin(constraint.height(),height));
476 }
489 }
477 else {
490 else {
478 foreach(QLegendMarker *marker, m_legend->d_ptr->markers()) {
491 foreach(QLegendMarker *marker, m_legend->d_ptr->markers()) {
479 LegendMarkerItem *item = marker->d_ptr->item();
492 LegendMarkerItem *item = marker->d_ptr->item();
480 size = size.expandedTo(item->effectiveSizeHint(which));
493 size = size.expandedTo(item->effectiveSizeHint(which));
481 }
494 }
482 }
495 }
483 size += QSize(left + right, top + bottom);
496 size += QSize(left + right, top + bottom);
484 return size;
497 return size;
485 }
498 }
486
499
487 bool LegendLayout::widthLongerThan(const LegendWidthStruct *item1,
500 bool LegendLayout::widthLongerThan(const LegendWidthStruct *item1,
488 const LegendWidthStruct *item2)
501 const LegendWidthStruct *item2)
489 {
502 {
490 return item1->width > item2->width;
503 return item1->width > item2->width;
491 }
504 }
492
505
493 QTCOMMERCIALCHART_END_NAMESPACE
506 QTCOMMERCIALCHART_END_NAMESPACE
@@ -1,594 +1,618
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2013 Digia Plc
3 ** Copyright (C) 2013 Digia Plc
4 ** All rights reserved.
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
6 **
7 ** This file is part of the Qt Enterprise Charts Add-on.
7 ** This file is part of the Qt Enterprise Charts Add-on.
8 **
8 **
9 ** $QT_BEGIN_LICENSE$
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
11 ** accordance with the Qt Enterprise License Agreement provided with the
11 ** accordance with the Qt Enterprise License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
13 ** a written agreement between you and Digia.
14 **
14 **
15 ** If you have questions regarding the use of this file, please use
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
17 ** $QT_END_LICENSE$
18 **
18 **
19 ****************************************************************************/
19 ****************************************************************************/
20
20
21 #include "qlegend.h"
21 #include "qlegend.h"
22 #include "qlegend_p.h"
22 #include "qlegend_p.h"
23 #include "qabstractseries.h"
23 #include "qabstractseries.h"
24 #include "qabstractseries_p.h"
24 #include "qabstractseries_p.h"
25 #include "qchart_p.h"
25 #include "qchart_p.h"
26 #include "legendlayout_p.h"
26 #include "legendlayout_p.h"
27 #include "chartpresenter_p.h"
27 #include "chartpresenter_p.h"
28 #include "abstractchartlayout_p.h"
28 #include "abstractchartlayout_p.h"
29 #include "qlegendmarker.h"
29 #include "qlegendmarker.h"
30 #include "qlegendmarker_p.h"
30 #include "qlegendmarker_p.h"
31 #include "legendmarkeritem_p.h"
31 #include "legendmarkeritem_p.h"
32 #include "chartdataset_p.h"
32 #include "chartdataset_p.h"
33 #include <QPainter>
33 #include <QPainter>
34 #include <QPen>
34 #include <QPen>
35 #include <QGraphicsItemGroup>
35 #include <QGraphicsItemGroup>
36
36
37 QTCOMMERCIALCHART_BEGIN_NAMESPACE
37 QTCOMMERCIALCHART_BEGIN_NAMESPACE
38
38
39 /*!
39 /*!
40 \class QLegend
40 \class QLegend
41 \inmodule Qt Charts
41 \inmodule Qt Charts
42 \brief Legend object.
42 \brief Legend object.
43 \mainclass
43 \mainclass
44
44
45 QLegend is a graphical object for displaying the legend of the chart. Legend state is updated by QChart, when
45 QLegend is a graphical object for displaying the legend of the chart. Legend state is updated by QChart, when
46 series have been changed. By default, legend is drawn by QChart, but user can set a new parent to legend and
46 series have been changed. By default, legend is drawn by QChart, but user can set a new parent to legend and
47 handle the drawing manually.
47 handle the drawing manually.
48 User isn't supposed to create or delete legend objects, but can reference it via QChart class.
48 User isn't supposed to create or delete legend objects, but can reference it via QChart class.
49
49
50 \image examples_percentbarchart_legend.png
50 \image examples_percentbarchart_legend.png
51
51
52 \sa QChart
52 \sa QChart
53 */
53 */
54 #ifdef QDOC_QT5
54 #ifdef QDOC_QT5
55 /*!
55 /*!
56 \qmltype Legend
56 \qmltype Legend
57 \instantiates QLegend
57 \instantiates QLegend
58 \inqmlmodule QtCommercial.Chart
58 \inqmlmodule QtCommercial.Chart
59
59
60 \include doc/src/legend.qdocinc
60 \include doc/src/legend.qdocinc
61 */
61 */
62 #else
62 #else
63 /*!
63 /*!
64 \qmlclass Legend QLegend
64 \qmlclass Legend QLegend
65
65
66 \include ../doc/src/legend.qdocinc
66 \include ../doc/src/legend.qdocinc
67 */
67 */
68 #endif
68 #endif
69
69
70 /*!
70 /*!
71 \property QLegend::alignment
71 \property QLegend::alignment
72 \brief The alignment of the legend.
72 \brief The alignment of the legend.
73
73
74 Legend paints on the defined position in the chart. The following alignments are supported:
74 Legend paints on the defined position in the chart. The following alignments are supported:
75 Qt::AlignTop, Qt::AlignBottom, Qt::AlignLeft, Qt::AlignRight. If you set more than one flag the result is undefined.
75 Qt::AlignTop, Qt::AlignBottom, Qt::AlignLeft, Qt::AlignRight. If you set more than one flag the result is undefined.
76 */
76 */
77 /*!
77 /*!
78 \qmlproperty Qt.Alignment Legend::alignment
78 \qmlproperty Qt.Alignment Legend::alignment
79 \brief The alignment of the legend.
79 \brief The alignment of the legend.
80
80
81 Legend paints on the defined position in the chart. The following alignments are supported:
81 Legend paints on the defined position in the chart. The following alignments are supported:
82 Qt.AlignTop, Qt.AlignBottom, Qt.AlignLeft, Qt.AlignRight. If you set more than one flag the result is undefined.
82 Qt.AlignTop, Qt.AlignBottom, Qt.AlignLeft, Qt.AlignRight. If you set more than one flag the result is undefined.
83 */
83 */
84
84
85 /*!
85 /*!
86 \property QLegend::backgroundVisible
86 \property QLegend::backgroundVisible
87 Whether the legend background is visible or not.
87 Whether the legend background is visible or not.
88 */
88 */
89 /*!
89 /*!
90 \qmlproperty bool Legend::backgroundVisible
90 \qmlproperty bool Legend::backgroundVisible
91 Whether the legend background is visible or not.
91 Whether the legend background is visible or not.
92 */
92 */
93
93
94 /*!
94 /*!
95 \property QLegend::color
95 \property QLegend::color
96 The color of the legend, i.e. the background (brush) color. Note that if you change the color
96 The color of the legend, i.e. the background (brush) color. Note that if you change the color
97 of the legend, the style of the legend brush is set to Qt::SolidPattern.
97 of the legend, the style of the legend brush is set to Qt::SolidPattern.
98 */
98 */
99 /*!
99 /*!
100 \qmlproperty color Legend::color
100 \qmlproperty color Legend::color
101 The color of the legend, i.e. the background (brush) color.
101 The color of the legend, i.e. the background (brush) color.
102 */
102 */
103
103
104 /*!
104 /*!
105 \property QLegend::borderColor
105 \property QLegend::borderColor
106 The border color of the legend, i.e. the line color.
106 The border color of the legend, i.e. the line color.
107 */
107 */
108 /*!
108 /*!
109 \qmlproperty color Legend::borderColor
109 \qmlproperty color Legend::borderColor
110 The border color of the legend, i.e. the line color.
110 The border color of the legend, i.e. the line color.
111 */
111 */
112
112
113 /*!
113 /*!
114 \property QLegend::font
114 \property QLegend::font
115 The font of markers used by legend
115 The font of markers used by legend
116 */
116 */
117 /*!
117 /*!
118 \qmlproperty Font Legend::font
118 \qmlproperty Font Legend::font
119 The font of markers used by legend
119 The font of markers used by legend
120 */
120 */
121
121
122 /*!
122 /*!
123 \property QLegend::labelColor
123 \property QLegend::labelColor
124 The color of brush used to draw labels.
124 The color of brush used to draw labels.
125 */
125 */
126 /*!
126 /*!
127 \qmlproperty color QLegend::labelColor
127 \qmlproperty color QLegend::labelColor
128 The color of brush used to draw labels.
128 The color of brush used to draw labels.
129 */
129 */
130
130
131 /*!
131 /*!
132 \property QLegend::reverseMarkers
133 Whether reverse order is used for the markers in legend or not. False by default.
134 */
135 /*!
136 \qmlproperty bool Legend::reverseMarkers
137 Whether reverse order is used for the markers in legend or not. False by default.
138 */
139
140 /*!
132 \fn void QLegend::backgroundVisibleChanged(bool)
141 \fn void QLegend::backgroundVisibleChanged(bool)
133 The visibility of the legend background changed to \a visible.
142 The visibility of the legend background changed to \a visible.
134 */
143 */
135
144
136 /*!
145 /*!
137 \fn void QLegend::colorChanged(QColor)
146 \fn void QLegend::colorChanged(QColor)
138 The color of the legend background changed to \a color.
147 The color of the legend background changed to \a color.
139 */
148 */
140
149
141 /*!
150 /*!
142 \fn void QLegend::borderColorChanged(QColor)
151 \fn void QLegend::borderColorChanged(QColor)
143 The border color of the legend background changed to \a color.
152 The border color of the legend background changed to \a color.
144 */
153 */
145
154
146 /*!
155 /*!
147 \fn void QLegend::fontChanged(QFont)
156 \fn void QLegend::fontChanged(QFont)
148 The font of markers of the legend changed to \a font.
157 The font of markers of the legend changed to \a font.
149 */
158 */
150
159
151 /*!
160 /*!
152 \fn void QLegend::labelColorChanged(QColor color)
161 \fn void QLegend::labelColorChanged(QColor color)
153 This signal is emitted when the color of brush used to draw labels has changed to \a color.
162 This signal is emitted when the color of brush used to draw labels has changed to \a color.
154 */
163 */
155
164
156 QLegend::QLegend(QChart *chart): QGraphicsWidget(chart),
165 QLegend::QLegend(QChart *chart): QGraphicsWidget(chart),
157 d_ptr(new QLegendPrivate(chart->d_ptr->m_presenter, chart, this))
166 d_ptr(new QLegendPrivate(chart->d_ptr->m_presenter, chart, this))
158 {
167 {
159 setZValue(ChartPresenter::LegendZValue);
168 setZValue(ChartPresenter::LegendZValue);
160 setFlags(QGraphicsItem::ItemClipsChildrenToShape);
169 setFlags(QGraphicsItem::ItemClipsChildrenToShape);
161 QObject::connect(chart->d_ptr->m_dataset, SIGNAL(seriesAdded(QAbstractSeries*)), d_ptr.data(), SLOT(handleSeriesAdded(QAbstractSeries*)));
170 QObject::connect(chart->d_ptr->m_dataset, SIGNAL(seriesAdded(QAbstractSeries*)), d_ptr.data(), SLOT(handleSeriesAdded(QAbstractSeries*)));
162 QObject::connect(chart->d_ptr->m_dataset, SIGNAL(seriesRemoved(QAbstractSeries*)), d_ptr.data(), SLOT(handleSeriesRemoved(QAbstractSeries*)));
171 QObject::connect(chart->d_ptr->m_dataset, SIGNAL(seriesRemoved(QAbstractSeries*)), d_ptr.data(), SLOT(handleSeriesRemoved(QAbstractSeries*)));
163 setLayout(d_ptr->m_layout);
172 setLayout(d_ptr->m_layout);
164 }
173 }
165
174
166 /*!
175 /*!
167 Destroys the legend object. Legend is always owned by a QChart, so an application should never call this.
176 Destroys the legend object. Legend is always owned by a QChart, so an application should never call this.
168 */
177 */
169 QLegend::~QLegend()
178 QLegend::~QLegend()
170 {
179 {
171 }
180 }
172
181
173 /*!
182 /*!
174 \internal
183 \internal
175 */
184 */
176 void QLegend::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
185 void QLegend::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
177 {
186 {
178 Q_UNUSED(option)
187 Q_UNUSED(option)
179 Q_UNUSED(widget)
188 Q_UNUSED(widget)
180
189
181 if (!d_ptr->m_backgroundVisible)
190 if (!d_ptr->m_backgroundVisible)
182 return;
191 return;
183
192
184 painter->setOpacity(opacity());
193 painter->setOpacity(opacity());
185 painter->setPen(d_ptr->m_pen);
194 painter->setPen(d_ptr->m_pen);
186 painter->setBrush(d_ptr->m_brush);
195 painter->setBrush(d_ptr->m_brush);
187 painter->drawRoundRect(rect(), d_ptr->roundness(rect().width()), d_ptr->roundness(rect().height()));
196 painter->drawRoundRect(rect(), d_ptr->roundness(rect().width()), d_ptr->roundness(rect().height()));
188 }
197 }
189
198
190
199
191 /*!
200 /*!
192 Sets the \a brush of legend. Brush affects the background of legend.
201 Sets the \a brush of legend. Brush affects the background of legend.
193 */
202 */
194 void QLegend::setBrush(const QBrush &brush)
203 void QLegend::setBrush(const QBrush &brush)
195 {
204 {
196 if (d_ptr->m_brush != brush) {
205 if (d_ptr->m_brush != brush) {
197 d_ptr->m_brush = brush;
206 d_ptr->m_brush = brush;
198 update();
207 update();
199 emit colorChanged(brush.color());
208 emit colorChanged(brush.color());
200 }
209 }
201 }
210 }
202
211
203 /*!
212 /*!
204 Returns the brush used by legend.
213 Returns the brush used by legend.
205 */
214 */
206 QBrush QLegend::brush() const
215 QBrush QLegend::brush() const
207 {
216 {
208 return d_ptr->m_brush;
217 return d_ptr->m_brush;
209 }
218 }
210
219
211 void QLegend::setColor(QColor color)
220 void QLegend::setColor(QColor color)
212 {
221 {
213 QBrush b = d_ptr->m_brush;
222 QBrush b = d_ptr->m_brush;
214 if (b.style() != Qt::SolidPattern || b.color() != color) {
223 if (b.style() != Qt::SolidPattern || b.color() != color) {
215 b.setStyle(Qt::SolidPattern);
224 b.setStyle(Qt::SolidPattern);
216 b.setColor(color);
225 b.setColor(color);
217 setBrush(b);
226 setBrush(b);
218 }
227 }
219 }
228 }
220
229
221 QColor QLegend::color()
230 QColor QLegend::color()
222 {
231 {
223 return d_ptr->m_brush.color();
232 return d_ptr->m_brush.color();
224 }
233 }
225
234
226 /*!
235 /*!
227 Sets the \a pen of legend. Pen affects the legend borders.
236 Sets the \a pen of legend. Pen affects the legend borders.
228 */
237 */
229 void QLegend::setPen(const QPen &pen)
238 void QLegend::setPen(const QPen &pen)
230 {
239 {
231 if (d_ptr->m_pen != pen) {
240 if (d_ptr->m_pen != pen) {
232 d_ptr->m_pen = pen;
241 d_ptr->m_pen = pen;
233 update();
242 update();
234 emit borderColorChanged(pen.color());
243 emit borderColorChanged(pen.color());
235 }
244 }
236 }
245 }
237
246
238 /*!
247 /*!
239 Returns the pen used by legend
248 Returns the pen used by legend
240 */
249 */
241
250
242 QPen QLegend::pen() const
251 QPen QLegend::pen() const
243 {
252 {
244 return d_ptr->m_pen;
253 return d_ptr->m_pen;
245 }
254 }
246
255
247 void QLegend::setFont(const QFont &font)
256 void QLegend::setFont(const QFont &font)
248 {
257 {
249 if (d_ptr->m_font != font) {
258 if (d_ptr->m_font != font) {
250 // Hide items to avoid flickering
259 // Hide items to avoid flickering
251 d_ptr->items()->setVisible(false);
260 d_ptr->items()->setVisible(false);
252 d_ptr->m_font = font;
261 d_ptr->m_font = font;
253 foreach (QLegendMarker *marker, d_ptr->markers()) {
262 foreach (QLegendMarker *marker, d_ptr->markers()) {
254 marker->setFont(d_ptr->m_font);
263 marker->setFont(d_ptr->m_font);
255 }
264 }
256 layout()->invalidate();
265 layout()->invalidate();
257 emit fontChanged(font);
266 emit fontChanged(font);
258 }
267 }
259 }
268 }
260
269
261 QFont QLegend::font() const
270 QFont QLegend::font() const
262 {
271 {
263 return d_ptr->m_font;
272 return d_ptr->m_font;
264 }
273 }
265
274
266 void QLegend::setBorderColor(QColor color)
275 void QLegend::setBorderColor(QColor color)
267 {
276 {
268 QPen p = d_ptr->m_pen;
277 QPen p = d_ptr->m_pen;
269 if (p.color() != color) {
278 if (p.color() != color) {
270 p.setColor(color);
279 p.setColor(color);
271 setPen(p);
280 setPen(p);
272 }
281 }
273 }
282 }
274
283
275 QColor QLegend::borderColor()
284 QColor QLegend::borderColor()
276 {
285 {
277 return d_ptr->m_pen.color();
286 return d_ptr->m_pen.color();
278 }
287 }
279
288
280 /*!
289 /*!
281 Set brush used to draw labels to \a brush.
290 Set brush used to draw labels to \a brush.
282 */
291 */
283 void QLegend::setLabelBrush(const QBrush &brush)
292 void QLegend::setLabelBrush(const QBrush &brush)
284 {
293 {
285 if (d_ptr->m_labelBrush != brush) {
294 if (d_ptr->m_labelBrush != brush) {
286 d_ptr->m_labelBrush = brush;
295 d_ptr->m_labelBrush = brush;
287 foreach (QLegendMarker *marker, d_ptr->markers()) {
296 foreach (QLegendMarker *marker, d_ptr->markers()) {
288 marker->setLabelBrush(d_ptr->m_labelBrush);
297 marker->setLabelBrush(d_ptr->m_labelBrush);
289 // Note: The pen of the marker rectangle could be exposed in the public QLegend API
298 // Note: The pen of the marker rectangle could be exposed in the public QLegend API
290 // instead of mapping it from label brush color
299 // instead of mapping it from label brush color
291 marker->setPen(brush.color());
300 marker->setPen(brush.color());
292 }
301 }
293 emit labelColorChanged(brush.color());
302 emit labelColorChanged(brush.color());
294 }
303 }
295 }
304 }
296
305
297 /*!
306 /*!
298 Brush used to draw labels.
307 Brush used to draw labels.
299 */
308 */
300 QBrush QLegend::labelBrush() const
309 QBrush QLegend::labelBrush() const
301 {
310 {
302 return d_ptr->m_labelBrush;
311 return d_ptr->m_labelBrush;
303 }
312 }
304
313
305 void QLegend::setLabelColor(QColor color)
314 void QLegend::setLabelColor(QColor color)
306 {
315 {
307 QBrush b = d_ptr->m_labelBrush;
316 QBrush b = d_ptr->m_labelBrush;
308 if (b.style() != Qt::SolidPattern || b.color() != color) {
317 if (b.style() != Qt::SolidPattern || b.color() != color) {
309 b.setStyle(Qt::SolidPattern);
318 b.setStyle(Qt::SolidPattern);
310 b.setColor(color);
319 b.setColor(color);
311 setLabelBrush(b);
320 setLabelBrush(b);
312 }
321 }
313 }
322 }
314
323
315 QColor QLegend::labelColor() const
324 QColor QLegend::labelColor() const
316 {
325 {
317 return d_ptr->m_labelBrush.color();
326 return d_ptr->m_labelBrush.color();
318 }
327 }
319
328
320
329
321 void QLegend::setAlignment(Qt::Alignment alignment)
330 void QLegend::setAlignment(Qt::Alignment alignment)
322 {
331 {
323 if (d_ptr->m_alignment != alignment) {
332 if (d_ptr->m_alignment != alignment) {
324 d_ptr->m_alignment = alignment;
333 d_ptr->m_alignment = alignment;
325 layout()->invalidate();
334 layout()->invalidate();
326 }
335 }
327 }
336 }
328
337
329 Qt::Alignment QLegend::alignment() const
338 Qt::Alignment QLegend::alignment() const
330 {
339 {
331 return d_ptr->m_alignment;
340 return d_ptr->m_alignment;
332 }
341 }
333
342
334 /*!
343 /*!
335 Detaches the legend from chart. Chart won't change layout of the legend.
344 Detaches the legend from chart. Chart won't change layout of the legend.
336 */
345 */
337 void QLegend::detachFromChart()
346 void QLegend::detachFromChart()
338 {
347 {
339 d_ptr->m_attachedToChart = false;
348 d_ptr->m_attachedToChart = false;
340 // layout()->invalidate();
349 // layout()->invalidate();
341 d_ptr->m_chart->layout()->invalidate();
350 d_ptr->m_chart->layout()->invalidate();
342 setParent(0);
351 setParent(0);
343
352
344 }
353 }
345
354
346 /*!
355 /*!
347 Attaches the legend to chart. Chart may change layout of the legend.
356 Attaches the legend to chart. Chart may change layout of the legend.
348 */
357 */
349 void QLegend::attachToChart()
358 void QLegend::attachToChart()
350 {
359 {
351 d_ptr->m_attachedToChart = true;
360 d_ptr->m_attachedToChart = true;
352 // layout()->invalidate();
361 // layout()->invalidate();
353 d_ptr->m_chart->layout()->invalidate();
362 d_ptr->m_chart->layout()->invalidate();
354 setParent(d_ptr->m_chart);
363 setParent(d_ptr->m_chart);
355 }
364 }
356
365
357 /*!
366 /*!
358 Returns true, if legend is attached to chart.
367 Returns true, if legend is attached to chart.
359 */
368 */
360 bool QLegend::isAttachedToChart()
369 bool QLegend::isAttachedToChart()
361 {
370 {
362 return d_ptr->m_attachedToChart;
371 return d_ptr->m_attachedToChart;
363 }
372 }
364
373
365 /*!
374 /*!
366 Sets the visibility of legend background to \a visible
375 Sets the visibility of legend background to \a visible
367 */
376 */
368 void QLegend::setBackgroundVisible(bool visible)
377 void QLegend::setBackgroundVisible(bool visible)
369 {
378 {
370 if (d_ptr->m_backgroundVisible != visible) {
379 if (d_ptr->m_backgroundVisible != visible) {
371 d_ptr->m_backgroundVisible = visible;
380 d_ptr->m_backgroundVisible = visible;
372 update();
381 update();
373 emit backgroundVisibleChanged(visible);
382 emit backgroundVisibleChanged(visible);
374 }
383 }
375 }
384 }
376
385
377 /*!
386 /*!
378 Returns the visibility of legend background
387 Returns the visibility of legend background
379 */
388 */
380 bool QLegend::isBackgroundVisible() const
389 bool QLegend::isBackgroundVisible() const
381 {
390 {
382 return d_ptr->m_backgroundVisible;
391 return d_ptr->m_backgroundVisible;
383 }
392 }
384
393
385 /*!
394 /*!
386 Returns the list of markers in legend. The list can be filtered with \a series parameter.
395 Returns the list of markers in legend. The list can be filtered with \a series parameter.
387 If \a series is given, only markers related to that series are returned.
396 If \a series is given, only markers related to that series are returned.
388 */
397 */
389 QList<QLegendMarker*> QLegend::markers(QAbstractSeries *series) const
398 QList<QLegendMarker*> QLegend::markers(QAbstractSeries *series) const
390 {
399 {
391 return d_ptr->markers(series);
400 return d_ptr->markers(series);
392 }
401 }
393
402
403 bool QLegend::reverseMarkers()
404 {
405 return d_ptr->m_reverseMarkers;
406 }
407
408 void QLegend::setReverseMarkers(bool reverseMarkers)
409 {
410 if (d_ptr->m_reverseMarkers != reverseMarkers) {
411 d_ptr->m_reverseMarkers = reverseMarkers;
412 layout()->invalidate();
413 emit reverseMarkersChanged(reverseMarkers);
414 }
415 }
416
394 /*!
417 /*!
395 \internal \a event see QGraphicsWidget for details
418 \internal \a event see QGraphicsWidget for details
396 */
419 */
397 void QLegend::hideEvent(QHideEvent *event)
420 void QLegend::hideEvent(QHideEvent *event)
398 {
421 {
399 if (isAttachedToChart())
422 if (isAttachedToChart())
400 d_ptr->m_presenter->layout()->invalidate();
423 d_ptr->m_presenter->layout()->invalidate();
401 QGraphicsWidget::hideEvent(event);
424 QGraphicsWidget::hideEvent(event);
402 }
425 }
403 /*!
426 /*!
404 \internal \a event see QGraphicsWidget for details
427 \internal \a event see QGraphicsWidget for details
405 */
428 */
406 void QLegend::showEvent(QShowEvent *event)
429 void QLegend::showEvent(QShowEvent *event)
407 {
430 {
408 if (isAttachedToChart())
431 if (isAttachedToChart())
409 layout()->invalidate();
432 layout()->invalidate();
410 QGraphicsWidget::showEvent(event);
433 QGraphicsWidget::showEvent(event);
411 //layout activation will show the items
434 //layout activation will show the items
412 }
435 }
413
436
414 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
437 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
415
438
416 QLegendPrivate::QLegendPrivate(ChartPresenter *presenter, QChart *chart, QLegend *q)
439 QLegendPrivate::QLegendPrivate(ChartPresenter *presenter, QChart *chart, QLegend *q)
417 : q_ptr(q),
440 : q_ptr(q),
418 m_presenter(presenter),
441 m_presenter(presenter),
419 m_layout(new LegendLayout(q)),
442 m_layout(new LegendLayout(q)),
420 m_chart(chart),
443 m_chart(chart),
421 m_items(new QGraphicsItemGroup(q)),
444 m_items(new QGraphicsItemGroup(q)),
422 m_alignment(Qt::AlignTop),
445 m_alignment(Qt::AlignTop),
423 m_brush(QBrush()),
446 m_brush(QBrush()),
424 m_pen(QPen()),
447 m_pen(QPen()),
425 m_labelBrush(QBrush()),
448 m_labelBrush(QBrush()),
426 m_diameter(5),
449 m_diameter(5),
427 m_attachedToChart(true),
450 m_attachedToChart(true),
428 m_backgroundVisible(false)
451 m_backgroundVisible(false),
452 m_reverseMarkers(false)
429 {
453 {
430 m_items->setHandlesChildEvents(false);
454 m_items->setHandlesChildEvents(false);
431 }
455 }
432
456
433 QLegendPrivate::~QLegendPrivate()
457 QLegendPrivate::~QLegendPrivate()
434 {
458 {
435
459
436 }
460 }
437
461
438 void QLegendPrivate::setOffset(const QPointF &offset)
462 void QLegendPrivate::setOffset(const QPointF &offset)
439 {
463 {
440 m_layout->setOffset(offset.x(), offset.y());
464 m_layout->setOffset(offset.x(), offset.y());
441 }
465 }
442
466
443 QPointF QLegendPrivate::offset() const
467 QPointF QLegendPrivate::offset() const
444 {
468 {
445 return m_layout->offset();
469 return m_layout->offset();
446 }
470 }
447
471
448 int QLegendPrivate::roundness(qreal size)
472 int QLegendPrivate::roundness(qreal size)
449 {
473 {
450 return 100 * m_diameter / int(size);
474 return 100 * m_diameter / int(size);
451 }
475 }
452
476
453 QList<QLegendMarker*> QLegendPrivate::markers(QAbstractSeries *series)
477 QList<QLegendMarker*> QLegendPrivate::markers(QAbstractSeries *series)
454 {
478 {
455 // Return all markers
479 // Return all markers
456 if (!series) {
480 if (!series) {
457 return m_markers;
481 return m_markers;
458 }
482 }
459
483
460 // Create filtered list
484 // Create filtered list
461 QList<QLegendMarker *> markers;
485 QList<QLegendMarker *> markers;
462 foreach (QLegendMarker *marker, m_markers) {
486 foreach (QLegendMarker *marker, m_markers) {
463 if (marker->series() == series) {
487 if (marker->series() == series) {
464 markers.append(marker);
488 markers.append(marker);
465 }
489 }
466 }
490 }
467 return markers;
491 return markers;
468 }
492 }
469
493
470 void QLegendPrivate::handleSeriesAdded(QAbstractSeries *series)
494 void QLegendPrivate::handleSeriesAdded(QAbstractSeries *series)
471 {
495 {
472 if (m_series.contains(series)) {
496 if (m_series.contains(series)) {
473 return;
497 return;
474 }
498 }
475
499
476 QList<QLegendMarker*> newMarkers = series->d_ptr->createLegendMarkers(q_ptr);
500 QList<QLegendMarker*> newMarkers = series->d_ptr->createLegendMarkers(q_ptr);
477 decorateMarkers(newMarkers);
501 decorateMarkers(newMarkers);
478 addMarkers(newMarkers);
502 addMarkers(newMarkers);
479
503
480 QObject::connect(series->d_ptr.data(), SIGNAL(countChanged()), this, SLOT(handleCountChanged()));
504 QObject::connect(series->d_ptr.data(), SIGNAL(countChanged()), this, SLOT(handleCountChanged()));
481 QObject::connect(series, SIGNAL(visibleChanged()), this, SLOT(handleSeriesVisibleChanged()));
505 QObject::connect(series, SIGNAL(visibleChanged()), this, SLOT(handleSeriesVisibleChanged()));
482
506
483 m_series.append(series);
507 m_series.append(series);
484 m_items->setVisible(false);
508 m_items->setVisible(false);
485 m_layout->invalidate();
509 m_layout->invalidate();
486 }
510 }
487
511
488 void QLegendPrivate::handleSeriesRemoved(QAbstractSeries *series)
512 void QLegendPrivate::handleSeriesRemoved(QAbstractSeries *series)
489 {
513 {
490 if (m_series.contains(series)) {
514 if (m_series.contains(series)) {
491 m_series.removeOne(series);
515 m_series.removeOne(series);
492 }
516 }
493
517
494 // Find out, which markers to remove
518 // Find out, which markers to remove
495 QList<QLegendMarker *> removed;
519 QList<QLegendMarker *> removed;
496 foreach (QLegendMarker *m, m_markers) {
520 foreach (QLegendMarker *m, m_markers) {
497 if (m->series() == series) {
521 if (m->series() == series) {
498 removed << m;
522 removed << m;
499 }
523 }
500 }
524 }
501 removeMarkers(removed);
525 removeMarkers(removed);
502
526
503 QObject::disconnect(series->d_ptr.data(), SIGNAL(countChanged()), this, SLOT(handleCountChanged()));
527 QObject::disconnect(series->d_ptr.data(), SIGNAL(countChanged()), this, SLOT(handleCountChanged()));
504 QObject::disconnect(series, SIGNAL(visibleChanged()), this, SLOT(handleSeriesVisibleChanged()));
528 QObject::disconnect(series, SIGNAL(visibleChanged()), this, SLOT(handleSeriesVisibleChanged()));
505
529
506 m_layout->invalidate();
530 m_layout->invalidate();
507 }
531 }
508
532
509 void QLegendPrivate::handleSeriesVisibleChanged()
533 void QLegendPrivate::handleSeriesVisibleChanged()
510 {
534 {
511 QAbstractSeries *series = qobject_cast<QAbstractSeries *> (sender());
535 QAbstractSeries *series = qobject_cast<QAbstractSeries *> (sender());
512 Q_ASSERT(series);
536 Q_ASSERT(series);
513
537
514 foreach (QLegendMarker *marker, m_markers) {
538 foreach (QLegendMarker *marker, m_markers) {
515 if (marker->series() == series) {
539 if (marker->series() == series) {
516 marker->setVisible(series->isVisible());
540 marker->setVisible(series->isVisible());
517 }
541 }
518 }
542 }
519
543
520 if (m_chart->isVisible())
544 if (m_chart->isVisible())
521 m_layout->invalidate();
545 m_layout->invalidate();
522 }
546 }
523
547
524 void QLegendPrivate::handleCountChanged()
548 void QLegendPrivate::handleCountChanged()
525 {
549 {
526 // Here we handle the changes in marker count.
550 // Here we handle the changes in marker count.
527 // Can happen for example when pieslice(s) have been added to or removed from pieseries.
551 // Can happen for example when pieslice(s) have been added to or removed from pieseries.
528
552
529 QAbstractSeriesPrivate *series = qobject_cast<QAbstractSeriesPrivate *> (sender());
553 QAbstractSeriesPrivate *series = qobject_cast<QAbstractSeriesPrivate *> (sender());
530 QList<QLegendMarker *> createdMarkers = series->createLegendMarkers(q_ptr);
554 QList<QLegendMarker *> createdMarkers = series->createLegendMarkers(q_ptr);
531
555
532 // Find out removed markers and created markers
556 // Find out removed markers and created markers
533 QList<QLegendMarker *> removedMarkers;
557 QList<QLegendMarker *> removedMarkers;
534 foreach (QLegendMarker *oldMarker, m_markers) {
558 foreach (QLegendMarker *oldMarker, m_markers) {
535 // we have marker, which is related to sender.
559 // we have marker, which is related to sender.
536 if (oldMarker->series() == series->q_ptr) {
560 if (oldMarker->series() == series->q_ptr) {
537 bool found = false;
561 bool found = false;
538 foreach(QLegendMarker *newMarker, createdMarkers) {
562 foreach(QLegendMarker *newMarker, createdMarkers) {
539 // New marker considered existing if:
563 // New marker considered existing if:
540 // - d_ptr->relatedObject() is same for both markers.
564 // - d_ptr->relatedObject() is same for both markers.
541 if (newMarker->d_ptr->relatedObject() == oldMarker->d_ptr->relatedObject()) {
565 if (newMarker->d_ptr->relatedObject() == oldMarker->d_ptr->relatedObject()) {
542 // Delete the new marker, since we already have existing marker, that might be connected on user side.
566 // Delete the new marker, since we already have existing marker, that might be connected on user side.
543 found = true;
567 found = true;
544 createdMarkers.removeOne(newMarker);
568 createdMarkers.removeOne(newMarker);
545 delete newMarker;
569 delete newMarker;
546 }
570 }
547 }
571 }
548 if (!found) {
572 if (!found) {
549 // No related object found for marker, add to removedMarkers list
573 // No related object found for marker, add to removedMarkers list
550 removedMarkers << oldMarker;
574 removedMarkers << oldMarker;
551 }
575 }
552 }
576 }
553 }
577 }
554
578
555 removeMarkers(removedMarkers);
579 removeMarkers(removedMarkers);
556 decorateMarkers(createdMarkers);
580 decorateMarkers(createdMarkers);
557 addMarkers(createdMarkers);
581 addMarkers(createdMarkers);
558
582
559 q_ptr->layout()->invalidate();
583 q_ptr->layout()->invalidate();
560 }
584 }
561
585
562 void QLegendPrivate::addMarkers(QList<QLegendMarker *> markers)
586 void QLegendPrivate::addMarkers(QList<QLegendMarker *> markers)
563 {
587 {
564 foreach (QLegendMarker *marker, markers) {
588 foreach (QLegendMarker *marker, markers) {
565 m_items->addToGroup(marker->d_ptr.data()->item());
589 m_items->addToGroup(marker->d_ptr.data()->item());
566 m_markers << marker;
590 m_markers << marker;
567 m_markerHash.insert(marker->d_ptr->item(), marker);
591 m_markerHash.insert(marker->d_ptr->item(), marker);
568 }
592 }
569 }
593 }
570
594
571 void QLegendPrivate::removeMarkers(QList<QLegendMarker *> markers)
595 void QLegendPrivate::removeMarkers(QList<QLegendMarker *> markers)
572 {
596 {
573 foreach (QLegendMarker *marker, markers) {
597 foreach (QLegendMarker *marker, markers) {
574 marker->d_ptr->item()->setVisible(false);
598 marker->d_ptr->item()->setVisible(false);
575 m_items->removeFromGroup(marker->d_ptr->item());
599 m_items->removeFromGroup(marker->d_ptr->item());
576 m_markers.removeOne(marker);
600 m_markers.removeOne(marker);
577 m_markerHash.remove(marker->d_ptr->item());
601 m_markerHash.remove(marker->d_ptr->item());
578 delete marker;
602 delete marker;
579 }
603 }
580 }
604 }
581
605
582 void QLegendPrivate::decorateMarkers(QList<QLegendMarker *> markers)
606 void QLegendPrivate::decorateMarkers(QList<QLegendMarker *> markers)
583 {
607 {
584 foreach (QLegendMarker *marker, markers) {
608 foreach (QLegendMarker *marker, markers) {
585 marker->setFont(m_font);
609 marker->setFont(m_font);
586 marker->setLabelBrush(m_labelBrush);
610 marker->setLabelBrush(m_labelBrush);
587 }
611 }
588 }
612 }
589
613
590
614
591 #include "moc_qlegend.cpp"
615 #include "moc_qlegend.cpp"
592 #include "moc_qlegend_p.cpp"
616 #include "moc_qlegend_p.cpp"
593
617
594 QTCOMMERCIALCHART_END_NAMESPACE
618 QTCOMMERCIALCHART_END_NAMESPACE
@@ -1,107 +1,112
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2013 Digia Plc
3 ** Copyright (C) 2013 Digia Plc
4 ** All rights reserved.
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
6 **
7 ** This file is part of the Qt Enterprise Charts Add-on.
7 ** This file is part of the Qt Enterprise Charts Add-on.
8 **
8 **
9 ** $QT_BEGIN_LICENSE$
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
11 ** accordance with the Qt Enterprise License Agreement provided with the
11 ** accordance with the Qt Enterprise License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
13 ** a written agreement between you and Digia.
14 **
14 **
15 ** If you have questions regarding the use of this file, please use
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
17 ** $QT_END_LICENSE$
18 **
18 **
19 ****************************************************************************/
19 ****************************************************************************/
20
20
21 #ifndef QLEGEND_H
21 #ifndef QLEGEND_H
22 #define QLEGEND_H
22 #define QLEGEND_H
23
23
24 #include <qchartglobal.h>
24 #include <qchartglobal.h>
25 #include <QGraphicsWidget>
25 #include <QGraphicsWidget>
26 #include <QPen>
26 #include <QPen>
27 #include <QBrush>
27 #include <QBrush>
28
28
29 QTCOMMERCIALCHART_BEGIN_NAMESPACE
29 QTCOMMERCIALCHART_BEGIN_NAMESPACE
30
30
31 class QChart;
31 class QChart;
32 class QLegendPrivate;
32 class QLegendPrivate;
33 class QLegendMarker;
33 class QLegendMarker;
34 class QAbstractSeries;
34 class QAbstractSeries;
35
35
36 class QTCOMMERCIALCHART_EXPORT QLegend : public QGraphicsWidget
36 class QTCOMMERCIALCHART_EXPORT QLegend : public QGraphicsWidget
37 {
37 {
38 Q_OBJECT
38 Q_OBJECT
39 Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment)
39 Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment)
40 Q_PROPERTY(bool backgroundVisible READ isBackgroundVisible WRITE setBackgroundVisible NOTIFY backgroundVisibleChanged)
40 Q_PROPERTY(bool backgroundVisible READ isBackgroundVisible WRITE setBackgroundVisible NOTIFY backgroundVisibleChanged)
41 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
41 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
42 Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor NOTIFY borderColorChanged)
42 Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor NOTIFY borderColorChanged)
43 Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged)
43 Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged)
44 Q_PROPERTY(QColor labelColor READ labelColor WRITE setLabelColor NOTIFY labelColorChanged)
44 Q_PROPERTY(QColor labelColor READ labelColor WRITE setLabelColor NOTIFY labelColorChanged)
45 Q_PROPERTY(bool reverseMarkers READ reverseMarkers WRITE setReverseMarkers NOTIFY reverseMarkersChanged)
45
46
46 private:
47 private:
47 explicit QLegend(QChart *chart);
48 explicit QLegend(QChart *chart);
48
49
49 public:
50 public:
50 ~QLegend();
51 ~QLegend();
51
52
52 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
53 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
53
54
54 void setBrush(const QBrush &brush);
55 void setBrush(const QBrush &brush);
55 QBrush brush() const;
56 QBrush brush() const;
56 void setColor(QColor color);
57 void setColor(QColor color);
57 QColor color();
58 QColor color();
58
59
59 void setPen(const QPen &pen);
60 void setPen(const QPen &pen);
60 QPen pen() const;
61 QPen pen() const;
61 void setBorderColor(QColor color);
62 void setBorderColor(QColor color);
62 QColor borderColor();
63 QColor borderColor();
63
64
64 void setFont(const QFont &font);
65 void setFont(const QFont &font);
65 QFont font() const;
66 QFont font() const;
66 void setLabelBrush(const QBrush &brush);
67 void setLabelBrush(const QBrush &brush);
67 QBrush labelBrush() const;
68 QBrush labelBrush() const;
68
69
69 void setLabelColor(QColor color);
70 void setLabelColor(QColor color);
70 QColor labelColor() const;
71 QColor labelColor() const;
71
72
72 void setAlignment(Qt::Alignment alignment);
73 void setAlignment(Qt::Alignment alignment);
73 Qt::Alignment alignment() const;
74 Qt::Alignment alignment() const;
74
75
75 void detachFromChart();
76 void detachFromChart();
76 void attachToChart();
77 void attachToChart();
77 bool isAttachedToChart();
78 bool isAttachedToChart();
78
79
79 void setBackgroundVisible(bool visible = true);
80 void setBackgroundVisible(bool visible = true);
80 bool isBackgroundVisible() const;
81 bool isBackgroundVisible() const;
81
82
82 QList <QLegendMarker*> markers(QAbstractSeries *series = 0) const;
83 QList <QLegendMarker*> markers(QAbstractSeries *series = 0) const;
83
84
85 bool reverseMarkers();
86 void setReverseMarkers(bool reverseMarkers = true);
87
84 protected:
88 protected:
85 void hideEvent(QHideEvent *event);
89 void hideEvent(QHideEvent *event);
86 void showEvent(QShowEvent *event);
90 void showEvent(QShowEvent *event);
87
91
88 Q_SIGNALS:
92 Q_SIGNALS:
89 void backgroundVisibleChanged(bool visible);
93 void backgroundVisibleChanged(bool visible);
90 void colorChanged(QColor color);
94 void colorChanged(QColor color);
91 void borderColorChanged(QColor color);
95 void borderColorChanged(QColor color);
92 void fontChanged(QFont font);
96 void fontChanged(QFont font);
93 void labelColorChanged(QColor color);
97 void labelColorChanged(QColor color);
98 void reverseMarkersChanged(bool reverseMarkers);
94
99
95 private:
100 private:
96 QScopedPointer<QLegendPrivate> d_ptr;
101 QScopedPointer<QLegendPrivate> d_ptr;
97 Q_DISABLE_COPY(QLegend)
102 Q_DISABLE_COPY(QLegend)
98 friend class LegendScroller;
103 friend class LegendScroller;
99 friend class LegendLayout;
104 friend class LegendLayout;
100 friend class ChartLayout;
105 friend class ChartLayout;
101 friend class LegendMarkerItem;
106 friend class LegendMarkerItem;
102 friend class QLegendMarkerPrivate;
107 friend class QLegendMarkerPrivate;
103 };
108 };
104
109
105 QTCOMMERCIALCHART_END_NAMESPACE
110 QTCOMMERCIALCHART_END_NAMESPACE
106
111
107 #endif // QLEGEND_H
112 #endif // QLEGEND_H
@@ -1,100 +1,101
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2013 Digia Plc
3 ** Copyright (C) 2013 Digia Plc
4 ** All rights reserved.
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
6 **
7 ** This file is part of the Qt Enterprise Charts Add-on.
7 ** This file is part of the Qt Enterprise Charts Add-on.
8 **
8 **
9 ** $QT_BEGIN_LICENSE$
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
11 ** accordance with the Qt Enterprise License Agreement provided with the
11 ** accordance with the Qt Enterprise License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
13 ** a written agreement between you and Digia.
14 **
14 **
15 ** If you have questions regarding the use of this file, please use
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
17 ** $QT_END_LICENSE$
18 **
18 **
19 ****************************************************************************/
19 ****************************************************************************/
20
20
21 // W A R N I N G
21 // W A R N I N G
22 // -------------
22 // -------------
23 //
23 //
24 // This file is not part of the Qt Enterprise Chart API. It exists purely as an
24 // This file is not part of the Qt Enterprise Chart API. It exists purely as an
25 // implementation detail. This header file may change from version to
25 // implementation detail. This header file may change from version to
26 // version without notice, or even be removed.
26 // version without notice, or even be removed.
27 //
27 //
28 // We mean it.
28 // We mean it.
29
29
30 #ifndef QLEGEND_P_H
30 #ifndef QLEGEND_P_H
31 #define QLEGEND_P_H
31 #define QLEGEND_P_H
32
32
33 #include "qlegend.h"
33 #include "qlegend.h"
34
34
35 QTCOMMERCIALCHART_BEGIN_NAMESPACE
35 QTCOMMERCIALCHART_BEGIN_NAMESPACE
36
36
37 class QChart;
37 class QChart;
38 class ChartPresenter;
38 class ChartPresenter;
39 class QAbstractSeries;
39 class QAbstractSeries;
40 class LegendLayout;
40 class LegendLayout;
41 class QLegendMarker;
41 class QLegendMarker;
42
42
43 class QLegendPrivate : public QObject
43 class QLegendPrivate : public QObject
44 {
44 {
45 Q_OBJECT
45 Q_OBJECT
46 public:
46 public:
47 QLegendPrivate(ChartPresenter *presenter, QChart *chart, QLegend *q);
47 QLegendPrivate(ChartPresenter *presenter, QChart *chart, QLegend *q);
48 ~QLegendPrivate();
48 ~QLegendPrivate();
49
49
50 void setOffset(const QPointF &offset);
50 void setOffset(const QPointF &offset);
51 QPointF offset() const;
51 QPointF offset() const;
52 int roundness(qreal size);
52 int roundness(qreal size);
53
53
54 QGraphicsItemGroup* items() { return m_items; }
54 QGraphicsItemGroup* items() { return m_items; }
55
55
56 QList<QLegendMarker*> markers(QAbstractSeries *series = 0);
56 QList<QLegendMarker*> markers(QAbstractSeries *series = 0);
57
57
58 public Q_SLOTS:
58 public Q_SLOTS:
59 void handleSeriesAdded(QAbstractSeries *series);
59 void handleSeriesAdded(QAbstractSeries *series);
60 void handleSeriesRemoved(QAbstractSeries *series);
60 void handleSeriesRemoved(QAbstractSeries *series);
61 void handleSeriesVisibleChanged();
61 void handleSeriesVisibleChanged();
62 void handleCountChanged();
62 void handleCountChanged();
63
63
64 private:
64 private:
65 // Internal helpers
65 // Internal helpers
66 void addMarkers(QList<QLegendMarker *> markers);
66 void addMarkers(QList<QLegendMarker *> markers);
67 void removeMarkers(QList<QLegendMarker *> markers);
67 void removeMarkers(QList<QLegendMarker *> markers);
68 void decorateMarkers(QList<QLegendMarker *> markers);
68 void decorateMarkers(QList<QLegendMarker *> markers);
69
69
70 private:
70 private:
71 QLegend *q_ptr;
71 QLegend *q_ptr;
72 ChartPresenter *m_presenter;
72 ChartPresenter *m_presenter;
73 LegendLayout *m_layout;
73 LegendLayout *m_layout;
74 QChart *m_chart;
74 QChart *m_chart;
75 QGraphicsItemGroup *m_items;
75 QGraphicsItemGroup *m_items;
76 Qt::Alignment m_alignment;
76 Qt::Alignment m_alignment;
77 QBrush m_brush;
77 QBrush m_brush;
78 QPen m_pen;
78 QPen m_pen;
79 QFont m_font;
79 QFont m_font;
80 QBrush m_labelBrush;
80 QBrush m_labelBrush;
81
81
82 qreal m_diameter;
82 qreal m_diameter;
83 bool m_attachedToChart;
83 bool m_attachedToChart;
84 bool m_backgroundVisible;
84 bool m_backgroundVisible;
85 bool m_reverseMarkers;
85
86
86 QList<QLegendMarker *> m_markers;
87 QList<QLegendMarker *> m_markers;
87 QList<QAbstractSeries *> m_series;
88 QList<QAbstractSeries *> m_series;
88
89
89 QHash<QGraphicsItem *, QLegendMarker *> m_markerHash;
90 QHash<QGraphicsItem *, QLegendMarker *> m_markerHash;
90
91
91 friend class QLegend;
92 friend class QLegend;
92 friend class LegendMarkerItem;
93 friend class LegendMarkerItem;
93 friend class LegendLayout;
94 friend class LegendLayout;
94 friend class QLegendMarkerPrivate;
95 friend class QLegendMarkerPrivate;
95 friend class LegendScroller;
96 friend class LegendScroller;
96 };
97 };
97
98
98 QTCOMMERCIALCHART_END_NAMESPACE
99 QTCOMMERCIALCHART_END_NAMESPACE
99
100
100 #endif
101 #endif
@@ -1,1043 +1,1051
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2013 Digia Plc
3 ** Copyright (C) 2013 Digia Plc
4 ** All rights reserved.
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
6 **
7 ** This file is part of the Qt Enterprise Charts Add-on.
7 ** This file is part of the Qt Enterprise Charts Add-on.
8 **
8 **
9 ** $QT_BEGIN_LICENSE$
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
11 ** accordance with the Qt Enterprise License Agreement provided with the
11 ** accordance with the Qt Enterprise License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
13 ** a written agreement between you and Digia.
14 **
14 **
15 ** If you have questions regarding the use of this file, please use
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
17 ** $QT_END_LICENSE$
18 **
18 **
19 ****************************************************************************/
19 ****************************************************************************/
20
20
21 #include <QtTest/QtTest>
21 #include <QtTest/QtTest>
22 #include <qchartview.h>
22 #include <qchartview.h>
23 #include <qlineseries.h>
23 #include <qlineseries.h>
24 #include <qareaseries.h>
24 #include <qareaseries.h>
25 #include <qscatterseries.h>
25 #include <qscatterseries.h>
26 #include <qsplineseries.h>
26 #include <qsplineseries.h>
27 #include <qpieseries.h>
27 #include <qpieseries.h>
28 #include <qabstractbarseries.h>
28 #include <qabstractbarseries.h>
29 #include <qbarseries.h>
29 #include <qbarseries.h>
30 #include <qpercentbarseries.h>
30 #include <qpercentbarseries.h>
31 #include <qstackedbarseries.h>
31 #include <qstackedbarseries.h>
32 #include <qvalueaxis.h>
32 #include <qvalueaxis.h>
33 #include <qbarcategoryaxis.h>
33 #include <qbarcategoryaxis.h>
34 #include "tst_definitions.h"
34 #include "tst_definitions.h"
35
35
36 QTCOMMERCIALCHART_USE_NAMESPACE
36 QTCOMMERCIALCHART_USE_NAMESPACE
37
37
38 Q_DECLARE_METATYPE(QAbstractAxis *)
38 Q_DECLARE_METATYPE(QAbstractAxis *)
39 Q_DECLARE_METATYPE(QValueAxis *)
39 Q_DECLARE_METATYPE(QValueAxis *)
40 Q_DECLARE_METATYPE(QBarCategoryAxis *)
40 Q_DECLARE_METATYPE(QBarCategoryAxis *)
41 Q_DECLARE_METATYPE(QAbstractSeries *)
41 Q_DECLARE_METATYPE(QAbstractSeries *)
42 Q_DECLARE_METATYPE(QChart::AnimationOption)
42 Q_DECLARE_METATYPE(QChart::AnimationOption)
43 Q_DECLARE_METATYPE(QBrush)
43 Q_DECLARE_METATYPE(QBrush)
44 Q_DECLARE_METATYPE(QPen)
44 Q_DECLARE_METATYPE(QPen)
45 Q_DECLARE_METATYPE(QChart::ChartTheme)
45 Q_DECLARE_METATYPE(QChart::ChartTheme)
46
46
47 class tst_QChart : public QObject
47 class tst_QChart : public QObject
48 {
48 {
49 Q_OBJECT
49 Q_OBJECT
50
50
51 public slots:
51 public slots:
52 void initTestCase();
52 void initTestCase();
53 void cleanupTestCase();
53 void cleanupTestCase();
54 void init();
54 void init();
55 void cleanup();
55 void cleanup();
56
56
57 private slots:
57 private slots:
58 void qchart_data();
58 void qchart_data();
59 void qchart();
59 void qchart();
60 void addSeries_data();
60 void addSeries_data();
61 void addSeries();
61 void addSeries();
62 void animationOptions_data();
62 void animationOptions_data();
63 void animationOptions();
63 void animationOptions();
64 void axisX_data();
64 void axisX_data();
65 void axisX();
65 void axisX();
66 void axisY_data();
66 void axisY_data();
67 void axisY();
67 void axisY();
68 void backgroundBrush_data();
68 void backgroundBrush_data();
69 void backgroundBrush();
69 void backgroundBrush();
70 void backgroundPen_data();
70 void backgroundPen_data();
71 void backgroundPen();
71 void backgroundPen();
72 void isBackgroundVisible_data();
72 void isBackgroundVisible_data();
73 void isBackgroundVisible();
73 void isBackgroundVisible();
74 void plotAreaBackgroundBrush_data();
74 void plotAreaBackgroundBrush_data();
75 void plotAreaBackgroundBrush();
75 void plotAreaBackgroundBrush();
76 void plotAreaBackgroundPen_data();
76 void plotAreaBackgroundPen_data();
77 void plotAreaBackgroundPen();
77 void plotAreaBackgroundPen();
78 void isPlotAreaBackgroundVisible_data();
78 void isPlotAreaBackgroundVisible_data();
79 void isPlotAreaBackgroundVisible();
79 void isPlotAreaBackgroundVisible();
80 void legend_data();
80 void legend_data();
81 void legend();
81 void legend();
82 void plotArea_data();
82 void plotArea_data();
83 void plotArea();
83 void plotArea();
84 void removeAllSeries_data();
84 void removeAllSeries_data();
85 void removeAllSeries();
85 void removeAllSeries();
86 void removeSeries_data();
86 void removeSeries_data();
87 void removeSeries();
87 void removeSeries();
88 void scroll_right_data();
88 void scroll_right_data();
89 void scroll_right();
89 void scroll_right();
90 void scroll_left_data();
90 void scroll_left_data();
91 void scroll_left();
91 void scroll_left();
92 void scroll_up_data();
92 void scroll_up_data();
93 void scroll_up();
93 void scroll_up();
94 void scroll_down_data();
94 void scroll_down_data();
95 void scroll_down();
95 void scroll_down();
96 void theme_data();
96 void theme_data();
97 void theme();
97 void theme();
98 void title_data();
98 void title_data();
99 void title();
99 void title();
100 void titleBrush_data();
100 void titleBrush_data();
101 void titleBrush();
101 void titleBrush();
102 void titleFont_data();
102 void titleFont_data();
103 void titleFont();
103 void titleFont();
104 void zoomIn_data();
104 void zoomIn_data();
105 void zoomIn();
105 void zoomIn();
106 void zoomOut_data();
106 void zoomOut_data();
107 void zoomOut();
107 void zoomOut();
108 void zoomReset();
108 void zoomReset();
109 void createDefaultAxesForLineSeries_data();
109 void createDefaultAxesForLineSeries_data();
110 void createDefaultAxesForLineSeries();
110 void createDefaultAxesForLineSeries();
111 void axisPolarOrientation();
111 void axisPolarOrientation();
112 void backgroundRoundness();
112 void backgroundRoundness();
113 private:
113 private:
114 void createTestData();
114 void createTestData();
115
115
116 private:
116 private:
117 QChartView* m_view;
117 QChartView* m_view;
118 QChart* m_chart;
118 QChart* m_chart;
119 };
119 };
120
120
121 void tst_QChart::initTestCase()
121 void tst_QChart::initTestCase()
122 {
122 {
123
123
124 }
124 }
125
125
126 void tst_QChart::cleanupTestCase()
126 void tst_QChart::cleanupTestCase()
127 {
127 {
128
128
129 }
129 }
130
130
131 void tst_QChart::init()
131 void tst_QChart::init()
132 {
132 {
133 m_view = new QChartView(newQChartOrQPolarChart());
133 m_view = new QChartView(newQChartOrQPolarChart());
134 m_chart = m_view->chart();
134 m_chart = m_view->chart();
135 }
135 }
136
136
137 void tst_QChart::cleanup()
137 void tst_QChart::cleanup()
138 {
138 {
139 delete m_view;
139 delete m_view;
140 m_view = 0;
140 m_view = 0;
141 m_chart = 0;
141 m_chart = 0;
142 }
142 }
143
143
144
144
145 void tst_QChart::createTestData()
145 void tst_QChart::createTestData()
146 {
146 {
147 QLineSeries* series0 = new QLineSeries(this);
147 QLineSeries* series0 = new QLineSeries(this);
148 *series0 << QPointF(0, 0) << QPointF(100, 100);
148 *series0 << QPointF(0, 0) << QPointF(100, 100);
149 m_chart->addSeries(series0);
149 m_chart->addSeries(series0);
150 m_view->show();
150 m_view->show();
151 QTest::qWaitForWindowShown(m_view);
151 QTest::qWaitForWindowShown(m_view);
152 }
152 }
153
153
154 void tst_QChart::qchart_data()
154 void tst_QChart::qchart_data()
155 {
155 {
156 }
156 }
157
157
158 void tst_QChart::qchart()
158 void tst_QChart::qchart()
159 {
159 {
160 QVERIFY(m_chart);
160 QVERIFY(m_chart);
161 QVERIFY(m_chart->legend());
161 QVERIFY(m_chart->legend());
162 QVERIFY(m_chart->legend()->isVisible());
162 QVERIFY(m_chart->legend()->isVisible());
163
163
164 QCOMPARE(m_chart->animationOptions(), QChart::NoAnimation);
164 QCOMPARE(m_chart->animationOptions(), QChart::NoAnimation);
165 QVERIFY(!m_chart->axisX());
165 QVERIFY(!m_chart->axisX());
166 QVERIFY(!m_chart->axisY());
166 QVERIFY(!m_chart->axisY());
167 QVERIFY(m_chart->backgroundBrush()!=QBrush());
167 QVERIFY(m_chart->backgroundBrush()!=QBrush());
168 QVERIFY(m_chart->backgroundPen()!=QPen());
168 QVERIFY(m_chart->backgroundPen()!=QPen());
169 QCOMPARE(m_chart->isBackgroundVisible(), true);
169 QCOMPARE(m_chart->isBackgroundVisible(), true);
170 QVERIFY(m_chart->plotArea().top()==0);
170 QVERIFY(m_chart->plotArea().top()==0);
171 QVERIFY(m_chart->plotArea().left()==0);
171 QVERIFY(m_chart->plotArea().left()==0);
172 QVERIFY(m_chart->plotArea().right()==0);
172 QVERIFY(m_chart->plotArea().right()==0);
173 QVERIFY(m_chart->plotArea().bottom()==0);
173 QVERIFY(m_chart->plotArea().bottom()==0);
174 QCOMPARE(m_chart->theme(), QChart::ChartThemeLight);
174 QCOMPARE(m_chart->theme(), QChart::ChartThemeLight);
175 QCOMPARE(m_chart->title(), QString());
175 QCOMPARE(m_chart->title(), QString());
176
176
177 //QCOMPARE(m_chart->titleBrush(),QBrush());
177 //QCOMPARE(m_chart->titleBrush(),QBrush());
178 //QCOMPARE(m_chart->titleFont(),QFont());
178 //QCOMPARE(m_chart->titleFont(),QFont());
179
179
180 m_chart->removeAllSeries();
180 m_chart->removeAllSeries();
181 m_chart->scroll(0,0);
181 m_chart->scroll(0,0);
182
182
183 m_chart->zoomIn();
183 m_chart->zoomIn();
184 m_chart->zoomIn(QRectF());
184 m_chart->zoomIn(QRectF());
185 m_chart->zoomOut();
185 m_chart->zoomOut();
186
186
187 m_view->show();
187 m_view->show();
188
188
189 QVERIFY(m_chart->plotArea().top()>0);
189 QVERIFY(m_chart->plotArea().top()>0);
190 QVERIFY(m_chart->plotArea().left()>0);
190 QVERIFY(m_chart->plotArea().left()>0);
191 QVERIFY(m_chart->plotArea().right()>0);
191 QVERIFY(m_chart->plotArea().right()>0);
192 QVERIFY(m_chart->plotArea().bottom()>0);
192 QVERIFY(m_chart->plotArea().bottom()>0);
193 }
193 }
194
194
195 void tst_QChart::addSeries_data()
195 void tst_QChart::addSeries_data()
196 {
196 {
197 QTest::addColumn<QAbstractSeries *>("series");
197 QTest::addColumn<QAbstractSeries *>("series");
198
198
199 QAbstractSeries* line = new QLineSeries(this);
199 QAbstractSeries* line = new QLineSeries(this);
200 QAbstractSeries* area = new QAreaSeries(static_cast<QLineSeries*>(line));
200 QAbstractSeries* area = new QAreaSeries(static_cast<QLineSeries*>(line));
201 QAbstractSeries* scatter = new QScatterSeries(this);
201 QAbstractSeries* scatter = new QScatterSeries(this);
202 QAbstractSeries* spline = new QSplineSeries(this);
202 QAbstractSeries* spline = new QSplineSeries(this);
203
203
204 QTest::newRow("lineSeries") << line;
204 QTest::newRow("lineSeries") << line;
205 QTest::newRow("areaSeries") << area;
205 QTest::newRow("areaSeries") << area;
206 QTest::newRow("scatterSeries") << scatter;
206 QTest::newRow("scatterSeries") << scatter;
207 QTest::newRow("splineSeries") << spline;
207 QTest::newRow("splineSeries") << spline;
208
208
209 if (!isPolarTest()) {
209 if (!isPolarTest()) {
210 QAbstractSeries* pie = new QPieSeries(this);
210 QAbstractSeries* pie = new QPieSeries(this);
211 QAbstractSeries* bar = new QBarSeries(this);
211 QAbstractSeries* bar = new QBarSeries(this);
212 QAbstractSeries* percent = new QPercentBarSeries(this);
212 QAbstractSeries* percent = new QPercentBarSeries(this);
213 QAbstractSeries* stacked = new QStackedBarSeries(this);
213 QAbstractSeries* stacked = new QStackedBarSeries(this);
214 QTest::newRow("pieSeries") << pie;
214 QTest::newRow("pieSeries") << pie;
215 QTest::newRow("barSeries") << bar;
215 QTest::newRow("barSeries") << bar;
216 QTest::newRow("percentBarSeries") << percent;
216 QTest::newRow("percentBarSeries") << percent;
217 QTest::newRow("stackedBarSeries") << stacked;
217 QTest::newRow("stackedBarSeries") << stacked;
218 }
218 }
219 }
219 }
220
220
221 void tst_QChart::addSeries()
221 void tst_QChart::addSeries()
222 {
222 {
223 QFETCH(QAbstractSeries *, series);
223 QFETCH(QAbstractSeries *, series);
224 m_view->show();
224 m_view->show();
225 QTest::qWaitForWindowShown(m_view);
225 QTest::qWaitForWindowShown(m_view);
226 QVERIFY(!series->chart());
226 QVERIFY(!series->chart());
227 QCOMPARE(m_chart->series().count(), 0);
227 QCOMPARE(m_chart->series().count(), 0);
228 m_chart->addSeries(series);
228 m_chart->addSeries(series);
229 QCOMPARE(m_chart->series().count(), 1);
229 QCOMPARE(m_chart->series().count(), 1);
230 QCOMPARE(m_chart->series().first(), series);
230 QCOMPARE(m_chart->series().first(), series);
231 QVERIFY(series->chart() == m_chart);
231 QVERIFY(series->chart() == m_chart);
232 m_chart->createDefaultAxes();
232 m_chart->createDefaultAxes();
233 if(series->type()!=QAbstractSeries::SeriesTypePie){
233 if(series->type()!=QAbstractSeries::SeriesTypePie){
234 QVERIFY(m_chart->axisY(series));
234 QVERIFY(m_chart->axisY(series));
235 QVERIFY(m_chart->axisX(series));
235 QVERIFY(m_chart->axisX(series));
236 }else{
236 }else{
237 QVERIFY(!m_chart->axisY(series));
237 QVERIFY(!m_chart->axisY(series));
238 QVERIFY(!m_chart->axisX(series));
238 QVERIFY(!m_chart->axisX(series));
239 }
239 }
240 m_chart->removeSeries(series);
240 m_chart->removeSeries(series);
241 QVERIFY(!series->chart());
241 QVERIFY(!series->chart());
242 QCOMPARE(m_chart->series().count(), 0);
242 QCOMPARE(m_chart->series().count(), 0);
243 }
243 }
244
244
245 void tst_QChart::animationOptions_data()
245 void tst_QChart::animationOptions_data()
246 {
246 {
247 QTest::addColumn<QChart::AnimationOption>("animationOptions");
247 QTest::addColumn<QChart::AnimationOption>("animationOptions");
248 QTest::newRow("AllAnimations") << QChart::AllAnimations;
248 QTest::newRow("AllAnimations") << QChart::AllAnimations;
249 QTest::newRow("NoAnimation") << QChart::NoAnimation;
249 QTest::newRow("NoAnimation") << QChart::NoAnimation;
250 QTest::newRow("GridAxisAnimations") << QChart::GridAxisAnimations;
250 QTest::newRow("GridAxisAnimations") << QChart::GridAxisAnimations;
251 QTest::newRow("SeriesAnimations") << QChart::SeriesAnimations;
251 QTest::newRow("SeriesAnimations") << QChart::SeriesAnimations;
252 }
252 }
253
253
254 void tst_QChart::animationOptions()
254 void tst_QChart::animationOptions()
255 {
255 {
256 createTestData();
256 createTestData();
257 QFETCH(QChart::AnimationOption, animationOptions);
257 QFETCH(QChart::AnimationOption, animationOptions);
258 m_chart->setAnimationOptions(animationOptions);
258 m_chart->setAnimationOptions(animationOptions);
259 QCOMPARE(m_chart->animationOptions(), animationOptions);
259 QCOMPARE(m_chart->animationOptions(), animationOptions);
260 }
260 }
261
261
262 void tst_QChart::axisX_data()
262 void tst_QChart::axisX_data()
263 {
263 {
264
264
265 QTest::addColumn<QAbstractAxis*>("axis");
265 QTest::addColumn<QAbstractAxis*>("axis");
266 QTest::addColumn<QAbstractSeries *>("series");
266 QTest::addColumn<QAbstractSeries *>("series");
267
267
268 QTest::newRow("categories,lineSeries") << (QAbstractAxis*) new QBarCategoryAxis() << (QAbstractSeries*) new QLineSeries(this);
268 QTest::newRow("categories,lineSeries") << (QAbstractAxis*) new QBarCategoryAxis() << (QAbstractSeries*) new QLineSeries(this);
269 QTest::newRow("categories,areaSeries") << (QAbstractAxis*) new QBarCategoryAxis() << (QAbstractSeries*) new QAreaSeries(new QLineSeries(this));
269 QTest::newRow("categories,areaSeries") << (QAbstractAxis*) new QBarCategoryAxis() << (QAbstractSeries*) new QAreaSeries(new QLineSeries(this));
270 QTest::newRow("categories,scatterSeries") << (QAbstractAxis*) new QBarCategoryAxis() << (QAbstractSeries*) new QScatterSeries(this);
270 QTest::newRow("categories,scatterSeries") << (QAbstractAxis*) new QBarCategoryAxis() << (QAbstractSeries*) new QScatterSeries(this);
271 QTest::newRow("categories,splineSeries") << (QAbstractAxis*) new QBarCategoryAxis() << (QAbstractSeries*) new QSplineSeries(this);
271 QTest::newRow("categories,splineSeries") << (QAbstractAxis*) new QBarCategoryAxis() << (QAbstractSeries*) new QSplineSeries(this);
272 if (!isPolarTest()) {
272 if (!isPolarTest()) {
273 QTest::newRow("categories,pieSeries") << (QAbstractAxis*) new QBarCategoryAxis() << (QAbstractSeries*) new QPieSeries(this);
273 QTest::newRow("categories,pieSeries") << (QAbstractAxis*) new QBarCategoryAxis() << (QAbstractSeries*) new QPieSeries(this);
274 QTest::newRow("categories,barSeries") << (QAbstractAxis*) new QBarCategoryAxis() << (QAbstractSeries*) new QBarSeries(this);
274 QTest::newRow("categories,barSeries") << (QAbstractAxis*) new QBarCategoryAxis() << (QAbstractSeries*) new QBarSeries(this);
275 QTest::newRow("categories,percentBarSeries") << (QAbstractAxis*) new QBarCategoryAxis() << (QAbstractSeries*) new QPercentBarSeries(this);
275 QTest::newRow("categories,percentBarSeries") << (QAbstractAxis*) new QBarCategoryAxis() << (QAbstractSeries*) new QPercentBarSeries(this);
276 QTest::newRow("categories,stackedBarSeries") << (QAbstractAxis*) new QBarCategoryAxis() << (QAbstractSeries*) new QStackedBarSeries(this);
276 QTest::newRow("categories,stackedBarSeries") << (QAbstractAxis*) new QBarCategoryAxis() << (QAbstractSeries*) new QStackedBarSeries(this);
277 }
277 }
278
278
279 QTest::newRow("value,lineSeries") << (QAbstractAxis*) new QValueAxis() << (QAbstractSeries*) new QLineSeries(this);
279 QTest::newRow("value,lineSeries") << (QAbstractAxis*) new QValueAxis() << (QAbstractSeries*) new QLineSeries(this);
280 QTest::newRow("value,areaSeries") << (QAbstractAxis*) new QValueAxis() << (QAbstractSeries*) new QAreaSeries(new QLineSeries(this));
280 QTest::newRow("value,areaSeries") << (QAbstractAxis*) new QValueAxis() << (QAbstractSeries*) new QAreaSeries(new QLineSeries(this));
281 QTest::newRow("value,scatterSeries") << (QAbstractAxis*) new QValueAxis() << (QAbstractSeries*) new QScatterSeries(this);
281 QTest::newRow("value,scatterSeries") << (QAbstractAxis*) new QValueAxis() << (QAbstractSeries*) new QScatterSeries(this);
282 QTest::newRow("value,splineSeries") << (QAbstractAxis*) new QValueAxis() << (QAbstractSeries*) new QSplineSeries(this);
282 QTest::newRow("value,splineSeries") << (QAbstractAxis*) new QValueAxis() << (QAbstractSeries*) new QSplineSeries(this);
283 if (!isPolarTest()) {
283 if (!isPolarTest()) {
284 QTest::newRow("value,pieSeries") << (QAbstractAxis*) new QValueAxis() << (QAbstractSeries*) new QPieSeries(this);
284 QTest::newRow("value,pieSeries") << (QAbstractAxis*) new QValueAxis() << (QAbstractSeries*) new QPieSeries(this);
285 QTest::newRow("value,barSeries") << (QAbstractAxis*) new QValueAxis() << (QAbstractSeries*) new QBarSeries(this);
285 QTest::newRow("value,barSeries") << (QAbstractAxis*) new QValueAxis() << (QAbstractSeries*) new QBarSeries(this);
286 QTest::newRow("value,percentBarSeries") << (QAbstractAxis*) new QValueAxis() << (QAbstractSeries*) new QPercentBarSeries(this);
286 QTest::newRow("value,percentBarSeries") << (QAbstractAxis*) new QValueAxis() << (QAbstractSeries*) new QPercentBarSeries(this);
287 QTest::newRow("value,stackedBarSeries") << (QAbstractAxis*) new QValueAxis() << (QAbstractSeries*) new QStackedBarSeries(this);
287 QTest::newRow("value,stackedBarSeries") << (QAbstractAxis*) new QValueAxis() << (QAbstractSeries*) new QStackedBarSeries(this);
288 }
288 }
289 }
289 }
290
290
291 void tst_QChart::axisX()
291 void tst_QChart::axisX()
292 {
292 {
293 QFETCH(QAbstractAxis*, axis);
293 QFETCH(QAbstractAxis*, axis);
294 QFETCH(QAbstractSeries*, series);
294 QFETCH(QAbstractSeries*, series);
295 QVERIFY(!m_chart->axisX());
295 QVERIFY(!m_chart->axisX());
296 m_view->show();
296 m_view->show();
297 QTest::qWaitForWindowShown(m_view);
297 QTest::qWaitForWindowShown(m_view);
298 m_chart->addSeries(series);
298 m_chart->addSeries(series);
299 m_chart->setAxisX(axis,series);
299 m_chart->setAxisX(axis,series);
300 QVERIFY(m_chart->axisX(series)==axis);
300 QVERIFY(m_chart->axisX(series)==axis);
301 }
301 }
302
302
303 void tst_QChart::axisY_data()
303 void tst_QChart::axisY_data()
304 {
304 {
305 axisX_data();
305 axisX_data();
306 }
306 }
307
307
308
308
309 void tst_QChart::axisY()
309 void tst_QChart::axisY()
310 {
310 {
311 QFETCH(QAbstractAxis*, axis);
311 QFETCH(QAbstractAxis*, axis);
312 QFETCH(QAbstractSeries*, series);
312 QFETCH(QAbstractSeries*, series);
313 QVERIFY(!m_chart->axisY());
313 QVERIFY(!m_chart->axisY());
314 m_view->show();
314 m_view->show();
315 QTest::qWaitForWindowShown(m_view);
315 QTest::qWaitForWindowShown(m_view);
316 m_chart->addSeries(series);
316 m_chart->addSeries(series);
317 m_chart->setAxisY(axis,series);
317 m_chart->setAxisY(axis,series);
318 QVERIFY(m_chart->axisY(series)==axis);
318 QVERIFY(m_chart->axisY(series)==axis);
319 }
319 }
320
320
321 void tst_QChart::backgroundBrush_data()
321 void tst_QChart::backgroundBrush_data()
322 {
322 {
323 QTest::addColumn<QBrush>("backgroundBrush");
323 QTest::addColumn<QBrush>("backgroundBrush");
324 QTest::newRow("null") << QBrush();
324 QTest::newRow("null") << QBrush();
325 QTest::newRow("blue") << QBrush(Qt::blue);
325 QTest::newRow("blue") << QBrush(Qt::blue);
326 QTest::newRow("white") << QBrush(Qt::white);
326 QTest::newRow("white") << QBrush(Qt::white);
327 QTest::newRow("black") << QBrush(Qt::black);
327 QTest::newRow("black") << QBrush(Qt::black);
328 }
328 }
329
329
330 void tst_QChart::backgroundBrush()
330 void tst_QChart::backgroundBrush()
331 {
331 {
332 QFETCH(QBrush, backgroundBrush);
332 QFETCH(QBrush, backgroundBrush);
333 m_chart->setBackgroundBrush(backgroundBrush);
333 m_chart->setBackgroundBrush(backgroundBrush);
334 QCOMPARE(m_chart->backgroundBrush(), backgroundBrush);
334 QCOMPARE(m_chart->backgroundBrush(), backgroundBrush);
335 }
335 }
336
336
337 void tst_QChart::backgroundPen_data()
337 void tst_QChart::backgroundPen_data()
338 {
338 {
339 QTest::addColumn<QPen>("backgroundPen");
339 QTest::addColumn<QPen>("backgroundPen");
340 QTest::newRow("null") << QPen();
340 QTest::newRow("null") << QPen();
341 QTest::newRow("blue") << QPen(Qt::blue);
341 QTest::newRow("blue") << QPen(Qt::blue);
342 QTest::newRow("white") << QPen(Qt::white);
342 QTest::newRow("white") << QPen(Qt::white);
343 QTest::newRow("black") << QPen(Qt::black);
343 QTest::newRow("black") << QPen(Qt::black);
344 }
344 }
345
345
346
346
347 void tst_QChart::backgroundPen()
347 void tst_QChart::backgroundPen()
348 {
348 {
349 QFETCH(QPen, backgroundPen);
349 QFETCH(QPen, backgroundPen);
350 m_chart->setBackgroundPen(backgroundPen);
350 m_chart->setBackgroundPen(backgroundPen);
351 QCOMPARE(m_chart->backgroundPen(), backgroundPen);
351 QCOMPARE(m_chart->backgroundPen(), backgroundPen);
352 }
352 }
353
353
354 void tst_QChart::isBackgroundVisible_data()
354 void tst_QChart::isBackgroundVisible_data()
355 {
355 {
356 QTest::addColumn<bool>("isBackgroundVisible");
356 QTest::addColumn<bool>("isBackgroundVisible");
357 QTest::newRow("true") << true;
357 QTest::newRow("true") << true;
358 QTest::newRow("false") << false;
358 QTest::newRow("false") << false;
359 }
359 }
360
360
361 void tst_QChart::isBackgroundVisible()
361 void tst_QChart::isBackgroundVisible()
362 {
362 {
363 QFETCH(bool, isBackgroundVisible);
363 QFETCH(bool, isBackgroundVisible);
364 m_chart->setBackgroundVisible(isBackgroundVisible);
364 m_chart->setBackgroundVisible(isBackgroundVisible);
365 QCOMPARE(m_chart->isBackgroundVisible(), isBackgroundVisible);
365 QCOMPARE(m_chart->isBackgroundVisible(), isBackgroundVisible);
366 }
366 }
367
367
368 void tst_QChart::plotAreaBackgroundBrush_data()
368 void tst_QChart::plotAreaBackgroundBrush_data()
369 {
369 {
370 QTest::addColumn<QBrush>("plotAreaBackgroundBrush");
370 QTest::addColumn<QBrush>("plotAreaBackgroundBrush");
371 QTest::newRow("null") << QBrush();
371 QTest::newRow("null") << QBrush();
372 QTest::newRow("blue") << QBrush(Qt::blue);
372 QTest::newRow("blue") << QBrush(Qt::blue);
373 QTest::newRow("white") << QBrush(Qt::white);
373 QTest::newRow("white") << QBrush(Qt::white);
374 QTest::newRow("black") << QBrush(Qt::black);
374 QTest::newRow("black") << QBrush(Qt::black);
375 }
375 }
376
376
377 void tst_QChart::plotAreaBackgroundBrush()
377 void tst_QChart::plotAreaBackgroundBrush()
378 {
378 {
379 QFETCH(QBrush, plotAreaBackgroundBrush);
379 QFETCH(QBrush, plotAreaBackgroundBrush);
380 m_chart->setPlotAreaBackgroundBrush(plotAreaBackgroundBrush);
380 m_chart->setPlotAreaBackgroundBrush(plotAreaBackgroundBrush);
381 QCOMPARE(m_chart->plotAreaBackgroundBrush(), plotAreaBackgroundBrush);
381 QCOMPARE(m_chart->plotAreaBackgroundBrush(), plotAreaBackgroundBrush);
382 }
382 }
383
383
384 void tst_QChart::plotAreaBackgroundPen_data()
384 void tst_QChart::plotAreaBackgroundPen_data()
385 {
385 {
386 QTest::addColumn<QPen>("plotAreaBackgroundPen");
386 QTest::addColumn<QPen>("plotAreaBackgroundPen");
387 QTest::newRow("null") << QPen();
387 QTest::newRow("null") << QPen();
388 QTest::newRow("blue") << QPen(Qt::blue);
388 QTest::newRow("blue") << QPen(Qt::blue);
389 QTest::newRow("white") << QPen(Qt::white);
389 QTest::newRow("white") << QPen(Qt::white);
390 QTest::newRow("black") << QPen(Qt::black);
390 QTest::newRow("black") << QPen(Qt::black);
391 }
391 }
392
392
393
393
394 void tst_QChart::plotAreaBackgroundPen()
394 void tst_QChart::plotAreaBackgroundPen()
395 {
395 {
396 QFETCH(QPen, plotAreaBackgroundPen);
396 QFETCH(QPen, plotAreaBackgroundPen);
397 m_chart->setPlotAreaBackgroundPen(plotAreaBackgroundPen);
397 m_chart->setPlotAreaBackgroundPen(plotAreaBackgroundPen);
398 QCOMPARE(m_chart->plotAreaBackgroundPen(), plotAreaBackgroundPen);
398 QCOMPARE(m_chart->plotAreaBackgroundPen(), plotAreaBackgroundPen);
399 }
399 }
400
400
401 void tst_QChart::isPlotAreaBackgroundVisible_data()
401 void tst_QChart::isPlotAreaBackgroundVisible_data()
402 {
402 {
403 QTest::addColumn<bool>("isPlotAreaBackgroundVisible");
403 QTest::addColumn<bool>("isPlotAreaBackgroundVisible");
404 QTest::newRow("true") << true;
404 QTest::newRow("true") << true;
405 QTest::newRow("false") << false;
405 QTest::newRow("false") << false;
406 }
406 }
407
407
408 void tst_QChart::isPlotAreaBackgroundVisible()
408 void tst_QChart::isPlotAreaBackgroundVisible()
409 {
409 {
410 QFETCH(bool, isPlotAreaBackgroundVisible);
410 QFETCH(bool, isPlotAreaBackgroundVisible);
411 m_chart->setPlotAreaBackgroundVisible(isPlotAreaBackgroundVisible);
411 m_chart->setPlotAreaBackgroundVisible(isPlotAreaBackgroundVisible);
412 QCOMPARE(m_chart->isPlotAreaBackgroundVisible(), isPlotAreaBackgroundVisible);
412 QCOMPARE(m_chart->isPlotAreaBackgroundVisible(), isPlotAreaBackgroundVisible);
413 }
413 }
414 void tst_QChart::legend_data()
414 void tst_QChart::legend_data()
415 {
415 {
416
416
417 }
417 }
418
418
419 void tst_QChart::legend()
419 void tst_QChart::legend()
420 {
420 {
421 QLegend *legend = m_chart->legend();
421 QLegend *legend = m_chart->legend();
422 QVERIFY(legend);
422 QVERIFY(legend);
423 QVERIFY(!m_chart->legend()->reverseMarkers());
423
424
424 // Colors related signals
425 // Colors related signals
425 QSignalSpy colorSpy(legend, SIGNAL(colorChanged(QColor)));
426 QSignalSpy colorSpy(legend, SIGNAL(colorChanged(QColor)));
426 QSignalSpy borderColorSpy(legend, SIGNAL(borderColorChanged(QColor)));
427 QSignalSpy borderColorSpy(legend, SIGNAL(borderColorChanged(QColor)));
427 QSignalSpy labelColorSpy(legend, SIGNAL(labelColorChanged(QColor)));
428 QSignalSpy labelColorSpy(legend, SIGNAL(labelColorChanged(QColor)));
428
429
429 // colorChanged
430 // colorChanged
430 legend->setColor(QColor("aliceblue"));
431 legend->setColor(QColor("aliceblue"));
431 QCOMPARE(colorSpy.count(), 1);
432 QCOMPARE(colorSpy.count(), 1);
432 QBrush b = legend->brush();
433 QBrush b = legend->brush();
433 b.setColor(QColor("aqua"));
434 b.setColor(QColor("aqua"));
434 legend->setBrush(b);
435 legend->setBrush(b);
435 QCOMPARE(colorSpy.count(), 2);
436 QCOMPARE(colorSpy.count(), 2);
436
437
437 // borderColorChanged
438 // borderColorChanged
438 legend->setBorderColor(QColor("aliceblue"));
439 legend->setBorderColor(QColor("aliceblue"));
439 QCOMPARE(borderColorSpy.count(), 1);
440 QCOMPARE(borderColorSpy.count(), 1);
440 QPen p = legend->pen();
441 QPen p = legend->pen();
441 p.setColor(QColor("aqua"));
442 p.setColor(QColor("aqua"));
442 legend->setPen(p);
443 legend->setPen(p);
443 QCOMPARE(borderColorSpy.count(), 2);
444 QCOMPARE(borderColorSpy.count(), 2);
444
445
445 // labelColorChanged
446 // labelColorChanged
446 legend->setLabelColor(QColor("lightsalmon"));
447 legend->setLabelColor(QColor("lightsalmon"));
447 QCOMPARE(labelColorSpy.count(), 1);
448 QCOMPARE(labelColorSpy.count(), 1);
448 b = legend->labelBrush();
449 b = legend->labelBrush();
449 b.setColor(QColor("lightseagreen"));
450 b.setColor(QColor("lightseagreen"));
450 legend->setLabelBrush(b);
451 legend->setLabelBrush(b);
451 QCOMPARE(labelColorSpy.count(), 2);
452 QCOMPARE(labelColorSpy.count(), 2);
452
453
453 // fontChanged
454 // fontChanged
454 QSignalSpy fontSpy(legend, SIGNAL(fontChanged(QFont)));
455 QSignalSpy fontSpy(legend, SIGNAL(fontChanged(QFont)));
455 QFont f = legend->font();
456 QFont f = legend->font();
456 f.setBold(!f.bold());
457 f.setBold(!f.bold());
457 legend->setFont(f);
458 legend->setFont(f);
458 QCOMPARE(fontSpy.count(), 1);
459 QCOMPARE(fontSpy.count(), 1);
460
461 // reverseMarkersChanged
462 QSignalSpy reverseMarkersSpy(legend, SIGNAL(reverseMarkersChanged(bool)));
463 QCOMPARE(reverseMarkersSpy.count(), 0);
464 legend->setReverseMarkers();
465 QCOMPARE(reverseMarkersSpy.count(), 1);
466 QVERIFY(legend->reverseMarkers());
459 }
467 }
460
468
461 void tst_QChart::plotArea_data()
469 void tst_QChart::plotArea_data()
462 {
470 {
463
471
464 }
472 }
465
473
466 void tst_QChart::plotArea()
474 void tst_QChart::plotArea()
467 {
475 {
468 createTestData();
476 createTestData();
469 QRectF rect = m_chart->geometry();
477 QRectF rect = m_chart->geometry();
470 QVERIFY(m_chart->plotArea().isValid());
478 QVERIFY(m_chart->plotArea().isValid());
471 QVERIFY(m_chart->plotArea().height() < rect.height());
479 QVERIFY(m_chart->plotArea().height() < rect.height());
472 QVERIFY(m_chart->plotArea().width() < rect.width());
480 QVERIFY(m_chart->plotArea().width() < rect.width());
473 }
481 }
474
482
475 void tst_QChart::removeAllSeries_data()
483 void tst_QChart::removeAllSeries_data()
476 {
484 {
477
485
478 }
486 }
479
487
480 void tst_QChart::removeAllSeries()
488 void tst_QChart::removeAllSeries()
481 {
489 {
482 QLineSeries* series0 = new QLineSeries(this);
490 QLineSeries* series0 = new QLineSeries(this);
483 QLineSeries* series1 = new QLineSeries(this);
491 QLineSeries* series1 = new QLineSeries(this);
484 QLineSeries* series2 = new QLineSeries(this);
492 QLineSeries* series2 = new QLineSeries(this);
485 QSignalSpy deleteSpy1(series0, SIGNAL(destroyed()));
493 QSignalSpy deleteSpy1(series0, SIGNAL(destroyed()));
486 QSignalSpy deleteSpy2(series1, SIGNAL(destroyed()));
494 QSignalSpy deleteSpy2(series1, SIGNAL(destroyed()));
487 QSignalSpy deleteSpy3(series2, SIGNAL(destroyed()));
495 QSignalSpy deleteSpy3(series2, SIGNAL(destroyed()));
488
496
489 m_chart->addSeries(series0);
497 m_chart->addSeries(series0);
490 m_chart->addSeries(series1);
498 m_chart->addSeries(series1);
491 m_chart->addSeries(series2);
499 m_chart->addSeries(series2);
492 m_view->show();
500 m_view->show();
493 QTest::qWaitForWindowShown(m_view);
501 QTest::qWaitForWindowShown(m_view);
494 m_chart->createDefaultAxes();
502 m_chart->createDefaultAxes();
495 QCOMPARE(m_chart->axes().count(), 2);
503 QCOMPARE(m_chart->axes().count(), 2);
496 QVERIFY(m_chart->axisY(series0)!=0);
504 QVERIFY(m_chart->axisY(series0)!=0);
497 QVERIFY(m_chart->axisY(series1)!=0);
505 QVERIFY(m_chart->axisY(series1)!=0);
498 QVERIFY(m_chart->axisY(series2)!=0);
506 QVERIFY(m_chart->axisY(series2)!=0);
499
507
500 m_chart->removeAllSeries();
508 m_chart->removeAllSeries();
501 QCOMPARE(m_chart->axes().count(), 2);
509 QCOMPARE(m_chart->axes().count(), 2);
502 QVERIFY(m_chart->axisX() != 0);
510 QVERIFY(m_chart->axisX() != 0);
503 QVERIFY(m_chart->axisY() != 0);
511 QVERIFY(m_chart->axisY() != 0);
504 QCOMPARE(deleteSpy1.count(), 1);
512 QCOMPARE(deleteSpy1.count(), 1);
505 QCOMPARE(deleteSpy2.count(), 1);
513 QCOMPARE(deleteSpy2.count(), 1);
506 QCOMPARE(deleteSpy3.count(), 1);
514 QCOMPARE(deleteSpy3.count(), 1);
507 }
515 }
508
516
509 void tst_QChart::removeSeries_data()
517 void tst_QChart::removeSeries_data()
510 {
518 {
511 axisX_data();
519 axisX_data();
512 }
520 }
513
521
514 void tst_QChart::removeSeries()
522 void tst_QChart::removeSeries()
515 {
523 {
516 QFETCH(QAbstractAxis *, axis);
524 QFETCH(QAbstractAxis *, axis);
517 QFETCH(QAbstractSeries *, series);
525 QFETCH(QAbstractSeries *, series);
518 QSignalSpy deleteSpy(series, SIGNAL(destroyed()));
526 QSignalSpy deleteSpy(series, SIGNAL(destroyed()));
519 m_view->show();
527 m_view->show();
520 QTest::qWaitForWindowShown(m_view);
528 QTest::qWaitForWindowShown(m_view);
521 if(!axis) axis = m_chart->axisY();
529 if(!axis) axis = m_chart->axisY();
522 m_chart->addSeries(series);
530 m_chart->addSeries(series);
523 m_chart->setAxisY(axis,series);
531 m_chart->setAxisY(axis,series);
524 QCOMPARE(m_chart->axisY(series),axis);
532 QCOMPARE(m_chart->axisY(series),axis);
525 m_chart->removeSeries(series);
533 m_chart->removeSeries(series);
526 QCOMPARE(m_chart->axes().count(), 1);
534 QCOMPARE(m_chart->axes().count(), 1);
527 QVERIFY(m_chart->axisY() != 0);
535 QVERIFY(m_chart->axisY() != 0);
528 QVERIFY(m_chart->axisY(series)==0);
536 QVERIFY(m_chart->axisY(series)==0);
529 QCOMPARE(deleteSpy.count(), 0);
537 QCOMPARE(deleteSpy.count(), 0);
530 }
538 }
531
539
532 void tst_QChart::scroll_right_data()
540 void tst_QChart::scroll_right_data()
533 {
541 {
534 QTest::addColumn<QAbstractSeries *>("series");
542 QTest::addColumn<QAbstractSeries *>("series");
535
543
536 QLineSeries* series0 = new QLineSeries(this);
544 QLineSeries* series0 = new QLineSeries(this);
537 *series0 << QPointF(0, 0) << QPointF(100, 100);
545 *series0 << QPointF(0, 0) << QPointF(100, 100);
538
546
539 QTest::newRow("lineSeries") << (QAbstractSeries*) series0;
547 QTest::newRow("lineSeries") << (QAbstractSeries*) series0;
540
548
541
549
542 }
550 }
543
551
544 void tst_QChart::scroll_right()
552 void tst_QChart::scroll_right()
545 {
553 {
546 QFETCH(QAbstractSeries *, series);
554 QFETCH(QAbstractSeries *, series);
547 m_chart->addSeries(series);
555 m_chart->addSeries(series);
548 m_chart->createDefaultAxes();
556 m_chart->createDefaultAxes();
549 m_view->show();
557 m_view->show();
550 QTest::qWaitForWindowShown(m_view);
558 QTest::qWaitForWindowShown(m_view);
551 QAbstractAxis * axis = m_chart->axisX();
559 QAbstractAxis * axis = m_chart->axisX();
552 QVERIFY(axis!=0);
560 QVERIFY(axis!=0);
553
561
554 switch(axis->type())
562 switch(axis->type())
555 {
563 {
556 case QAbstractAxis::AxisTypeValue:{
564 case QAbstractAxis::AxisTypeValue:{
557 QValueAxis* vaxis = qobject_cast<QValueAxis*>(axis);
565 QValueAxis* vaxis = qobject_cast<QValueAxis*>(axis);
558 QVERIFY(vaxis!=0);
566 QVERIFY(vaxis!=0);
559 qreal min = vaxis->min();
567 qreal min = vaxis->min();
560 qreal max = vaxis->max();
568 qreal max = vaxis->max();
561 QVERIFY(max>min);
569 QVERIFY(max>min);
562 m_chart->scroll(50, 0);
570 m_chart->scroll(50, 0);
563 QVERIFY(min<vaxis->min());
571 QVERIFY(min<vaxis->min());
564 QVERIFY(max<vaxis->max());
572 QVERIFY(max<vaxis->max());
565 break;
573 break;
566 }
574 }
567 case QAbstractAxis::AxisTypeBarCategory:{
575 case QAbstractAxis::AxisTypeBarCategory:{
568 QBarCategoryAxis* caxis = qobject_cast<QBarCategoryAxis*>(axis);
576 QBarCategoryAxis* caxis = qobject_cast<QBarCategoryAxis*>(axis);
569 QVERIFY(caxis!=0);
577 QVERIFY(caxis!=0);
570 qreal min = caxis->min().toDouble();
578 qreal min = caxis->min().toDouble();
571 qreal max = caxis->max().toDouble();
579 qreal max = caxis->max().toDouble();
572 m_chart->scroll(50, 0);
580 m_chart->scroll(50, 0);
573 QVERIFY(min<caxis->min().toDouble());
581 QVERIFY(min<caxis->min().toDouble());
574 QVERIFY(max<caxis->max().toDouble());
582 QVERIFY(max<caxis->max().toDouble());
575 break;
583 break;
576 }
584 }
577 default:
585 default:
578 qFatal("Unsupported type");
586 qFatal("Unsupported type");
579 break;
587 break;
580 }
588 }
581 }
589 }
582
590
583 void tst_QChart::scroll_left_data()
591 void tst_QChart::scroll_left_data()
584 {
592 {
585 scroll_right_data();
593 scroll_right_data();
586 }
594 }
587
595
588 void tst_QChart::scroll_left()
596 void tst_QChart::scroll_left()
589 {
597 {
590 QFETCH(QAbstractSeries *, series);
598 QFETCH(QAbstractSeries *, series);
591 m_chart->addSeries(series);
599 m_chart->addSeries(series);
592 m_chart->createDefaultAxes();
600 m_chart->createDefaultAxes();
593 m_view->show();
601 m_view->show();
594 QTest::qWaitForWindowShown(m_view);
602 QTest::qWaitForWindowShown(m_view);
595 QAbstractAxis * axis = m_chart->axisX();
603 QAbstractAxis * axis = m_chart->axisX();
596 QVERIFY(axis!=0);
604 QVERIFY(axis!=0);
597
605
598 switch(axis->type())
606 switch(axis->type())
599 {
607 {
600 case QAbstractAxis::AxisTypeValue:{
608 case QAbstractAxis::AxisTypeValue:{
601 QValueAxis* vaxis = qobject_cast<QValueAxis*>(axis);
609 QValueAxis* vaxis = qobject_cast<QValueAxis*>(axis);
602 QVERIFY(vaxis!=0);
610 QVERIFY(vaxis!=0);
603 qreal min = vaxis->min();
611 qreal min = vaxis->min();
604 qreal max = vaxis->max();
612 qreal max = vaxis->max();
605 m_chart->scroll(-50, 0);
613 m_chart->scroll(-50, 0);
606 QVERIFY(min>vaxis->min());
614 QVERIFY(min>vaxis->min());
607 QVERIFY(max>vaxis->max());
615 QVERIFY(max>vaxis->max());
608 break;
616 break;
609 }
617 }
610 case QAbstractAxis::AxisTypeBarCategory:{
618 case QAbstractAxis::AxisTypeBarCategory:{
611 QBarCategoryAxis* caxis = qobject_cast<QBarCategoryAxis*>(axis);
619 QBarCategoryAxis* caxis = qobject_cast<QBarCategoryAxis*>(axis);
612 QVERIFY(caxis!=0);
620 QVERIFY(caxis!=0);
613 qreal min = caxis->min().toDouble();
621 qreal min = caxis->min().toDouble();
614 qreal max = caxis->max().toDouble();
622 qreal max = caxis->max().toDouble();
615 m_chart->scroll(-50, 0);
623 m_chart->scroll(-50, 0);
616 QVERIFY(min>caxis->min().toDouble());
624 QVERIFY(min>caxis->min().toDouble());
617 QVERIFY(max>caxis->max().toDouble());
625 QVERIFY(max>caxis->max().toDouble());
618 break;
626 break;
619 }
627 }
620 default:
628 default:
621 qFatal("Unsupported type");
629 qFatal("Unsupported type");
622 break;
630 break;
623 }
631 }
624 }
632 }
625
633
626 void tst_QChart::scroll_up_data()
634 void tst_QChart::scroll_up_data()
627 {
635 {
628 scroll_right_data();
636 scroll_right_data();
629 }
637 }
630
638
631 void tst_QChart::scroll_up()
639 void tst_QChart::scroll_up()
632 {
640 {
633 QFETCH(QAbstractSeries *, series);
641 QFETCH(QAbstractSeries *, series);
634 m_chart->addSeries(series);
642 m_chart->addSeries(series);
635 m_chart->createDefaultAxes();
643 m_chart->createDefaultAxes();
636 m_view->show();
644 m_view->show();
637 QTest::qWaitForWindowShown(m_view);
645 QTest::qWaitForWindowShown(m_view);
638 QAbstractAxis * axis = m_chart->axisY();
646 QAbstractAxis * axis = m_chart->axisY();
639 QVERIFY(axis!=0);
647 QVERIFY(axis!=0);
640
648
641 switch(axis->type())
649 switch(axis->type())
642 {
650 {
643 case QAbstractAxis::AxisTypeValue:{
651 case QAbstractAxis::AxisTypeValue:{
644 QValueAxis* vaxis = qobject_cast<QValueAxis*>(axis);
652 QValueAxis* vaxis = qobject_cast<QValueAxis*>(axis);
645 QVERIFY(vaxis!=0);
653 QVERIFY(vaxis!=0);
646 qreal min = vaxis->min();
654 qreal min = vaxis->min();
647 qreal max = vaxis->max();
655 qreal max = vaxis->max();
648 m_chart->scroll(0, 50);
656 m_chart->scroll(0, 50);
649 QVERIFY(min<vaxis->min());
657 QVERIFY(min<vaxis->min());
650 QVERIFY(max<vaxis->max());
658 QVERIFY(max<vaxis->max());
651 break;
659 break;
652 }
660 }
653 case QAbstractAxis::AxisTypeBarCategory:{
661 case QAbstractAxis::AxisTypeBarCategory:{
654 QBarCategoryAxis* caxis = qobject_cast<QBarCategoryAxis*>(axis);
662 QBarCategoryAxis* caxis = qobject_cast<QBarCategoryAxis*>(axis);
655 QVERIFY(caxis!=0);
663 QVERIFY(caxis!=0);
656 qreal min = caxis->min().toDouble();
664 qreal min = caxis->min().toDouble();
657 qreal max = caxis->max().toDouble();
665 qreal max = caxis->max().toDouble();
658 m_chart->scroll(0, 50);
666 m_chart->scroll(0, 50);
659 QVERIFY(min<caxis->min().toDouble());
667 QVERIFY(min<caxis->min().toDouble());
660 QVERIFY(max<caxis->max().toDouble());
668 QVERIFY(max<caxis->max().toDouble());
661 break;
669 break;
662 }
670 }
663 default:
671 default:
664 qFatal("Unsupported type");
672 qFatal("Unsupported type");
665 break;
673 break;
666 }
674 }
667 }
675 }
668
676
669 void tst_QChart::scroll_down_data()
677 void tst_QChart::scroll_down_data()
670 {
678 {
671 scroll_right_data();
679 scroll_right_data();
672 }
680 }
673
681
674 void tst_QChart::scroll_down()
682 void tst_QChart::scroll_down()
675 {
683 {
676 QFETCH(QAbstractSeries *, series);
684 QFETCH(QAbstractSeries *, series);
677 m_chart->addSeries(series);
685 m_chart->addSeries(series);
678 m_chart->createDefaultAxes();
686 m_chart->createDefaultAxes();
679 m_view->show();
687 m_view->show();
680 QTest::qWaitForWindowShown(m_view);
688 QTest::qWaitForWindowShown(m_view);
681 QAbstractAxis * axis = m_chart->axisY();
689 QAbstractAxis * axis = m_chart->axisY();
682 QVERIFY(axis!=0);
690 QVERIFY(axis!=0);
683
691
684 switch(axis->type())
692 switch(axis->type())
685 {
693 {
686 case QAbstractAxis::AxisTypeValue:{
694 case QAbstractAxis::AxisTypeValue:{
687 QValueAxis* vaxis = qobject_cast<QValueAxis*>(axis);
695 QValueAxis* vaxis = qobject_cast<QValueAxis*>(axis);
688 QVERIFY(vaxis!=0);
696 QVERIFY(vaxis!=0);
689 qreal min = vaxis->min();
697 qreal min = vaxis->min();
690 qreal max = vaxis->max();
698 qreal max = vaxis->max();
691 m_chart->scroll(0, -50);
699 m_chart->scroll(0, -50);
692 QVERIFY(min>vaxis->min());
700 QVERIFY(min>vaxis->min());
693 QVERIFY(max>vaxis->max());
701 QVERIFY(max>vaxis->max());
694 break;
702 break;
695 }
703 }
696 case QAbstractAxis::AxisTypeBarCategory:{
704 case QAbstractAxis::AxisTypeBarCategory:{
697 QBarCategoryAxis* caxis = qobject_cast<QBarCategoryAxis*>(axis);
705 QBarCategoryAxis* caxis = qobject_cast<QBarCategoryAxis*>(axis);
698 QVERIFY(caxis!=0);
706 QVERIFY(caxis!=0);
699 qreal min = caxis->min().toDouble();
707 qreal min = caxis->min().toDouble();
700 qreal max = caxis->max().toDouble();
708 qreal max = caxis->max().toDouble();
701 m_chart->scroll(0, -50);
709 m_chart->scroll(0, -50);
702 QVERIFY(min>caxis->min().toDouble());
710 QVERIFY(min>caxis->min().toDouble());
703 QVERIFY(max>caxis->max().toDouble());
711 QVERIFY(max>caxis->max().toDouble());
704 break;
712 break;
705 }
713 }
706 default:
714 default:
707 qFatal("Unsupported type");
715 qFatal("Unsupported type");
708 break;
716 break;
709 }
717 }
710 }
718 }
711
719
712 void tst_QChart::theme_data()
720 void tst_QChart::theme_data()
713 {
721 {
714 QTest::addColumn<QChart::ChartTheme>("theme");
722 QTest::addColumn<QChart::ChartTheme>("theme");
715 QTest::newRow("ChartThemeBlueCerulean") << QChart::ChartThemeBlueCerulean;
723 QTest::newRow("ChartThemeBlueCerulean") << QChart::ChartThemeBlueCerulean;
716 QTest::newRow("ChartThemeBlueIcy") << QChart::ChartThemeBlueIcy;
724 QTest::newRow("ChartThemeBlueIcy") << QChart::ChartThemeBlueIcy;
717 QTest::newRow("ChartThemeBlueNcs") << QChart::ChartThemeBlueNcs;
725 QTest::newRow("ChartThemeBlueNcs") << QChart::ChartThemeBlueNcs;
718 QTest::newRow("ChartThemeBrownSand") << QChart::ChartThemeBrownSand;
726 QTest::newRow("ChartThemeBrownSand") << QChart::ChartThemeBrownSand;
719 QTest::newRow("ChartThemeDark") << QChart::ChartThemeDark;
727 QTest::newRow("ChartThemeDark") << QChart::ChartThemeDark;
720 QTest::newRow("hartThemeHighContrast") << QChart::ChartThemeHighContrast;
728 QTest::newRow("hartThemeHighContrast") << QChart::ChartThemeHighContrast;
721 QTest::newRow("ChartThemeLight") << QChart::ChartThemeLight;
729 QTest::newRow("ChartThemeLight") << QChart::ChartThemeLight;
722 QTest::newRow("ChartThemeQt") << QChart::ChartThemeQt;
730 QTest::newRow("ChartThemeQt") << QChart::ChartThemeQt;
723 }
731 }
724
732
725 void tst_QChart::theme()
733 void tst_QChart::theme()
726 {
734 {
727 QFETCH(QChart::ChartTheme, theme);
735 QFETCH(QChart::ChartTheme, theme);
728 createTestData();
736 createTestData();
729 m_chart->setTheme(theme);
737 m_chart->setTheme(theme);
730 QVERIFY(m_chart->theme()==theme);
738 QVERIFY(m_chart->theme()==theme);
731 }
739 }
732
740
733 void tst_QChart::title_data()
741 void tst_QChart::title_data()
734 {
742 {
735 QTest::addColumn<QString>("title");
743 QTest::addColumn<QString>("title");
736 QTest::newRow("null") << QString();
744 QTest::newRow("null") << QString();
737 QTest::newRow("foo") << QString("foo");
745 QTest::newRow("foo") << QString("foo");
738 }
746 }
739
747
740 void tst_QChart::title()
748 void tst_QChart::title()
741 {
749 {
742 QFETCH(QString, title);
750 QFETCH(QString, title);
743 m_chart->setTitle(title);
751 m_chart->setTitle(title);
744 QCOMPARE(m_chart->title(), title);
752 QCOMPARE(m_chart->title(), title);
745 }
753 }
746
754
747 void tst_QChart::titleBrush_data()
755 void tst_QChart::titleBrush_data()
748 {
756 {
749 QTest::addColumn<QBrush>("titleBrush");
757 QTest::addColumn<QBrush>("titleBrush");
750 QTest::newRow("null") << QBrush();
758 QTest::newRow("null") << QBrush();
751 QTest::newRow("blue") << QBrush(Qt::blue);
759 QTest::newRow("blue") << QBrush(Qt::blue);
752 QTest::newRow("white") << QBrush(Qt::white);
760 QTest::newRow("white") << QBrush(Qt::white);
753 QTest::newRow("black") << QBrush(Qt::black);
761 QTest::newRow("black") << QBrush(Qt::black);
754 }
762 }
755
763
756 void tst_QChart::titleBrush()
764 void tst_QChart::titleBrush()
757 {
765 {
758 QFETCH(QBrush, titleBrush);
766 QFETCH(QBrush, titleBrush);
759 m_chart->setTitleBrush(titleBrush);
767 m_chart->setTitleBrush(titleBrush);
760 QCOMPARE(m_chart->titleBrush().color(), titleBrush.color());
768 QCOMPARE(m_chart->titleBrush().color(), titleBrush.color());
761 }
769 }
762
770
763 void tst_QChart::titleFont_data()
771 void tst_QChart::titleFont_data()
764 {
772 {
765 QTest::addColumn<QFont>("titleFont");
773 QTest::addColumn<QFont>("titleFont");
766 QTest::newRow("null") << QFont();
774 QTest::newRow("null") << QFont();
767 QTest::newRow("courier") << QFont("Courier", 8, QFont::Bold, true);
775 QTest::newRow("courier") << QFont("Courier", 8, QFont::Bold, true);
768 }
776 }
769
777
770 void tst_QChart::titleFont()
778 void tst_QChart::titleFont()
771 {
779 {
772 QFETCH(QFont, titleFont);
780 QFETCH(QFont, titleFont);
773 m_chart->setTitleFont(titleFont);
781 m_chart->setTitleFont(titleFont);
774 QCOMPARE(m_chart->titleFont(), titleFont);
782 QCOMPARE(m_chart->titleFont(), titleFont);
775 }
783 }
776
784
777 void tst_QChart::zoomIn_data()
785 void tst_QChart::zoomIn_data()
778 {
786 {
779 QTest::addColumn<QRectF>("rect");
787 QTest::addColumn<QRectF>("rect");
780 QTest::newRow("null") << QRectF();
788 QTest::newRow("null") << QRectF();
781 QTest::newRow("100x100") << QRectF(10,10,100,100);
789 QTest::newRow("100x100") << QRectF(10,10,100,100);
782 QTest::newRow("200x200") << QRectF(10,10,200,200);
790 QTest::newRow("200x200") << QRectF(10,10,200,200);
783 }
791 }
784
792
785
793
786 void tst_QChart::zoomIn()
794 void tst_QChart::zoomIn()
787 {
795 {
788
796
789 QFETCH(QRectF, rect);
797 QFETCH(QRectF, rect);
790 createTestData();
798 createTestData();
791 m_chart->createDefaultAxes();
799 m_chart->createDefaultAxes();
792 QRectF marigns = m_chart->plotArea();
800 QRectF marigns = m_chart->plotArea();
793 rect.adjust(marigns.left(),marigns.top(),-marigns.right(),-marigns.bottom());
801 rect.adjust(marigns.left(),marigns.top(),-marigns.right(),-marigns.bottom());
794 QValueAxis* axisX = qobject_cast<QValueAxis*>(m_chart->axisX());
802 QValueAxis* axisX = qobject_cast<QValueAxis*>(m_chart->axisX());
795 QVERIFY(axisX!=0);
803 QVERIFY(axisX!=0);
796 QValueAxis* axisY = qobject_cast<QValueAxis*>(m_chart->axisY());
804 QValueAxis* axisY = qobject_cast<QValueAxis*>(m_chart->axisY());
797 QVERIFY(axisY!=0);
805 QVERIFY(axisY!=0);
798 qreal minX = axisX->min();
806 qreal minX = axisX->min();
799 qreal minY = axisY->min();
807 qreal minY = axisY->min();
800 qreal maxX = axisX->max();
808 qreal maxX = axisX->max();
801 qreal maxY = axisY->max();
809 qreal maxY = axisY->max();
802 m_chart->zoomIn(rect);
810 m_chart->zoomIn(rect);
803 if(rect.isValid()){
811 if(rect.isValid()){
804 QVERIFY(minX<axisX->min());
812 QVERIFY(minX<axisX->min());
805 QVERIFY(maxX>axisX->max());
813 QVERIFY(maxX>axisX->max());
806 QVERIFY(minY<axisY->min());
814 QVERIFY(minY<axisY->min());
807 QVERIFY(maxY>axisY->max());
815 QVERIFY(maxY>axisY->max());
808 }
816 }
809
817
810 }
818 }
811
819
812 void tst_QChart::zoomOut_data()
820 void tst_QChart::zoomOut_data()
813 {
821 {
814
822
815 }
823 }
816
824
817 void tst_QChart::zoomOut()
825 void tst_QChart::zoomOut()
818 {
826 {
819 createTestData();
827 createTestData();
820 m_chart->createDefaultAxes();
828 m_chart->createDefaultAxes();
821
829
822 QValueAxis* axisX = qobject_cast<QValueAxis*>(m_chart->axisX());
830 QValueAxis* axisX = qobject_cast<QValueAxis*>(m_chart->axisX());
823 QVERIFY(axisX!=0);
831 QVERIFY(axisX!=0);
824 QValueAxis* axisY = qobject_cast<QValueAxis*>(m_chart->axisY());
832 QValueAxis* axisY = qobject_cast<QValueAxis*>(m_chart->axisY());
825 QVERIFY(axisY!=0);
833 QVERIFY(axisY!=0);
826
834
827 qreal minX = axisX->min();
835 qreal minX = axisX->min();
828 qreal minY = axisY->min();
836 qreal minY = axisY->min();
829 qreal maxX = axisX->max();
837 qreal maxX = axisX->max();
830 qreal maxY = axisY->max();
838 qreal maxY = axisY->max();
831
839
832 m_chart->zoomIn();
840 m_chart->zoomIn();
833
841
834 QVERIFY(minX < axisX->min());
842 QVERIFY(minX < axisX->min());
835 QVERIFY(maxX > axisX->max());
843 QVERIFY(maxX > axisX->max());
836 QVERIFY(minY < axisY->min());
844 QVERIFY(minY < axisY->min());
837 QVERIFY(maxY > axisY->max());
845 QVERIFY(maxY > axisY->max());
838
846
839 m_chart->zoomOut();
847 m_chart->zoomOut();
840
848
841 // min x may be a zero value
849 // min x may be a zero value
842 if (qFuzzyIsNull(minX))
850 if (qFuzzyIsNull(minX))
843 QVERIFY(qFuzzyIsNull(axisX->min()));
851 QVERIFY(qFuzzyIsNull(axisX->min()));
844 else
852 else
845 QCOMPARE(minX, axisX->min());
853 QCOMPARE(minX, axisX->min());
846
854
847 // min y may be a zero value
855 // min y may be a zero value
848 if (qFuzzyIsNull(minY))
856 if (qFuzzyIsNull(minY))
849 QVERIFY(qFuzzyIsNull(axisY->min()));
857 QVERIFY(qFuzzyIsNull(axisY->min()));
850 else
858 else
851 QCOMPARE(minY, axisY->min());
859 QCOMPARE(minY, axisY->min());
852
860
853 QVERIFY(maxX == axisX->max());
861 QVERIFY(maxX == axisX->max());
854 QVERIFY(maxY == axisY->max());
862 QVERIFY(maxY == axisY->max());
855
863
856 }
864 }
857
865
858 void tst_QChart::zoomReset()
866 void tst_QChart::zoomReset()
859 {
867 {
860 createTestData();
868 createTestData();
861 m_chart->createDefaultAxes();
869 m_chart->createDefaultAxes();
862 QValueAxis *axisX = qobject_cast<QValueAxis *>(m_chart->axisX());
870 QValueAxis *axisX = qobject_cast<QValueAxis *>(m_chart->axisX());
863 QVERIFY(axisX != 0);
871 QVERIFY(axisX != 0);
864 QValueAxis *axisY = qobject_cast<QValueAxis *>(m_chart->axisY());
872 QValueAxis *axisY = qobject_cast<QValueAxis *>(m_chart->axisY());
865 QVERIFY(axisY != 0);
873 QVERIFY(axisY != 0);
866
874
867 qreal minX = axisX->min();
875 qreal minX = axisX->min();
868 qreal minY = axisY->min();
876 qreal minY = axisY->min();
869 qreal maxX = axisX->max();
877 qreal maxX = axisX->max();
870 qreal maxY = axisY->max();
878 qreal maxY = axisY->max();
871
879
872 QVERIFY(!m_chart->isZoomed());
880 QVERIFY(!m_chart->isZoomed());
873
881
874 m_chart->zoomIn();
882 m_chart->zoomIn();
875
883
876 QVERIFY(m_chart->isZoomed());
884 QVERIFY(m_chart->isZoomed());
877 QVERIFY(minX < axisX->min());
885 QVERIFY(minX < axisX->min());
878 QVERIFY(maxX > axisX->max());
886 QVERIFY(maxX > axisX->max());
879 QVERIFY(minY < axisY->min());
887 QVERIFY(minY < axisY->min());
880 QVERIFY(maxY > axisY->max());
888 QVERIFY(maxY > axisY->max());
881
889
882 m_chart->zoomReset();
890 m_chart->zoomReset();
883
891
884 // Reset after zoomIn should restore originals
892 // Reset after zoomIn should restore originals
885 QVERIFY(!m_chart->isZoomed());
893 QVERIFY(!m_chart->isZoomed());
886 QVERIFY(minX == axisX->min());
894 QVERIFY(minX == axisX->min());
887 QVERIFY(maxX == axisX->max());
895 QVERIFY(maxX == axisX->max());
888 QVERIFY(minY == axisY->min());
896 QVERIFY(minY == axisY->min());
889 QVERIFY(maxY == axisY->max());
897 QVERIFY(maxY == axisY->max());
890
898
891 m_chart->zoomOut();
899 m_chart->zoomOut();
892
900
893 QVERIFY(m_chart->isZoomed());
901 QVERIFY(m_chart->isZoomed());
894 QVERIFY(minX > axisX->min());
902 QVERIFY(minX > axisX->min());
895 QVERIFY(maxX < axisX->max());
903 QVERIFY(maxX < axisX->max());
896 QVERIFY(minY > axisY->min());
904 QVERIFY(minY > axisY->min());
897 QVERIFY(maxY < axisY->max());
905 QVERIFY(maxY < axisY->max());
898
906
899 m_chart->zoomReset();
907 m_chart->zoomReset();
900
908
901 // Reset after zoomOut should restore originals
909 // Reset after zoomOut should restore originals
902 QVERIFY(!m_chart->isZoomed());
910 QVERIFY(!m_chart->isZoomed());
903 QVERIFY(minX == axisX->min());
911 QVERIFY(minX == axisX->min());
904 QVERIFY(maxX == axisX->max());
912 QVERIFY(maxX == axisX->max());
905 QVERIFY(minY == axisY->min());
913 QVERIFY(minY == axisY->min());
906 QVERIFY(maxY == axisY->max());
914 QVERIFY(maxY == axisY->max());
907
915
908 axisX->setRange(234, 345);
916 axisX->setRange(234, 345);
909 axisY->setRange(345, 456);
917 axisY->setRange(345, 456);
910
918
911 minX = axisX->min();
919 minX = axisX->min();
912 minY = axisY->min();
920 minY = axisY->min();
913 maxX = axisX->max();
921 maxX = axisX->max();
914 maxY = axisY->max();
922 maxY = axisY->max();
915
923
916 QVERIFY(!m_chart->isZoomed());
924 QVERIFY(!m_chart->isZoomed());
917
925
918 m_chart->zoomReset();
926 m_chart->zoomReset();
919
927
920 // Reset without zoom should not change anything
928 // Reset without zoom should not change anything
921 QVERIFY(!m_chart->isZoomed());
929 QVERIFY(!m_chart->isZoomed());
922 QVERIFY(minX == axisX->min());
930 QVERIFY(minX == axisX->min());
923 QVERIFY(maxX == axisX->max());
931 QVERIFY(maxX == axisX->max());
924 QVERIFY(minY == axisY->min());
932 QVERIFY(minY == axisY->min());
925 QVERIFY(maxY == axisY->max());
933 QVERIFY(maxY == axisY->max());
926
934
927 }
935 }
928
936
929 void tst_QChart::createDefaultAxesForLineSeries_data()
937 void tst_QChart::createDefaultAxesForLineSeries_data()
930 {
938 {
931 QTest::addColumn<qreal>("series1minX");
939 QTest::addColumn<qreal>("series1minX");
932 QTest::addColumn<qreal>("series1midX");
940 QTest::addColumn<qreal>("series1midX");
933 QTest::addColumn<qreal>("series1maxX");
941 QTest::addColumn<qreal>("series1maxX");
934 QTest::addColumn<qreal>("series2minX");
942 QTest::addColumn<qreal>("series2minX");
935 QTest::addColumn<qreal>("series2midX");
943 QTest::addColumn<qreal>("series2midX");
936 QTest::addColumn<qreal>("series2maxX");
944 QTest::addColumn<qreal>("series2maxX");
937 QTest::addColumn<qreal>("overallminX");
945 QTest::addColumn<qreal>("overallminX");
938 QTest::addColumn<qreal>("overallmaxX");
946 QTest::addColumn<qreal>("overallmaxX");
939 QTest::addColumn<qreal>("series1minY");
947 QTest::addColumn<qreal>("series1minY");
940 QTest::addColumn<qreal>("series1midY");
948 QTest::addColumn<qreal>("series1midY");
941 QTest::addColumn<qreal>("series1maxY");
949 QTest::addColumn<qreal>("series1maxY");
942 QTest::addColumn<qreal>("series2minY");
950 QTest::addColumn<qreal>("series2minY");
943 QTest::addColumn<qreal>("series2midY");
951 QTest::addColumn<qreal>("series2midY");
944 QTest::addColumn<qreal>("series2maxY");
952 QTest::addColumn<qreal>("series2maxY");
945 QTest::addColumn<qreal>("overallminY");
953 QTest::addColumn<qreal>("overallminY");
946 QTest::addColumn<qreal>("overallmaxY");
954 QTest::addColumn<qreal>("overallmaxY");
947 QTest::newRow("series1hasMinAndMax") << (qreal)1.0 << (qreal)2.0 << (qreal)3.0 << (qreal)1.1 << (qreal)1.7 << (qreal)2.9 << (qreal)1.0 << (qreal)3.0
955 QTest::newRow("series1hasMinAndMax") << (qreal)1.0 << (qreal)2.0 << (qreal)3.0 << (qreal)1.1 << (qreal)1.7 << (qreal)2.9 << (qreal)1.0 << (qreal)3.0
948 << (qreal)1.0 << (qreal)2.0 << (qreal)3.0 << (qreal)1.1 << (qreal)1.7 << (qreal)2.9 << (qreal)1.0 << (qreal)3.0;
956 << (qreal)1.0 << (qreal)2.0 << (qreal)3.0 << (qreal)1.1 << (qreal)1.7 << (qreal)2.9 << (qreal)1.0 << (qreal)3.0;
949 QTest::newRow("series2hasMinAndMax") << (qreal)1.1 << (qreal)2.0 << (qreal)2.9 << (qreal)1.0 << (qreal)1.7 << (qreal)3.0 << (qreal)1.0 << (qreal)3.0
957 QTest::newRow("series2hasMinAndMax") << (qreal)1.1 << (qreal)2.0 << (qreal)2.9 << (qreal)1.0 << (qreal)1.7 << (qreal)3.0 << (qreal)1.0 << (qreal)3.0
950 << (qreal)1.1 << (qreal)2.0 << (qreal)2.9 << (qreal)1.0 << (qreal)1.7 << (qreal)3.0 << (qreal)1.0 << (qreal)3.0;
958 << (qreal)1.1 << (qreal)2.0 << (qreal)2.9 << (qreal)1.0 << (qreal)1.7 << (qreal)3.0 << (qreal)1.0 << (qreal)3.0;
951 QTest::newRow("series1hasMinAndMaxX_series2hasMinAndMaxY") << (qreal)1.0 << (qreal)2.0 << (qreal)3.0 << (qreal)1.1 << (qreal)1.7 << (qreal)2.9 << (qreal)1.0 << (qreal)3.0
959 QTest::newRow("series1hasMinAndMaxX_series2hasMinAndMaxY") << (qreal)1.0 << (qreal)2.0 << (qreal)3.0 << (qreal)1.1 << (qreal)1.7 << (qreal)2.9 << (qreal)1.0 << (qreal)3.0
952 << (qreal)1.1 << (qreal)2.0 << (qreal)2.9 << (qreal)1.0 << (qreal)2.0 << (qreal)3.0 << (qreal)1.0 << (qreal)3.0;
960 << (qreal)1.1 << (qreal)2.0 << (qreal)2.9 << (qreal)1.0 << (qreal)2.0 << (qreal)3.0 << (qreal)1.0 << (qreal)3.0;
953 QTest::newRow("series1hasMin_series2hasMax") << (qreal)1.0 << (qreal)2.0 << (qreal)2.9 << (qreal)1.1 << (qreal)1.7 << (qreal)3.0 << (qreal)1.0 << (qreal)3.0
961 QTest::newRow("series1hasMin_series2hasMax") << (qreal)1.0 << (qreal)2.0 << (qreal)2.9 << (qreal)1.1 << (qreal)1.7 << (qreal)3.0 << (qreal)1.0 << (qreal)3.0
954 << (qreal)1.0 << (qreal)2.0 << (qreal)2.9 << (qreal)1.1 << (qreal)1.7 << (qreal)3.0 << (qreal)1.0 << (qreal)3.0;
962 << (qreal)1.0 << (qreal)2.0 << (qreal)2.9 << (qreal)1.1 << (qreal)1.7 << (qreal)3.0 << (qreal)1.0 << (qreal)3.0;
955 QTest::newRow("bothSeriesHaveSameMinAndMax") << (qreal)1.0 << (qreal)2.0 << (qreal)2.9 << (qreal)1.1 << (qreal)1.7 << (qreal)3.0 << (qreal)1.0 << (qreal)3.0
963 QTest::newRow("bothSeriesHaveSameMinAndMax") << (qreal)1.0 << (qreal)2.0 << (qreal)2.9 << (qreal)1.1 << (qreal)1.7 << (qreal)3.0 << (qreal)1.0 << (qreal)3.0
956 << (qreal)1.1 << (qreal)1.1 << (qreal)1.1 << (qreal)1.1 << (qreal)1.1 << (qreal)1.1 << (qreal)0.6 << (qreal)1.6;
964 << (qreal)1.1 << (qreal)1.1 << (qreal)1.1 << (qreal)1.1 << (qreal)1.1 << (qreal)1.1 << (qreal)0.6 << (qreal)1.6;
957 }
965 }
958
966
959 void tst_QChart::createDefaultAxesForLineSeries()
967 void tst_QChart::createDefaultAxesForLineSeries()
960 {
968 {
961 QFETCH(qreal, series1minX);
969 QFETCH(qreal, series1minX);
962 QFETCH(qreal, series1midX);
970 QFETCH(qreal, series1midX);
963 QFETCH(qreal, series1maxX);
971 QFETCH(qreal, series1maxX);
964 QFETCH(qreal, series2minX);
972 QFETCH(qreal, series2minX);
965 QFETCH(qreal, series2midX);
973 QFETCH(qreal, series2midX);
966 QFETCH(qreal, series2maxX);
974 QFETCH(qreal, series2maxX);
967 QFETCH(qreal, series1minY);
975 QFETCH(qreal, series1minY);
968 QFETCH(qreal, series1midY);
976 QFETCH(qreal, series1midY);
969 QFETCH(qreal, series1maxY);
977 QFETCH(qreal, series1maxY);
970 QFETCH(qreal, series2minY);
978 QFETCH(qreal, series2minY);
971 QFETCH(qreal, series2midY);
979 QFETCH(qreal, series2midY);
972 QFETCH(qreal, series2maxY);
980 QFETCH(qreal, series2maxY);
973 QFETCH(qreal, overallminX);
981 QFETCH(qreal, overallminX);
974 QFETCH(qreal, overallmaxX);
982 QFETCH(qreal, overallmaxX);
975 QFETCH(qreal, overallminY);
983 QFETCH(qreal, overallminY);
976 QFETCH(qreal, overallmaxY);
984 QFETCH(qreal, overallmaxY);
977 QLineSeries* series1 = new QLineSeries(this);
985 QLineSeries* series1 = new QLineSeries(this);
978 series1->append(series1minX, series1minY);
986 series1->append(series1minX, series1minY);
979 series1->append(series1midX, series1midY);
987 series1->append(series1midX, series1midY);
980 series1->append(series1maxX, series1maxY);
988 series1->append(series1maxX, series1maxY);
981 QLineSeries* series2 = new QLineSeries(this);
989 QLineSeries* series2 = new QLineSeries(this);
982 series2->append(series2minX, series2minY);
990 series2->append(series2minX, series2minY);
983 series2->append(series2midX, series2midY);
991 series2->append(series2midX, series2midY);
984 series2->append(series2maxX, series2maxY);
992 series2->append(series2maxX, series2maxY);
985 QChart *chart = newQChartOrQPolarChart();
993 QChart *chart = newQChartOrQPolarChart();
986 chart->addSeries(series1);
994 chart->addSeries(series1);
987 chart->addSeries(series2);
995 chart->addSeries(series2);
988 chart->createDefaultAxes();
996 chart->createDefaultAxes();
989 QValueAxis *xAxis = (QValueAxis *)chart->axisX();
997 QValueAxis *xAxis = (QValueAxis *)chart->axisX();
990 QCOMPARE(xAxis->min(), overallminX);
998 QCOMPARE(xAxis->min(), overallminX);
991 QCOMPARE(xAxis->max(), overallmaxX);
999 QCOMPARE(xAxis->max(), overallmaxX);
992 QValueAxis *yAxis = (QValueAxis *)chart->axisY();
1000 QValueAxis *yAxis = (QValueAxis *)chart->axisY();
993 QCOMPARE(yAxis->min(), overallminY);
1001 QCOMPARE(yAxis->min(), overallminY);
994 QCOMPARE(yAxis->max(), overallmaxY);
1002 QCOMPARE(yAxis->max(), overallmaxY);
995 QLineSeries *series3 = new QLineSeries(this);
1003 QLineSeries *series3 = new QLineSeries(this);
996 // Numbers clearly out of existing range
1004 // Numbers clearly out of existing range
997 series3->append(0, 0);
1005 series3->append(0, 0);
998 series3->append(100, 100);
1006 series3->append(100, 100);
999 // Adding a new series should not change the axes as they have not been told to update
1007 // Adding a new series should not change the axes as they have not been told to update
1000 chart->addSeries(series3);
1008 chart->addSeries(series3);
1001 QCOMPARE(xAxis->min(), overallminX);
1009 QCOMPARE(xAxis->min(), overallminX);
1002 QCOMPARE(xAxis->max(), overallmaxX);
1010 QCOMPARE(xAxis->max(), overallmaxX);
1003 QCOMPARE(yAxis->min(), overallminY);
1011 QCOMPARE(yAxis->min(), overallminY);
1004 QCOMPARE(yAxis->max(), overallmaxY);
1012 QCOMPARE(yAxis->max(), overallmaxY);
1005 }
1013 }
1006
1014
1007 void tst_QChart::axisPolarOrientation()
1015 void tst_QChart::axisPolarOrientation()
1008 {
1016 {
1009 QLineSeries* series1 = new QLineSeries(this);
1017 QLineSeries* series1 = new QLineSeries(this);
1010 series1->append(1, 2);
1018 series1->append(1, 2);
1011 series1->append(2, 4);
1019 series1->append(2, 4);
1012 series1->append(3, 8);
1020 series1->append(3, 8);
1013 QPolarChart chart;
1021 QPolarChart chart;
1014 chart.addSeries(series1);
1022 chart.addSeries(series1);
1015
1023
1016 QValueAxis *xAxis = new QValueAxis();
1024 QValueAxis *xAxis = new QValueAxis();
1017 QValueAxis *yAxis = new QValueAxis();
1025 QValueAxis *yAxis = new QValueAxis();
1018 chart.addAxis(xAxis, QPolarChart::PolarOrientationAngular);
1026 chart.addAxis(xAxis, QPolarChart::PolarOrientationAngular);
1019 chart.addAxis(yAxis, QPolarChart::PolarOrientationRadial);
1027 chart.addAxis(yAxis, QPolarChart::PolarOrientationRadial);
1020
1028
1021 QList<QAbstractAxis *> xAxes = chart.axes(QPolarChart::PolarOrientationAngular);
1029 QList<QAbstractAxis *> xAxes = chart.axes(QPolarChart::PolarOrientationAngular);
1022 QList<QAbstractAxis *> yAxes = chart.axes(QPolarChart::PolarOrientationRadial);
1030 QList<QAbstractAxis *> yAxes = chart.axes(QPolarChart::PolarOrientationRadial);
1023
1031
1024 QCOMPARE(xAxes.size(), 1);
1032 QCOMPARE(xAxes.size(), 1);
1025 QCOMPARE(yAxes.size(), 1);
1033 QCOMPARE(yAxes.size(), 1);
1026 QCOMPARE(xAxes[0], xAxis);
1034 QCOMPARE(xAxes[0], xAxis);
1027 QCOMPARE(yAxes[0], yAxis);
1035 QCOMPARE(yAxes[0], yAxis);
1028
1036
1029 QCOMPARE(chart.axisPolarOrientation(xAxes[0]), QPolarChart::PolarOrientationAngular);
1037 QCOMPARE(chart.axisPolarOrientation(xAxes[0]), QPolarChart::PolarOrientationAngular);
1030 QCOMPARE(chart.axisPolarOrientation(yAxes[0]), QPolarChart::PolarOrientationRadial);
1038 QCOMPARE(chart.axisPolarOrientation(yAxes[0]), QPolarChart::PolarOrientationRadial);
1031 }
1039 }
1032
1040
1033 void tst_QChart::backgroundRoundness()
1041 void tst_QChart::backgroundRoundness()
1034 {
1042 {
1035 createTestData();
1043 createTestData();
1036 m_chart->createDefaultAxes();
1044 m_chart->createDefaultAxes();
1037 m_chart->setBackgroundRoundness(100.0);
1045 m_chart->setBackgroundRoundness(100.0);
1038 QVERIFY(m_chart->backgroundRoundness() == 100.0);
1046 QVERIFY(m_chart->backgroundRoundness() == 100.0);
1039 }
1047 }
1040
1048
1041 QTEST_MAIN(tst_QChart)
1049 QTEST_MAIN(tst_QChart)
1042 #include "tst_qchart.moc"
1050 #include "tst_qchart.moc"
1043
1051
@@ -1,79 +1,80
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2013 Digia Plc
3 ** Copyright (C) 2013 Digia Plc
4 ** All rights reserved.
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
6 **
7 ** This file is part of the Qt Enterprise Charts Add-on.
7 ** This file is part of the Qt Enterprise Charts Add-on.
8 **
8 **
9 ** $QT_BEGIN_LICENSE$
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
11 ** accordance with the Qt Enterprise License Agreement provided with the
11 ** accordance with the Qt Enterprise License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
13 ** a written agreement between you and Digia.
14 **
14 **
15 ** If you have questions regarding the use of this file, please use
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
17 ** $QT_END_LICENSE$
18 **
18 **
19 ****************************************************************************/
19 ****************************************************************************/
20
20
21 import QtQuick 2.0
21 import QtQuick 2.0
22 import QtTest 1.0
22 import QtTest 1.0
23 import QtCommercial.Chart 1.3
23 import QtCommercial.Chart 1.3
24
24
25 Rectangle {
25 Rectangle {
26 width: 400
26 width: 400
27 height: 300
27 height: 300
28
28
29 TestCase {
29 TestCase {
30 id: tc1
30 id: tc1
31 name: "tst_qml-qtquicktest ChartView Properties"
31 name: "tst_qml-qtquicktest ChartView Properties"
32 when: windowShown
32 when: windowShown
33
33
34 function test_chartViewProperties() {
34 function test_chartViewProperties() {
35 compare(chartView.animationOptions, ChartView.NoAnimation, "ChartView.animationOptions");
35 compare(chartView.animationOptions, ChartView.NoAnimation, "ChartView.animationOptions");
36 verify(chartView.backgroundColor != undefined);
36 verify(chartView.backgroundColor != undefined);
37 verify(chartView.margins.bottom > 0, "ChartView.margins.bottom");
37 verify(chartView.margins.bottom > 0, "ChartView.margins.bottom");
38 verify(chartView.margins.top > 0, "ChartView.margins.top");
38 verify(chartView.margins.top > 0, "ChartView.margins.top");
39 verify(chartView.margins.left > 0, "ChartView.margins.left");
39 verify(chartView.margins.left > 0, "ChartView.margins.left");
40 verify(chartView.margins.right > 0, "ChartView.margins.right");
40 verify(chartView.margins.right > 0, "ChartView.margins.right");
41 compare(chartView.count, 0, "ChartView.count");
41 compare(chartView.count, 0, "ChartView.count");
42 compare(chartView.dropShadowEnabled, false, "ChartView.dropShadowEnabled");
42 compare(chartView.dropShadowEnabled, false, "ChartView.dropShadowEnabled");
43 verify(chartView.plotArea.height > 0, "ChartView.plotArea.height");
43 verify(chartView.plotArea.height > 0, "ChartView.plotArea.height");
44 verify(chartView.plotArea.width > 0, "ChartView.plotArea.width");
44 verify(chartView.plotArea.width > 0, "ChartView.plotArea.width");
45 verify(chartView.plotArea.x > 0, "ChartView.plotArea.x");
45 verify(chartView.plotArea.x > 0, "ChartView.plotArea.x");
46 verify(chartView.plotArea.y > 0, "ChartView.plotArea.y");
46 verify(chartView.plotArea.y > 0, "ChartView.plotArea.y");
47 compare(chartView.theme, ChartView.ChartThemeLight, "ChartView.theme");
47 compare(chartView.theme, ChartView.ChartThemeLight, "ChartView.theme");
48 compare(chartView.title, "", "ChartView.title");
48 compare(chartView.title, "", "ChartView.title");
49 compare(chartView.title, "", "ChartView.title");
49 compare(chartView.title, "", "ChartView.title");
50 verify(chartView.titleColor != undefined, "ChartView.titleColor");
50 verify(chartView.titleColor != undefined, "ChartView.titleColor");
51 compare(chartView.titleFont.bold, false, "ChartView.titleFont.bold");
51 compare(chartView.titleFont.bold, false, "ChartView.titleFont.bold");
52 // Legend
52 // Legend
53 compare(chartView.legend.visible, true, "ChartView.legend.visible");
53 compare(chartView.legend.visible, true, "ChartView.legend.visible");
54 compare(chartView.legend.alignment, Qt.AlignTop, "ChartView.legend.alignment");
54 compare(chartView.legend.alignment, Qt.AlignTop, "ChartView.legend.alignment");
55 compare(chartView.legend.backgroundVisible, false, "ChartView.legend.backgroundVisible");
55 compare(chartView.legend.backgroundVisible, false, "ChartView.legend.backgroundVisible");
56 verify(chartView.legend.borderColor != undefined, "ChartView.legend.borderColor");
56 verify(chartView.legend.borderColor != undefined, "ChartView.legend.borderColor");
57 verify(chartView.legend.color != undefined, "ChartView.legend.color");
57 verify(chartView.legend.color != undefined, "ChartView.legend.color");
58 compare(chartView.legend.reverseMarkers, false, "ChartView.legend.reverseMarkers");
58 // Legend font
59 // Legend font
59 compare(chartView.legend.font.bold, false, "ChartView.legend.font.bold");
60 compare(chartView.legend.font.bold, false, "ChartView.legend.font.bold");
60 compare(chartView.legend.font.capitalization, Font.MixedCase, "ChartView.legend.font.capitalization");
61 compare(chartView.legend.font.capitalization, Font.MixedCase, "ChartView.legend.font.capitalization");
61 verify(chartView.legend.font.family != "", "ChartView.legend.font.family");
62 verify(chartView.legend.font.family != "", "ChartView.legend.font.family");
62 compare(chartView.legend.font.italic, false, "ChartView.legend.font.italic");
63 compare(chartView.legend.font.italic, false, "ChartView.legend.font.italic");
63 compare(chartView.legend.font.letterSpacing, 0.0, "ChartView.legend.font.letterSpacing");
64 compare(chartView.legend.font.letterSpacing, 0.0, "ChartView.legend.font.letterSpacing");
64 verify(chartView.legend.font.pixelSize > 0
65 verify(chartView.legend.font.pixelSize > 0
65 && chartView.legend.font.pixelSize < 50, "ChartView.legend.font.pixelSize");
66 && chartView.legend.font.pixelSize < 50, "ChartView.legend.font.pixelSize");
66 verify(chartView.legend.font.pointSize > 0
67 verify(chartView.legend.font.pointSize > 0
67 && chartView.legend.font.pointSize < 50, "ChartView.legend.font.pointSize");
68 && chartView.legend.font.pointSize < 50, "ChartView.legend.font.pointSize");
68 compare(chartView.legend.font.strikeout, false, "ChartView.legend.font.strikeout");
69 compare(chartView.legend.font.strikeout, false, "ChartView.legend.font.strikeout");
69 compare(chartView.legend.font.underline, false, "ChartView.legend.font.underline");
70 compare(chartView.legend.font.underline, false, "ChartView.legend.font.underline");
70 compare(chartView.legend.font.weight, Font.Normal, "ChartView.legend.font.weight");
71 compare(chartView.legend.font.weight, Font.Normal, "ChartView.legend.font.weight");
71 compare(chartView.legend.font.wordSpacing, 0.0, "ChartView.legend.font.wordSpacing");
72 compare(chartView.legend.font.wordSpacing, 0.0, "ChartView.legend.font.wordSpacing");
72 }
73 }
73 }
74 }
74
75
75 ChartView {
76 ChartView {
76 id: chartView
77 id: chartView
77 anchors.fill: parent
78 anchors.fill: parent
78 }
79 }
79 }
80 }
@@ -1,108 +1,110
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2013 Digia Plc
3 ** Copyright (C) 2013 Digia Plc
4 ** All rights reserved.
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
6 **
7 ** This file is part of the Qt Enterprise Charts Add-on.
7 ** This file is part of the Qt Enterprise Charts Add-on.
8 **
8 **
9 ** $QT_BEGIN_LICENSE$
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
11 ** accordance with the Qt Enterprise License Agreement provided with the
11 ** accordance with the Qt Enterprise License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
13 ** a written agreement between you and Digia.
14 **
14 **
15 ** If you have questions regarding the use of this file, please use
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
17 ** $QT_END_LICENSE$
18 **
18 **
19 ****************************************************************************/
19 ****************************************************************************/
20
20
21 import QtQuick 1.0
21 import QtQuick 1.0
22 import QtCommercial.Chart 1.3
22 import QtCommercial.Chart 1.3
23
23
24 ChartView {
24 ChartView {
25 id: chartView
25 id: chartView
26 title: "Chart Title"
26 title: "Chart Title"
27 anchors.fill: parent
27 anchors.fill: parent
28 property variant chart: chartView
28 property variant chart: chartView
29
29
30 LineSeries {
30 LineSeries {
31 name: "line"
31 name: "line"
32 XYPoint { x: 0; y: 0 }
32 XYPoint { x: 0; y: 0 }
33 XYPoint { x: 1.1; y: 2.1 }
33 XYPoint { x: 1.1; y: 2.1 }
34 XYPoint { x: 1.9; y: 3.3 }
34 XYPoint { x: 1.9; y: 3.3 }
35 XYPoint { x: 2.1; y: 2.1 }
35 XYPoint { x: 2.1; y: 2.1 }
36 XYPoint { x: 2.9; y: 4.9 }
36 XYPoint { x: 2.9; y: 4.9 }
37 XYPoint { x: 3.4; y: 3.0 }
37 XYPoint { x: 3.4; y: 3.0 }
38 XYPoint { x: 4.1; y: 3.3 }
38 XYPoint { x: 4.1; y: 3.3 }
39 }
39 }
40
40
41 onVisibleChanged: console.log("chart.onVisibleChanged: " + visible);
41 onVisibleChanged: console.log("chart.onVisibleChanged: " + visible);
42 onTitleColorChanged: console.log("chart.onTitleColorChanged: " + color);
42 onTitleColorChanged: console.log("chart.onTitleColorChanged: " + color);
43 onBackgroundColorChanged: console.log("chart.onBackgroundColorChanged: " + chart.backgroundColor);
43 onBackgroundColorChanged: console.log("chart.onBackgroundColorChanged: " + chart.backgroundColor);
44 onDropShadowEnabledChanged: console.log("chart.onDropShadowEnabledChanged: " + enabled);
44 onDropShadowEnabledChanged: console.log("chart.onDropShadowEnabledChanged: " + enabled);
45 onBackgroundRoundnessChanged: console.log("chart.onBackgroundRoundnessChanged: " + diameter);
45 onBackgroundRoundnessChanged: console.log("chart.onBackgroundRoundnessChanged: " + diameter);
46 onSeriesAdded: console.log("chart.onSeriesAdded: " + series.name);
46 onSeriesAdded: console.log("chart.onSeriesAdded: " + series.name);
47 onSeriesRemoved: console.log("chart.onSeriesRemoved: " + series.name);
47 onSeriesRemoved: console.log("chart.onSeriesRemoved: " + series.name);
48 onPlotAreaColorChanged: console.log("chart.plotAreaColorChanged: " + chart.plotAreaColor);
48 onPlotAreaColorChanged: console.log("chart.plotAreaColorChanged: " + chart.plotAreaColor);
49
49
50 legend.onVisibleChanged: console.log("legend.onVisibleChanged: " + chart.legend.visible);
50 legend.onVisibleChanged: console.log("legend.onVisibleChanged: " + chart.legend.visible);
51 legend.onBackgroundVisibleChanged: console.log("legend.onBackgroundVisibleChanged: " + visible);
51 legend.onBackgroundVisibleChanged: console.log("legend.onBackgroundVisibleChanged: " + visible);
52 legend.onColorChanged: console.log("legend.onColorChanged: " + color);
52 legend.onColorChanged: console.log("legend.onColorChanged: " + color);
53 legend.onBorderColorChanged: console.log("legend.onBorderColorChanged: " + color);
53 legend.onBorderColorChanged: console.log("legend.onBorderColorChanged: " + color);
54 legend.onLabelColorChanged: console.log("legend.onLabelColorChanged: " + color);
54 legend.onLabelColorChanged: console.log("legend.onLabelColorChanged: " + color);
55 legend.onReverseMarkersChanged: console.log("legend.onReverseMarkersChanged: "
56 + chart.legend.reverseMarkers)
55 margins.onTopChanged: console.log("chart.margins.onTopChanged: " + top );
57 margins.onTopChanged: console.log("chart.margins.onTopChanged: " + top );
56 margins.onBottomChanged: console.log("chart.margins.onBottomChanged: " + bottom);
58 margins.onBottomChanged: console.log("chart.margins.onBottomChanged: " + bottom);
57 margins.onLeftChanged: console.log("chart.margins.onLeftChanged: " + left);
59 margins.onLeftChanged: console.log("chart.margins.onLeftChanged: " + left);
58 margins.onRightChanged: console.log("chart.margins.onRightChanged: " + right);
60 margins.onRightChanged: console.log("chart.margins.onRightChanged: " + right);
59 onPlotAreaChanged: {
61 onPlotAreaChanged: {
60 console.log("chart.onPlotAreaChanged, width: " + chartView.plotArea.width
62 console.log("chart.onPlotAreaChanged, width: " + chartView.plotArea.width
61 + " height: " + chartView.plotArea.height
63 + " height: " + chartView.plotArea.height
62 + " y: " + chartView.plotArea.y
64 + " y: " + chartView.plotArea.y
63 + " x: " + chartView.plotArea.x);
65 + " x: " + chartView.plotArea.x);
64 marginVisualizer.opacity = 1.0;
66 marginVisualizer.opacity = 1.0;
65 }
67 }
66
68
67 ValueAxis{
69 ValueAxis{
68 onColorChanged: console.log("axisX.onColorChanged: " + color);
70 onColorChanged: console.log("axisX.onColorChanged: " + color);
69 onLabelsVisibleChanged: console.log("axisX.onLabelsVisibleChanged: " + visible);
71 onLabelsVisibleChanged: console.log("axisX.onLabelsVisibleChanged: " + visible);
70 onLabelsColorChanged: console.log("axisX.onLabelsColorChanged: " + color);
72 onLabelsColorChanged: console.log("axisX.onLabelsColorChanged: " + color);
71 onVisibleChanged: console.log("axisX.onVisibleChanged: " + visible);
73 onVisibleChanged: console.log("axisX.onVisibleChanged: " + visible);
72 onGridVisibleChanged: console.log("axisX.onGridVisibleChanged: " + visible);
74 onGridVisibleChanged: console.log("axisX.onGridVisibleChanged: " + visible);
73 onShadesVisibleChanged: console.log("axisX.onShadesVisibleChanged: " + visible);
75 onShadesVisibleChanged: console.log("axisX.onShadesVisibleChanged: " + visible);
74 onShadesColorChanged: console.log("axisX.onShadesColorChanged: " + color);
76 onShadesColorChanged: console.log("axisX.onShadesColorChanged: " + color);
75 onShadesBorderColorChanged: console.log("axisX.onShadesBorderColorChanged: " + color);
77 onShadesBorderColorChanged: console.log("axisX.onShadesBorderColorChanged: " + color);
76 onMinChanged: console.log("axisX.onMinChanged: " + min);
78 onMinChanged: console.log("axisX.onMinChanged: " + min);
77 onMaxChanged: console.log("axisX.onMaxChanged: " + max);
79 onMaxChanged: console.log("axisX.onMaxChanged: " + max);
78 }
80 }
79
81
80 ValueAxis{
82 ValueAxis{
81 onColorChanged: console.log("axisY.onColorChanged: " + color);
83 onColorChanged: console.log("axisY.onColorChanged: " + color);
82 onLabelsVisibleChanged: console.log("axisY.onLabelsVisibleChanged: " + visible);
84 onLabelsVisibleChanged: console.log("axisY.onLabelsVisibleChanged: " + visible);
83 onLabelsColorChanged: console.log("axisY.onLabelsColorChanged: " + color);
85 onLabelsColorChanged: console.log("axisY.onLabelsColorChanged: " + color);
84 onVisibleChanged: console.log("axisY.onVisibleChanged: " + visible);
86 onVisibleChanged: console.log("axisY.onVisibleChanged: " + visible);
85 onGridVisibleChanged: console.log("axisY.onGridVisibleChanged: " + visible);
87 onGridVisibleChanged: console.log("axisY.onGridVisibleChanged: " + visible);
86 onShadesVisibleChanged: console.log("axisY.onShadesVisibleChanged: " + visible);
88 onShadesVisibleChanged: console.log("axisY.onShadesVisibleChanged: " + visible);
87 onShadesColorChanged: console.log("axisY.onShadesColorChanged: " + color);
89 onShadesColorChanged: console.log("axisY.onShadesColorChanged: " + color);
88 onShadesBorderColorChanged: console.log("axisY.onShadesBorderColorChanged: " + color);
90 onShadesBorderColorChanged: console.log("axisY.onShadesBorderColorChanged: " + color);
89 onMinChanged: console.log("axisY.onMinChanged: " + min);
91 onMinChanged: console.log("axisY.onMinChanged: " + min);
90 onMaxChanged: console.log("axisY.onMaxChanged: " + max);
92 onMaxChanged: console.log("axisY.onMaxChanged: " + max);
91 }
93 }
92
94
93 Rectangle {
95 Rectangle {
94 id: marginVisualizer
96 id: marginVisualizer
95 color: "transparent"
97 color: "transparent"
96 border.color: "red"
98 border.color: "red"
97 anchors.fill: parent
99 anchors.fill: parent
98 anchors.topMargin: chartView.minimumMargins.top
100 anchors.topMargin: chartView.minimumMargins.top
99 anchors.bottomMargin: chartView.minimumMargins.bottom
101 anchors.bottomMargin: chartView.minimumMargins.bottom
100 anchors.leftMargin: chartView.minimumMargins.left
102 anchors.leftMargin: chartView.minimumMargins.left
101 anchors.rightMargin: chartView.minimumMargins.right
103 anchors.rightMargin: chartView.minimumMargins.right
102 opacity: 0.0
104 opacity: 0.0
103 onOpacityChanged: if (opacity > 0.9) opacity = 0.0;
105 onOpacityChanged: if (opacity > 0.9) opacity = 0.0;
104 Behavior on opacity {
106 Behavior on opacity {
105 NumberAnimation { duration: 800 }
107 NumberAnimation { duration: 800 }
106 }
108 }
107 }
109 }
108 }
110 }
@@ -1,76 +1,80
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2013 Digia Plc
3 ** Copyright (C) 2013 Digia Plc
4 ** All rights reserved.
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
6 **
7 ** This file is part of the Qt Enterprise Charts Add-on.
7 ** This file is part of the Qt Enterprise Charts Add-on.
8 **
8 **
9 ** $QT_BEGIN_LICENSE$
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
11 ** accordance with the Qt Enterprise License Agreement provided with the
11 ** accordance with the Qt Enterprise License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
13 ** a written agreement between you and Digia.
14 **
14 **
15 ** If you have questions regarding the use of this file, please use
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
17 ** $QT_END_LICENSE$
18 **
18 **
19 ****************************************************************************/
19 ****************************************************************************/
20
20
21 import QtQuick 1.0
21 import QtQuick 1.0
22
22
23 Row {
23 Row {
24 anchors.fill: parent
24 anchors.fill: parent
25 spacing: 5
25 spacing: 5
26 property variant chartLegend
26 property variant chartLegend
27
27
28 Flow {
28 Flow {
29 spacing: 5
29 spacing: 5
30 flow: Flow.TopToBottom
30 flow: Flow.TopToBottom
31
31
32 Button {
32 Button {
33 text: "legend visible"
33 text: "legend visible"
34 onClicked: chartLegend.visible = !chartLegend.visible;
34 onClicked: chartLegend.visible = !chartLegend.visible;
35 }
35 }
36 Button {
36 Button {
37 text: "legend bckgrd visible"
37 text: "legend bckgrd visible"
38 onClicked: chartLegend.backgroundVisible = !chartLegend.backgroundVisible;
38 onClicked: chartLegend.backgroundVisible = !chartLegend.backgroundVisible;
39 }
39 }
40 Button {
40 Button {
41 text: "legend color"
41 text: "legend color"
42 onClicked: chartLegend.color = main.nextColor();
42 onClicked: chartLegend.color = main.nextColor();
43 }
43 }
44 Button {
44 Button {
45 text: "legend border color"
45 text: "legend border color"
46 onClicked: chartLegend.borderColor = main.nextColor();
46 onClicked: chartLegend.borderColor = main.nextColor();
47 }
47 }
48 Button {
48 Button {
49 text: "legend label color"
49 text: "legend label color"
50 onClicked: chartLegend.labelColor = main.nextColor();
50 onClicked: chartLegend.labelColor = main.nextColor();
51 }
51 }
52 Button {
52 Button {
53 text: "legend top"
53 text: "legend top"
54 onClicked: chartLegend.alignment = Qt.AlignTop;
54 onClicked: chartLegend.alignment = Qt.AlignTop;
55 }
55 }
56 Button {
56 Button {
57 text: "legend bottom"
57 text: "legend bottom"
58 onClicked: chartLegend.alignment = Qt.AlignBottom;
58 onClicked: chartLegend.alignment = Qt.AlignBottom;
59 }
59 }
60 Button {
60 Button {
61 text: "legend left"
61 text: "legend left"
62 onClicked: chartLegend.alignment = Qt.AlignLeft;
62 onClicked: chartLegend.alignment = Qt.AlignLeft;
63 }
63 }
64 Button {
64 Button {
65 text: "legend right"
65 text: "legend right"
66 onClicked: chartLegend.alignment = Qt.AlignRight;
66 onClicked: chartLegend.alignment = Qt.AlignRight;
67 }
67 }
68 Button {
69 text: "legend use reverse order"
70 onClicked: chartLegend.reverseMarkers = !chartLegend.reverseMarkers;
71 }
68 }
72 }
69
73
70 FontEditor {
74 FontEditor {
71 fontDescription: "legend"
75 fontDescription: "legend"
72 function editedFont() {
76 function editedFont() {
73 return chartLegend.font;
77 return chartLegend.font;
74 }
78 }
75 }
79 }
76 }
80 }
@@ -1,108 +1,110
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2013 Digia Plc
3 ** Copyright (C) 2013 Digia Plc
4 ** All rights reserved.
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
6 **
7 ** This file is part of the Qt Enterprise Charts Add-on.
7 ** This file is part of the Qt Enterprise Charts Add-on.
8 **
8 **
9 ** $QT_BEGIN_LICENSE$
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
11 ** accordance with the Qt Enterprise License Agreement provided with the
11 ** accordance with the Qt Enterprise License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
13 ** a written agreement between you and Digia.
14 **
14 **
15 ** If you have questions regarding the use of this file, please use
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
17 ** $QT_END_LICENSE$
18 **
18 **
19 ****************************************************************************/
19 ****************************************************************************/
20
20
21 import QtQuick 2.0
21 import QtQuick 2.0
22 import QtCommercial.Chart 1.3
22 import QtCommercial.Chart 1.3
23
23
24 ChartView {
24 ChartView {
25 id: chartView
25 id: chartView
26 title: "Chart Title"
26 title: "Chart Title"
27 anchors.fill: parent
27 anchors.fill: parent
28 property variant chart: chartView
28 property variant chart: chartView
29
29
30 LineSeries {
30 LineSeries {
31 name: "line"
31 name: "line"
32 XYPoint { x: 0; y: 0 }
32 XYPoint { x: 0; y: 0 }
33 XYPoint { x: 1.1; y: 2.1 }
33 XYPoint { x: 1.1; y: 2.1 }
34 XYPoint { x: 1.9; y: 3.3 }
34 XYPoint { x: 1.9; y: 3.3 }
35 XYPoint { x: 2.1; y: 2.1 }
35 XYPoint { x: 2.1; y: 2.1 }
36 XYPoint { x: 2.9; y: 4.9 }
36 XYPoint { x: 2.9; y: 4.9 }
37 XYPoint { x: 3.4; y: 3.0 }
37 XYPoint { x: 3.4; y: 3.0 }
38 XYPoint { x: 4.1; y: 3.3 }
38 XYPoint { x: 4.1; y: 3.3 }
39 }
39 }
40
40
41 onVisibleChanged: console.log("chart.onVisibleChanged: " + visible);
41 onVisibleChanged: console.log("chart.onVisibleChanged: " + visible);
42 onTitleColorChanged: console.log("chart.onTitleColorChanged: " + color);
42 onTitleColorChanged: console.log("chart.onTitleColorChanged: " + color);
43 onBackgroundColorChanged: console.log("chart.onBackgroundColorChanged: " + chart.backgroundColor);
43 onBackgroundColorChanged: console.log("chart.onBackgroundColorChanged: " + chart.backgroundColor);
44 onDropShadowEnabledChanged: console.log("chart.onDropShadowEnabledChanged: " + enabled);
44 onDropShadowEnabledChanged: console.log("chart.onDropShadowEnabledChanged: " + enabled);
45 onBackgroundRoundnessChanged: console.log("chart.onBackgroundRoundnessChanged: " + diameter);
45 onBackgroundRoundnessChanged: console.log("chart.onBackgroundRoundnessChanged: " + diameter);
46 onSeriesAdded: console.log("chart.onSeriesAdded: " + series.name);
46 onSeriesAdded: console.log("chart.onSeriesAdded: " + series.name);
47 onSeriesRemoved: console.log("chart.onSeriesRemoved: " + series.name);
47 onSeriesRemoved: console.log("chart.onSeriesRemoved: " + series.name);
48 onPlotAreaColorChanged: console.log("chart.plotAreaColorChanged: " + chart.plotAreaColor);
48 onPlotAreaColorChanged: console.log("chart.plotAreaColorChanged: " + chart.plotAreaColor);
49
49
50 legend.onVisibleChanged: console.log("legend.onVisibleChanged: " + chart.legend.visible);
50 legend.onVisibleChanged: console.log("legend.onVisibleChanged: " + chart.legend.visible);
51 legend.onBackgroundVisibleChanged: console.log("legend.onBackgroundVisibleChanged: " + visible);
51 legend.onBackgroundVisibleChanged: console.log("legend.onBackgroundVisibleChanged: " + visible);
52 legend.onColorChanged: console.log("legend.onColorChanged: " + color);
52 legend.onColorChanged: console.log("legend.onColorChanged: " + color);
53 legend.onBorderColorChanged: console.log("legend.onBorderColorChanged: " + color);
53 legend.onBorderColorChanged: console.log("legend.onBorderColorChanged: " + color);
54 legend.onLabelColorChanged: console.log("legend.onLabelColorChanged: " + color);
54 legend.onLabelColorChanged: console.log("legend.onLabelColorChanged: " + color);
55 legend.onReverseMarkersChanged: console.log("legend.onReverseMarkersChanged: "
56 + chart.legend.reverseMarkers)
55 margins.onTopChanged: console.log("chart.margins.onTopChanged: " + top );
57 margins.onTopChanged: console.log("chart.margins.onTopChanged: " + top );
56 margins.onBottomChanged: console.log("chart.margins.onBottomChanged: " + bottom);
58 margins.onBottomChanged: console.log("chart.margins.onBottomChanged: " + bottom);
57 margins.onLeftChanged: console.log("chart.margins.onLeftChanged: " + left);
59 margins.onLeftChanged: console.log("chart.margins.onLeftChanged: " + left);
58 margins.onRightChanged: console.log("chart.margins.onRightChanged: " + right);
60 margins.onRightChanged: console.log("chart.margins.onRightChanged: " + right);
59 onPlotAreaChanged: {
61 onPlotAreaChanged: {
60 console.log("chart.onPlotAreaChanged, width: " + chartView.plotArea.width
62 console.log("chart.onPlotAreaChanged, width: " + chartView.plotArea.width
61 + " height: " + chartView.plotArea.height
63 + " height: " + chartView.plotArea.height
62 + " y: " + chartView.plotArea.y
64 + " y: " + chartView.plotArea.y
63 + " x: " + chartView.plotArea.x);
65 + " x: " + chartView.plotArea.x);
64 marginVisualizer.opacity = 1.0;
66 marginVisualizer.opacity = 1.0;
65 }
67 }
66
68
67 ValueAxis{
69 ValueAxis{
68 onColorChanged: console.log("axisX.onColorChanged: " + color);
70 onColorChanged: console.log("axisX.onColorChanged: " + color);
69 onLabelsVisibleChanged: console.log("axisX.onLabelsVisibleChanged: " + visible);
71 onLabelsVisibleChanged: console.log("axisX.onLabelsVisibleChanged: " + visible);
70 onLabelsColorChanged: console.log("axisX.onLabelsColorChanged: " + color);
72 onLabelsColorChanged: console.log("axisX.onLabelsColorChanged: " + color);
71 onVisibleChanged: console.log("axisX.onVisibleChanged: " + visible);
73 onVisibleChanged: console.log("axisX.onVisibleChanged: " + visible);
72 onGridVisibleChanged: console.log("axisX.onGridVisibleChanged: " + visible);
74 onGridVisibleChanged: console.log("axisX.onGridVisibleChanged: " + visible);
73 onShadesVisibleChanged: console.log("axisX.onShadesVisibleChanged: " + visible);
75 onShadesVisibleChanged: console.log("axisX.onShadesVisibleChanged: " + visible);
74 onShadesColorChanged: console.log("axisX.onShadesColorChanged: " + color);
76 onShadesColorChanged: console.log("axisX.onShadesColorChanged: " + color);
75 onShadesBorderColorChanged: console.log("axisX.onShadesBorderColorChanged: " + color);
77 onShadesBorderColorChanged: console.log("axisX.onShadesBorderColorChanged: " + color);
76 onMinChanged: console.log("axisX.onMinChanged: " + min);
78 onMinChanged: console.log("axisX.onMinChanged: " + min);
77 onMaxChanged: console.log("axisX.onMaxChanged: " + max);
79 onMaxChanged: console.log("axisX.onMaxChanged: " + max);
78 }
80 }
79
81
80 ValueAxis{
82 ValueAxis{
81 onColorChanged: console.log("axisY.onColorChanged: " + color);
83 onColorChanged: console.log("axisY.onColorChanged: " + color);
82 onLabelsVisibleChanged: console.log("axisY.onLabelsVisibleChanged: " + visible);
84 onLabelsVisibleChanged: console.log("axisY.onLabelsVisibleChanged: " + visible);
83 onLabelsColorChanged: console.log("axisY.onLabelsColorChanged: " + color);
85 onLabelsColorChanged: console.log("axisY.onLabelsColorChanged: " + color);
84 onVisibleChanged: console.log("axisY.onVisibleChanged: " + visible);
86 onVisibleChanged: console.log("axisY.onVisibleChanged: " + visible);
85 onGridVisibleChanged: console.log("axisY.onGridVisibleChanged: " + visible);
87 onGridVisibleChanged: console.log("axisY.onGridVisibleChanged: " + visible);
86 onShadesVisibleChanged: console.log("axisY.onShadesVisibleChanged: " + visible);
88 onShadesVisibleChanged: console.log("axisY.onShadesVisibleChanged: " + visible);
87 onShadesColorChanged: console.log("axisY.onShadesColorChanged: " + color);
89 onShadesColorChanged: console.log("axisY.onShadesColorChanged: " + color);
88 onShadesBorderColorChanged: console.log("axisY.onShadesBorderColorChanged: " + color);
90 onShadesBorderColorChanged: console.log("axisY.onShadesBorderColorChanged: " + color);
89 onMinChanged: console.log("axisY.onMinChanged: " + min);
91 onMinChanged: console.log("axisY.onMinChanged: " + min);
90 onMaxChanged: console.log("axisY.onMaxChanged: " + max);
92 onMaxChanged: console.log("axisY.onMaxChanged: " + max);
91 }
93 }
92
94
93 Rectangle {
95 Rectangle {
94 id: marginVisualizer
96 id: marginVisualizer
95 color: "transparent"
97 color: "transparent"
96 border.color: "red"
98 border.color: "red"
97 anchors.fill: parent
99 anchors.fill: parent
98 anchors.topMargin: chartView.minimumMargins.top
100 anchors.topMargin: chartView.minimumMargins.top
99 anchors.bottomMargin: chartView.minimumMargins.bottom
101 anchors.bottomMargin: chartView.minimumMargins.bottom
100 anchors.leftMargin: chartView.minimumMargins.left
102 anchors.leftMargin: chartView.minimumMargins.left
101 anchors.rightMargin: chartView.minimumMargins.right
103 anchors.rightMargin: chartView.minimumMargins.right
102 opacity: 0.0
104 opacity: 0.0
103 onOpacityChanged: if (opacity > 0.9) opacity = 0.0;
105 onOpacityChanged: if (opacity > 0.9) opacity = 0.0;
104 Behavior on opacity {
106 Behavior on opacity {
105 NumberAnimation { duration: 800 }
107 NumberAnimation { duration: 800 }
106 }
108 }
107 }
109 }
108 }
110 }
@@ -1,76 +1,80
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2013 Digia Plc
3 ** Copyright (C) 2013 Digia Plc
4 ** All rights reserved.
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
6 **
7 ** This file is part of the Qt Enterprise Charts Add-on.
7 ** This file is part of the Qt Enterprise Charts Add-on.
8 **
8 **
9 ** $QT_BEGIN_LICENSE$
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
11 ** accordance with the Qt Enterprise License Agreement provided with the
11 ** accordance with the Qt Enterprise License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
13 ** a written agreement between you and Digia.
14 **
14 **
15 ** If you have questions regarding the use of this file, please use
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
17 ** $QT_END_LICENSE$
18 **
18 **
19 ****************************************************************************/
19 ****************************************************************************/
20
20
21 import QtQuick 2.0
21 import QtQuick 2.0
22
22
23 Row {
23 Row {
24 anchors.fill: parent
24 anchors.fill: parent
25 spacing: 5
25 spacing: 5
26 property variant chartLegend
26 property variant chartLegend
27
27
28 Flow {
28 Flow {
29 spacing: 5
29 spacing: 5
30 flow: Flow.TopToBottom
30 flow: Flow.TopToBottom
31
31
32 Button {
32 Button {
33 text: "legend visible"
33 text: "legend visible"
34 onClicked: chartLegend.visible = !chartLegend.visible;
34 onClicked: chartLegend.visible = !chartLegend.visible;
35 }
35 }
36 Button {
36 Button {
37 text: "legend bckgrd visible"
37 text: "legend bckgrd visible"
38 onClicked: chartLegend.backgroundVisible = !chartLegend.backgroundVisible;
38 onClicked: chartLegend.backgroundVisible = !chartLegend.backgroundVisible;
39 }
39 }
40 Button {
40 Button {
41 text: "legend color"
41 text: "legend color"
42 onClicked: chartLegend.color = main.nextColor();
42 onClicked: chartLegend.color = main.nextColor();
43 }
43 }
44 Button {
44 Button {
45 text: "legend border color"
45 text: "legend border color"
46 onClicked: chartLegend.borderColor = main.nextColor();
46 onClicked: chartLegend.borderColor = main.nextColor();
47 }
47 }
48 Button {
48 Button {
49 text: "legend label color"
49 text: "legend label color"
50 onClicked: chartLegend.labelColor = main.nextColor();
50 onClicked: chartLegend.labelColor = main.nextColor();
51 }
51 }
52 Button {
52 Button {
53 text: "legend top"
53 text: "legend top"
54 onClicked: chartLegend.alignment = Qt.AlignTop;
54 onClicked: chartLegend.alignment = Qt.AlignTop;
55 }
55 }
56 Button {
56 Button {
57 text: "legend bottom"
57 text: "legend bottom"
58 onClicked: chartLegend.alignment = Qt.AlignBottom;
58 onClicked: chartLegend.alignment = Qt.AlignBottom;
59 }
59 }
60 Button {
60 Button {
61 text: "legend left"
61 text: "legend left"
62 onClicked: chartLegend.alignment = Qt.AlignLeft;
62 onClicked: chartLegend.alignment = Qt.AlignLeft;
63 }
63 }
64 Button {
64 Button {
65 text: "legend right"
65 text: "legend right"
66 onClicked: chartLegend.alignment = Qt.AlignRight;
66 onClicked: chartLegend.alignment = Qt.AlignRight;
67 }
67 }
68 Button {
69 text: "legend use reverse order"
70 onClicked: chartLegend.reverseMarkers = !chartLegend.reverseMarkers;
71 }
68 }
72 }
69
73
70 FontEditor {
74 FontEditor {
71 fontDescription: "legend"
75 fontDescription: "legend"
72 function editedFont() {
76 function editedFont() {
73 return chartLegend.font;
77 return chartLegend.font;
74 }
78 }
75 }
79 }
76 }
80 }
General Comments 0
You need to be logged in to leave comments. Login now