##// END OF EJS Templates
Added possibility to set labels position for QCategoryAxis...
Titta Heikkala -
r2780:740f4f94adf8
parent child
Show More
@@ -1,331 +1,366
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2015 The Qt Company Ltd
4 4 ** All rights reserved.
5 5 ** For any questions to The Qt Company, please use contact form at http://qt.io
6 6 **
7 7 ** This file is part of the Qt Charts module.
8 8 **
9 9 ** Licensees holding valid commercial license for Qt may use this file in
10 10 ** accordance with the Qt License Agreement provided with the Software
11 11 ** or, alternatively, in accordance with the terms contained in a written
12 12 ** agreement between you and The Qt Company.
13 13 **
14 14 ** If you have questions regarding the use of this file, please use
15 15 ** contact form at http://qt.io
16 16 **
17 17 ****************************************************************************/
18 18
19 19 #include <QtCharts/QCategoryAxis>
20 20 #include <private/qcategoryaxis_p.h>
21 21 #include <private/chartcategoryaxisx_p.h>
22 22 #include <private/chartcategoryaxisy_p.h>
23 23 #include <private/polarchartcategoryaxisangular_p.h>
24 24 #include <private/polarchartcategoryaxisradial_p.h>
25 25 #include <QtCharts/QChart>
26 26 #include <QtCore/QtMath>
27 27 #include <QtCore/QDebug>
28 28
29 29 QT_CHARTS_BEGIN_NAMESPACE
30 30 /*!
31 31 \class QCategoryAxis
32 32 \inmodule Qt Charts
33 33 \brief The QCategoryAxis class allows putting a named ranges on the axis.
34 34 \mainclass
35 35
36 36 This class can be used when the underlying data needs to be given extra meaning.
37 37 Unlike with the QBarCategoryAxis the QCategoryAxis allows the categories ranges widths to be specified freely.
38 38
39 39 Example code on how to use QCategoryAxis:
40 40 \image api_category_axis.png
41 41 \code
42 42 QChartView *chartView = new QChartView;
43 43 QLineSeries *series = new QLineSeries;
44 44 // ...
45 45 chartView->chart()->addSeries(series);
46 46
47 47 QCategoryAxis *axisY = new QCategoryAxis;
48 48 axisY->setMin(0);
49 49 axisY->setMax(52);
50 50 axisY->setStartValue(15);
51 51 axisY->append("First", 20);
52 52 axisY->append("Second", 37);
53 53 axisY->append("Third", 52);
54 54 chartView->chart()->setAxisY(axisY, series);
55 55 \endcode
56 56 */
57 57 /*!
58 58 \qmltype CategoryAxis
59 59 \instantiates QCategoryAxis
60 60 \inqmlmodule QtCharts
61 61
62 62 \inherits AbstractAxis
63 63 \brief CategoryAxis allows putting a named ranges on the axis.
64 64
65 65 For example:
66 66 \image examples_qmlaxes3.png
67 67 \snippet qmlaxes/qml/qmlaxes/View3.qml 1
68 68 */
69 69
70 70 /*!
71 71 \property QCategoryAxis::startValue
72 72 Defines the low end of the first category on the axis.
73 73 */
74 74 /*!
75 75 \qmlproperty int CategoryAxis::startValue
76 76 Defines the low end of the first category on the axis.
77 77 */
78 78
79 79 /*!
80 80 \property QCategoryAxis::count
81 81 The count of categories.
82 82 */
83 83 /*!
84 84 \qmlproperty int CategoryAxis::count
85 85 The count of categories.
86 86 */
87 87
88 88 /*!
89 89 \property QCategoryAxis::categoriesLabels
90 90 The category labels as a string list.
91 91 */
92 92 /*!
93 93 \qmlproperty StringList CategoryAxis::categoriesLabels
94 94 The category labels as a list of strings.
95 95 */
96 96
97 97 /*!
98 98 \fn void QCategoryAxis::categoriesChanged()
99 99 Axis emits signal when the categories of the axis have changed.
100 100 */
101 101
102 /*!
103 \enum QCategoryAxis::AxisLabelsPosition
104
105 This enum describes the position of the category labels.
106
107 \value AxisLabelsPositionCenter Labels are centered to category.
108 \value AxisLabelsPositionOnValue Labels are positioned to the high end limit of the category.
109 */
110 /*!
111 \property QCategoryAxis::labelsPosition
112 Defines the position of the category labels. The labels in the beginning and in the end of the
113 axes may overlap other axes labels when positioned on value.
114 */
115 /*!
116 \qmlproperty AxisLabelsPosition CategoryAxis::labelsPosition
117 Defines the position of the category labels. The labels in the beginning and in the end of the
118 axes may overlap other axes labels when positioned on value.
119 */
120
102 121
103 122 /*!
104 123 Constructs an axis object which is a child of \a parent.
105 124 */
106 125 QCategoryAxis::QCategoryAxis(QObject *parent):
107 126 QValueAxis(*new QCategoryAxisPrivate(this), parent)
108 127 {
109 128 }
110 129
111 130 /*!
112 131 Destroys the object
113 132 */
114 133 QCategoryAxis::~QCategoryAxis()
115 134 {
116 135 Q_D(QCategoryAxis);
117 136 if (d->m_chart)
118 137 d->m_chart->removeAxis(this);
119 138 }
120 139
121 140 /*!
122 141 \internal
123 142 */
124 143 QCategoryAxis::QCategoryAxis(QCategoryAxisPrivate &d, QObject *parent): QValueAxis(d, parent)
125 144 {
126 145
127 146 }
128 147
129 148 /*!
130 149 \qmlmethod CategoryAxis::append(string label, real endValue)
131 150 Appends new category to the axis with an \a label. Category label has to be unique.
132 151 Parameter \a endValue specifies the high end limit of the category.
133 152 It has to be greater than the high end limit of the previous category.
134 153 Otherwise the method returns without adding a new category.
135 154 */
136 155 /*!
137 156 Appends new category to the axis with an \a categoryLabel.
138 157 Category label has to be unique.
139 158 Parameter \a categoryEndValue specifies the high end limit of the category.
140 159 It has to be greater than the high end limit of the previous category.
141 160 Otherwise the method returns without adding a new category.
142 161 */
143 162 void QCategoryAxis::append(const QString &categoryLabel, qreal categoryEndValue)
144 163 {
145 164 Q_D(QCategoryAxis);
146 165
147 166 if (!d->m_categories.contains(categoryLabel)) {
148 167 if (d->m_categories.isEmpty()) {
149 168 Range range(d->m_categoryMinimum, categoryEndValue);
150 169 d->m_categoriesMap.insert(categoryLabel, range);
151 170 d->m_categories.append(categoryLabel);
152 171 emit categoriesChanged();
153 172 } else if (categoryEndValue > endValue(d->m_categories.last())) {
154 173 Range previousRange = d->m_categoriesMap.value(d->m_categories.last());
155 174 d->m_categoriesMap.insert(categoryLabel, Range(previousRange.second, categoryEndValue));
156 175 d->m_categories.append(categoryLabel);
157 176 emit categoriesChanged();
158 177 }
159 178 }
160 179 }
161 180
162 181 /*!
163 182 Sets \a min to be the low end limit of the first category on the axis.
164 183 If there is already some categories added to the axis then passed value must be lower than the high end value of the already defined first category range.
165 184 Otherwise nothing is done.
166 185 */
167 186 void QCategoryAxis::setStartValue(qreal min)
168 187 {
169 188 Q_D(QCategoryAxis);
170 189 if (d->m_categories.isEmpty()) {
171 190 d->m_categoryMinimum = min;
172 191 emit categoriesChanged();
173 192 } else {
174 193 Range range = d->m_categoriesMap.value(d->m_categories.first());
175 194 if (min < range.second) {
176 195 d->m_categoriesMap.insert(d->m_categories.first(), Range(min, range.second));
177 196 emit categoriesChanged();
178 197 }
179 198 }
180 199 }
181 200
182 201 /*!
183 202 Returns the low end limit of the category specified by an \a categoryLabel
184 203 */
185 204 qreal QCategoryAxis::startValue(const QString &categoryLabel) const
186 205 {
187 206 Q_D(const QCategoryAxis);
188 207 if (categoryLabel.isEmpty())
189 208 return d->m_categoryMinimum;
190 209 return d->m_categoriesMap.value(categoryLabel).first;
191 210 }
192 211
193 212 /*!
194 213 Returns the high end limit of the interval specified by an \a categoryLabel
195 214 */
196 215 qreal QCategoryAxis::endValue(const QString &categoryLabel) const
197 216 {
198 217 Q_D(const QCategoryAxis);
199 218 return d->m_categoriesMap.value(categoryLabel).second;
200 219 }
201 220
202 221 /*!
203 222 \qmlmethod CategoryAxis::remove(string label)
204 223 Removes a category specified by the \a label from the axis
205 224 */
206 225 /*!
207 226 Removes an interval specified by the \a categoryLabel from the axis
208 227 */
209 228 void QCategoryAxis::remove(const QString &categoryLabel)
210 229 {
211 230 Q_D(QCategoryAxis);
212 231 int labelIndex = d->m_categories.indexOf(categoryLabel);
213 232
214 233 // check if such label exists
215 234 if (labelIndex != -1) {
216 235 d->m_categories.removeAt(labelIndex);
217 236 d->m_categoriesMap.remove(categoryLabel);
218 237
219 238 // the range of the interval that follows (if exists) needs to be updated
220 239 if (labelIndex < d->m_categories.count()) {
221 240 QString label = d->m_categories.at(labelIndex);
222 241 Range range = d->m_categoriesMap.value(label);
223 242
224 243 // set the range
225 244 if (labelIndex == 0) {
226 245 range.first = d->m_categoryMinimum;
227 246 d->m_categoriesMap.insert(label, range);
228 247 } else {
229 248 range.first = d->m_categoriesMap.value(d->m_categories.at(labelIndex - 1)).second;
230 249 d->m_categoriesMap.insert(label, range);
231 250 }
232 251 }
233 252 emit categoriesChanged();
234 253 }
235 254 }
236 255
237 256 /*!
238 257 \qmlmethod CategoryAxis::replace(string oldLabel, string newLabel)
239 258 Replaces \a oldLabel of an existing category with a \a newLabel.
240 259 If the old label does not exist the method returns without making any changes.
241 260 */
242 261 /*!
243 262 Replaces \a oldLabel of an existing category with a \a newLabel
244 263 If the old label does not exist the method returns without making any changes.
245 264 */
246 265 void QCategoryAxis::replaceLabel(const QString &oldLabel, const QString &newLabel)
247 266 {
248 267 Q_D(QCategoryAxis);
249 268 int labelIndex = d->m_categories.indexOf(oldLabel);
250 269
251 270 // check if such label exists
252 271 if (labelIndex != -1) {
253 272 d->m_categories.replace(labelIndex, newLabel);
254 273 Range range = d->m_categoriesMap.value(oldLabel);
255 274 d->m_categoriesMap.remove(oldLabel);
256 275 d->m_categoriesMap.insert(newLabel, range);
257 276 emit categoriesChanged();
258 277 }
259 278 }
260 279
261 280 /*!
262 281 Returns the list of the intervals labels
263 282 */
264 283 QStringList QCategoryAxis::categoriesLabels()
265 284 {
266 285 Q_D(QCategoryAxis);
267 286 return d->m_categories;
268 287 }
269 288
270 289 /*!
271 290 Returns number of intervals.
272 291 */
273 292 int QCategoryAxis::count() const
274 293 {
275 294 Q_D(const QCategoryAxis);
276 295 return d->m_categories.count();
277 296 }
278 297
279 298 /*!
280 299 Returns the type of the axis
281 300 */
282 301 QAbstractAxis::AxisType QCategoryAxis::type() const
283 302 {
284 303 return QAbstractAxis::AxisTypeCategory;
285 304 }
286 305
306 void QCategoryAxis::setLabelsPosition(QCategoryAxis::AxisLabelsPosition position)
307 {
308 Q_D(QCategoryAxis);
309 if (d->m_labelsPosition != position) {
310 d->m_labelsPosition = position;
311 emit labelsPositionChanged(position);
312 }
313 }
314
315 QCategoryAxis::AxisLabelsPosition QCategoryAxis::labelsPosition() const
316 {
317 Q_D(const QCategoryAxis);
318 return d->m_labelsPosition;
319 }
320
287 321 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
288 322
289 323 QCategoryAxisPrivate::QCategoryAxisPrivate(QCategoryAxis *q)
290 324 : QValueAxisPrivate(q),
291 m_categoryMinimum(0)
325 m_categoryMinimum(0),
326 m_labelsPosition(QCategoryAxis::AxisLabelsPositionCenter)
292 327 {
293 328
294 329 }
295 330
296 331 QCategoryAxisPrivate::~QCategoryAxisPrivate()
297 332 {
298 333
299 334 }
300 335
301 336 int QCategoryAxisPrivate::ticksCount() const
302 337 {
303 338 return m_categories.count() + 1;
304 339 }
305 340
306 341 void QCategoryAxisPrivate::initializeGraphics(QGraphicsItem *parent)
307 342 {
308 343 Q_Q(QCategoryAxis);
309 344 ChartAxisElement *axis(0);
310 345 if (m_chart->chartType() == QChart::ChartTypeCartesian) {
311 346 if (orientation() == Qt::Vertical)
312 347 axis = new ChartCategoryAxisY(q,parent);
313 348 else if (orientation() == Qt::Horizontal)
314 349 axis = new ChartCategoryAxisX(q,parent);
315 350 }
316 351
317 352 if (m_chart->chartType() == QChart::ChartTypePolar) {
318 353 if (orientation() == Qt::Vertical)
319 354 axis = new PolarChartCategoryAxisRadial(q, parent);
320 355 if (orientation() == Qt::Horizontal)
321 356 axis = new PolarChartCategoryAxisAngular(q, parent);
322 357 }
323 358
324 359 m_item.reset(axis);
325 360 QAbstractAxisPrivate::initializeGraphics(parent);
326 361 }
327 362
328 363 #include "moc_qcategoryaxis.cpp"
329 364 #include "moc_qcategoryaxis_p.cpp"
330 365
331 366 QT_CHARTS_END_NAMESPACE
@@ -1,68 +1,80
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2015 The Qt Company Ltd
4 4 ** All rights reserved.
5 5 ** For any questions to The Qt Company, please use contact form at http://qt.io
6 6 **
7 7 ** This file is part of the Qt Charts module.
8 8 **
9 9 ** Licensees holding valid commercial license for Qt may use this file in
10 10 ** accordance with the Qt License Agreement provided with the Software
11 11 ** or, alternatively, in accordance with the terms contained in a written
12 12 ** agreement between you and The Qt Company.
13 13 **
14 14 ** If you have questions regarding the use of this file, please use
15 15 ** contact form at http://qt.io
16 16 **
17 17 ****************************************************************************/
18 18
19 19 #ifndef QCATEGORYAXIS_H
20 20 #define QCATEGORYAXIS_H
21 21
22 22 #include <QtCharts/QAbstractAxis>
23 23 #include <QtCharts/QValueAxis>
24 24
25 25 QT_CHARTS_BEGIN_NAMESPACE
26 26
27 27 class QCategoryAxisPrivate;
28 28
29 29 class QT_CHARTS_EXPORT QCategoryAxis : public QValueAxis
30 30 {
31 31 Q_OBJECT
32 32 Q_PROPERTY(qreal startValue READ startValue WRITE setStartValue)
33 33 Q_PROPERTY(int count READ count)
34 34 Q_PROPERTY(QStringList categoriesLabels READ categoriesLabels)
35 Q_PROPERTY(AxisLabelsPosition labelsPosition READ labelsPosition WRITE setLabelsPosition NOTIFY labelsPositionChanged)
36 Q_ENUMS(AxisLabelsPosition)
35 37
36 38 public:
39
40 enum AxisLabelsPosition {
41 AxisLabelsPositionCenter = 0x0,
42 AxisLabelsPositionOnValue = 0x1
43 };
44
37 45 explicit QCategoryAxis(QObject *parent = 0);
38 46 ~QCategoryAxis();
39 47
40 48 protected:
41 49 QCategoryAxis(QCategoryAxisPrivate &d, QObject *parent = 0);
42 50
43 51 public:
44 52 AxisType type() const;
45 53
46 54 void append(const QString &label, qreal categoryEndValue);
47 55 void remove(const QString &label);
48 56 void replaceLabel(const QString &oldLabel, const QString &newLabel);
49 57
50 58 qreal startValue(const QString &categoryLabel = QString()) const;
51 59 void setStartValue(qreal min);
52 60
53 61 qreal endValue(const QString &categoryLabel) const;
54 62
55 63 QStringList categoriesLabels();
56 64 int count() const;
57 65
66 QCategoryAxis::AxisLabelsPosition labelsPosition() const;
67 void setLabelsPosition(QCategoryAxis::AxisLabelsPosition position);
68
58 69 Q_SIGNALS:
59 70 void categoriesChanged();
71 void labelsPositionChanged(QCategoryAxis::AxisLabelsPosition position);
60 72
61 73 private:
62 74 Q_DECLARE_PRIVATE(QCategoryAxis)
63 75 Q_DISABLE_COPY(QCategoryAxis)
64 76 };
65 77
66 78 QT_CHARTS_END_NAMESPACE
67 79
68 80 #endif // QCATEGORYAXIS_H
@@ -1,60 +1,61
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2015 The Qt Company Ltd
4 4 ** All rights reserved.
5 5 ** For any questions to The Qt Company, please use contact form at http://qt.io
6 6 **
7 7 ** This file is part of the Qt Charts module.
8 8 **
9 9 ** Licensees holding valid commercial license for Qt may use this file in
10 10 ** accordance with the Qt License Agreement provided with the Software
11 11 ** or, alternatively, in accordance with the terms contained in a written
12 12 ** agreement between you and The Qt Company.
13 13 **
14 14 ** If you have questions regarding the use of this file, please use
15 15 ** contact form at http://qt.io
16 16 **
17 17 ****************************************************************************/
18 18
19 19 // W A R N I N G
20 20 // -------------
21 21 //
22 22 // This file is not part of the Qt Enterprise Chart API. It exists purely as an
23 23 // implementation detail. This header file may change from version to
24 24 // version without notice, or even be removed.
25 25 //
26 26 // We mean it.
27 27
28 28 #ifndef QCATEGORYAXIS_P_H
29 29 #define QCATEGORYAXIS_P_H
30 30
31 31 #include <QtCharts/QCategoryAxis>
32 32 #include <private/qvalueaxis_p.h>
33 33
34 34 QT_CHARTS_BEGIN_NAMESPACE
35 35
36 36 typedef QPair<qreal, qreal> Range;
37 37
38 38 class QCategoryAxisPrivate : public QValueAxisPrivate
39 39 {
40 40 Q_OBJECT
41 41
42 42 public:
43 43 QCategoryAxisPrivate(QCategoryAxis *q);
44 44 ~QCategoryAxisPrivate();
45 45
46 46 void initializeGraphics(QGraphicsItem* parent);
47 47 int ticksCount() const;
48 48
49 49 private:
50 50 QMap<QString , Range> m_categoriesMap;
51 51 QStringList m_categories;
52 52 qreal m_categoryMinimum;
53 QCategoryAxis::AxisLabelsPosition m_labelsPosition;
53 54
54 55 private:
55 56 Q_DECLARE_PUBLIC(QCategoryAxis)
56 57 };
57 58
58 59 QT_CHARTS_END_NAMESPACE
59 60
60 61 #endif // QCATEGORYAXIS_P_H
@@ -1,247 +1,264
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2015 The Qt Company Ltd
4 4 ** All rights reserved.
5 5 ** For any questions to The Qt Company, please use contact form at http://qt.io
6 6 **
7 7 ** This file is part of the Qt Charts module.
8 8 **
9 9 ** Licensees holding valid commercial license for Qt may use this file in
10 10 ** accordance with the Qt License Agreement provided with the Software
11 11 ** or, alternatively, in accordance with the terms contained in a written
12 12 ** agreement between you and The Qt Company.
13 13 **
14 14 ** If you have questions regarding the use of this file, please use
15 15 ** contact form at http://qt.io
16 16 **
17 17 ****************************************************************************/
18 18
19 19 #include <private/horizontalaxis_p.h>
20 20 #include <private/qabstractaxis_p.h>
21 21 #include <private/chartpresenter_p.h>
22 #include <QtCharts/QCategoryAxis>
22 23 #include <QtCore/QtMath>
23 24 #include <QtCore/QDebug>
24 25
25 26 QT_CHARTS_BEGIN_NAMESPACE
26 27
27 28 HorizontalAxis::HorizontalAxis(QAbstractAxis *axis, QGraphicsItem *item, bool intervalAxis)
28 29 : CartesianChartAxis(axis, item, intervalAxis)
29 30 {
30 31 }
31 32
32 33 HorizontalAxis::~HorizontalAxis()
33 34 {
34 35 }
35 36
36 37 void HorizontalAxis::updateGeometry()
37 38 {
38 39 const QVector<qreal> &layout = ChartAxisElement::layout();
39 40
40 41 if (layout.isEmpty() && axis()->type() != QAbstractAxis::AxisTypeLogValue)
41 42 return;
42 43
43 44 QStringList labelList = labels();
44 45
45 46 QList<QGraphicsItem *> labels = labelItems();
46 47 QList<QGraphicsItem *> arrow = arrowItems();
47 48 QGraphicsTextItem *title = titleItem();
48 49
49 50 Q_ASSERT(labels.size() == labelList.size());
50 51 Q_ASSERT(layout.size() == labelList.size());
51 52
52 53 const QRectF &axisRect = axisGeometry();
53 54 const QRectF &gridRect = gridGeometry();
54 55
55 56 //arrow
56 57 QGraphicsLineItem *arrowItem = static_cast<QGraphicsLineItem *>(arrow.at(0));
57 58
58 59 if (axis()->alignment() == Qt::AlignTop)
59 60 arrowItem->setLine(gridRect.left(), axisRect.bottom(), gridRect.right(), axisRect.bottom());
60 61 else if (axis()->alignment() == Qt::AlignBottom)
61 62 arrowItem->setLine(gridRect.left(), axisRect.top(), gridRect.right(), axisRect.top());
62 63
63 64 qreal width = 0;
64 65 const QLatin1String ellipsis("...");
65 66
66 67 //title
67 68 QRectF titleBoundingRect;
68 69 QString titleText = axis()->titleText();
69 70 qreal availableSpace = axisRect.height() - labelPadding();
70 71 if (!titleText.isEmpty() && titleItem()->isVisible()) {
71 72 availableSpace -= titlePadding() * 2.0;
72 73 qreal minimumLabelHeight = ChartPresenter::textBoundingRect(axis()->labelsFont(),
73 74 QStringLiteral("...")).height();
74 75 qreal titleSpace = availableSpace - minimumLabelHeight;
75 76 title->setHtml(ChartPresenter::truncatedText(axis()->titleFont(), titleText, qreal(0.0),
76 77 gridRect.width(), titleSpace,
77 78 titleBoundingRect));
78 79 title->setTextWidth(titleBoundingRect.width());
79 80
80 81 titleBoundingRect = title->boundingRect();
81 82
82 83 QPointF center = gridRect.center() - titleBoundingRect.center();
83 84 if (axis()->alignment() == Qt::AlignTop)
84 85 title->setPos(center.x(), axisRect.top() + titlePadding());
85 86 else if (axis()->alignment() == Qt::AlignBottom)
86 87 title->setPos(center.x(), axisRect.bottom() - titleBoundingRect.height() - titlePadding());
87 88
88 89 availableSpace -= titleBoundingRect.height();
89 90 }
90 91
91 92 if (layout.isEmpty() && axis()->type() == QAbstractAxis::AxisTypeLogValue)
92 93 return;
93 94
94 95 QList<QGraphicsItem *> lines = gridItems();
95 96 QList<QGraphicsItem *> shades = shadeItems();
96 97
97 98 for (int i = 0; i < layout.size(); ++i) {
98 99 //items
99 100 QGraphicsLineItem *gridItem = static_cast<QGraphicsLineItem*>(lines.at(i));
100 101 QGraphicsLineItem *tickItem = static_cast<QGraphicsLineItem*>(arrow.at(i + 1));
101 102 QGraphicsTextItem *labelItem = static_cast<QGraphicsTextItem *>(labels.at(i));
102 103
103 104 //grid line
104 105 gridItem->setLine(layout[i], gridRect.top(), layout[i], gridRect.bottom());
105 106
106 107 //label text wrapping
107 108 QString text = labelList.at(i);
108 109 QRectF boundingRect;
109 110 // don't truncate empty labels
110 111 if (text.isEmpty()) {
111 112 labelItem->setHtml(text);
112 113 } else {
113 114 qreal labelWidth = axisRect.width() / layout.count() - (2 * labelPadding());
114 115 QString truncatedText = ChartPresenter::truncatedText(axis()->labelsFont(), text,
115 116 axis()->labelsAngle(),
116 117 labelWidth,
117 118 availableSpace, boundingRect);
118 119 labelItem->setTextWidth(ChartPresenter::textBoundingRect(axis()->labelsFont(),
119 120 truncatedText).width());
120 121 labelItem->setHtml(truncatedText);
121 122 }
122 123
123 124 //label transformation origin point
124 125 const QRectF& rect = labelItem->boundingRect();
125 126 QPointF center = rect.center();
126 127 labelItem->setTransformOriginPoint(center.x(), center.y());
127 128 qreal heightDiff = rect.height() - boundingRect.height();
128 129 qreal widthDiff = rect.width() - boundingRect.width();
129 130
130 131 //ticks and label position
131 132 if (axis()->alignment() == Qt::AlignTop) {
132 133 labelItem->setPos(layout[i] - center.x(), axisRect.bottom() - rect.height() + (heightDiff / 2.0) - labelPadding());
133 134 tickItem->setLine(layout[i], axisRect.bottom(), layout[i], axisRect.bottom() - labelPadding());
134 135 } else if (axis()->alignment() == Qt::AlignBottom) {
135 136 labelItem->setPos(layout[i] - center.x(), axisRect.top() - (heightDiff / 2.0) + labelPadding());
136 137 tickItem->setLine(layout[i], axisRect.top(), layout[i], axisRect.top() + labelPadding());
137 138 }
138 139
139 140 //label in between
140 141 bool forceHide = false;
141 142 if (intervalAxis() && (i + 1) != layout.size()) {
142 143 qreal leftBound = qMax(layout[i], gridRect.left());
143 144 qreal rightBound = qMin(layout[i + 1], gridRect.right());
144 145 const qreal delta = rightBound - leftBound;
145 // Hide label in case visible part of the category at the grid edge is too narrow
146 if (delta < boundingRect.width()
147 && (leftBound == gridRect.left() || rightBound == gridRect.right())) {
148 forceHide = true;
146 if (axis()->type() != QAbstractAxis::AxisTypeCategory) {
147 // Hide label in case visible part of the category at the grid edge is too narrow
148 if (delta < boundingRect.width()
149 && (leftBound == gridRect.left() || rightBound == gridRect.right())) {
150 forceHide = true;
151 } else {
152 labelItem->setPos(leftBound + (delta / 2.0) - center.x(), labelItem->pos().y());
153 }
149 154 } else {
150 labelItem->setPos(leftBound + (delta / 2.0) - center.x(), labelItem->pos().y());
155 QCategoryAxis *categoryAxis = static_cast<QCategoryAxis *>(axis());
156 if (categoryAxis->labelsPosition() == QCategoryAxis::AxisLabelsPositionCenter) {
157 if (delta < boundingRect.width()
158 && (leftBound == gridRect.left() || rightBound == gridRect.right())) {
159 forceHide = true;
160 } else {
161 labelItem->setPos(leftBound + (delta / 2.0) - center.x(),
162 labelItem->pos().y());
163 }
164 } else if (categoryAxis->labelsPosition()
165 == QCategoryAxis::AxisLabelsPositionOnValue) {
166 labelItem->setPos(rightBound - center.x(), labelItem->pos().y());
167 }
151 168 }
152 169 }
153 170
154 171 //label overlap detection - compensate one pixel for rounding errors
155 172 if ((labelItem->pos().x() < width && labelItem->toPlainText() == ellipsis) || forceHide ||
156 173 (labelItem->pos().x() + (widthDiff / 2.0)) < (axisRect.left() - 1.0) ||
157 174 (labelItem->pos().x() + (widthDiff / 2.0) - 1.0) > axisRect.right()) {
158 175 labelItem->setVisible(false);
159 176 } else {
160 177 labelItem->setVisible(true);
161 178 width = boundingRect.width() + labelItem->pos().x();
162 179 }
163 180
164 181 //shades
165 182 QGraphicsRectItem *shadeItem = 0;
166 183 if (i == 0)
167 184 shadeItem = static_cast<QGraphicsRectItem *>(shades.at(0));
168 185 else if (i % 2)
169 186 shadeItem = static_cast<QGraphicsRectItem *>(shades.at((i / 2) + 1));
170 187 if (shadeItem) {
171 188 qreal leftBound;
172 189 qreal rightBound;
173 190 if (i == 0) {
174 191 leftBound = gridRect.left();
175 192 rightBound = layout[0];
176 193 } else {
177 194 leftBound = layout[i];
178 195 if (i == layout.size() - 1)
179 196 rightBound = gridRect.right();
180 197 else
181 198 rightBound = qMin(layout[i + 1], gridRect.right());
182 199 }
183 200 if (leftBound < gridRect.left())
184 201 leftBound = gridRect.left();
185 202 if (rightBound > gridRect.right())
186 203 rightBound = gridRect.right();
187 204 shadeItem->setRect(leftBound, gridRect.top(), rightBound - leftBound,
188 205 gridRect.height());
189 206 if (shadeItem->rect().width() <= 0.0)
190 207 shadeItem->setVisible(false);
191 208 else
192 209 shadeItem->setVisible(true);
193 210 }
194 211
195 212 // check if the grid line and the axis tick should be shown
196 213 qreal x = gridItem->line().p1().x();
197 214 if (x < gridRect.left() || x > gridRect.right()) {
198 215 gridItem->setVisible(false);
199 216 tickItem->setVisible(false);
200 217 } else {
201 218 gridItem->setVisible(true);
202 219 tickItem->setVisible(true);
203 220 }
204 221
205 222 }
206 223
207 224 //begin/end grid line in case labels between
208 225 if (intervalAxis()) {
209 226 QGraphicsLineItem *gridLine;
210 227 gridLine = static_cast<QGraphicsLineItem *>(lines.at(layout.size()));
211 228 gridLine->setLine(gridRect.right(), gridRect.top(), gridRect.right(), gridRect.bottom());
212 229 gridLine->setVisible(true);
213 230 gridLine = static_cast<QGraphicsLineItem*>(lines.at(layout.size()+1));
214 231 gridLine->setLine(gridRect.left(), gridRect.top(), gridRect.left(), gridRect.bottom());
215 232 gridLine->setVisible(true);
216 233 }
217 234 }
218 235
219 236 QSizeF HorizontalAxis::sizeHint(Qt::SizeHint which, const QSizeF &constraint) const
220 237 {
221 238 Q_UNUSED(constraint);
222 239 QSizeF sh(0,0);
223 240
224 241 if (axis()->titleText().isEmpty() || !titleItem()->isVisible())
225 242 return sh;
226 243
227 244 switch (which) {
228 245 case Qt::MinimumSize: {
229 246 QRectF titleRect = ChartPresenter::textBoundingRect(axis()->titleFont(),
230 247 QStringLiteral("..."));
231 248 sh = QSizeF(titleRect.width(), titleRect.height() + (titlePadding() * 2.0));
232 249 break;
233 250 }
234 251 case Qt::MaximumSize:
235 252 case Qt::PreferredSize: {
236 253 QRectF titleRect = ChartPresenter::textBoundingRect(axis()->titleFont(), axis()->titleText());
237 254 sh = QSizeF(titleRect.width(), titleRect.height() + (titlePadding() * 2.0));
238 255 break;
239 256 }
240 257 default:
241 258 break;
242 259 }
243 260
244 261 return sh;
245 262 }
246 263
247 264 QT_CHARTS_END_NAMESPACE
@@ -1,251 +1,272
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2015 The Qt Company Ltd
4 4 ** All rights reserved.
5 5 ** For any questions to The Qt Company, please use contact form at http://qt.io
6 6 **
7 7 ** This file is part of the Qt Charts module.
8 8 **
9 9 ** Licensees holding valid commercial license for Qt may use this file in
10 10 ** accordance with the Qt License Agreement provided with the Software
11 11 ** or, alternatively, in accordance with the terms contained in a written
12 12 ** agreement between you and The Qt Company.
13 13 **
14 14 ** If you have questions regarding the use of this file, please use
15 15 ** contact form at http://qt.io
16 16 **
17 17 ****************************************************************************/
18 18
19 19 #include <private/verticalaxis_p.h>
20 20 #include <QtCharts/QAbstractAxis>
21 21 #include <private/chartpresenter_p.h>
22 #include <QtCharts/QCategoryAxis>
22 23 #include <QtCore/QDebug>
23 24
24 25 QT_CHARTS_BEGIN_NAMESPACE
25 26
26 27 VerticalAxis::VerticalAxis(QAbstractAxis *axis, QGraphicsItem *item, bool intervalAxis)
27 28 : CartesianChartAxis(axis, item, intervalAxis)
28 29 {
29 30 }
30 31
31 32 VerticalAxis::~VerticalAxis()
32 33 {
33 34 }
34 35
35 36 void VerticalAxis::updateGeometry()
36 37 {
37 38 const QVector<qreal> &layout = ChartAxisElement::layout();
38 39
39 40 if (layout.isEmpty() && axis()->type() != QAbstractAxis::AxisTypeLogValue)
40 41 return;
41 42
42 43 QStringList labelList = labels();
43 44
44 45 QList<QGraphicsItem *> labels = labelItems();
45 46 QList<QGraphicsItem *> arrow = arrowItems();
46 47 QGraphicsTextItem *title = titleItem();
47 48
48 49 Q_ASSERT(labels.size() == labelList.size());
49 50 Q_ASSERT(layout.size() == labelList.size());
50 51
51 52 const QRectF &axisRect = axisGeometry();
52 53 const QRectF &gridRect = gridGeometry();
53 54
54 55 qreal height = axisRect.bottom();
55 56
56 57 //arrow
57 58 QGraphicsLineItem *arrowItem = static_cast<QGraphicsLineItem*>(arrow.at(0));
58 59
59 60 //arrow position
60 61 if (axis()->alignment() == Qt::AlignLeft)
61 62 arrowItem->setLine(axisRect.right(), gridRect.top(), axisRect.right(), gridRect.bottom());
62 63 else if (axis()->alignment() == Qt::AlignRight)
63 64 arrowItem->setLine(axisRect.left(), gridRect.top(), axisRect.left(), gridRect.bottom());
64 65
65 66 //title
66 67 QRectF titleBoundingRect;
67 68 QString titleText = axis()->titleText();
68 69 qreal availableSpace = axisRect.width() - labelPadding();
69 70 if (!titleText.isEmpty() && titleItem()->isVisible()) {
70 71 availableSpace -= titlePadding() * 2.0;
71 72 qreal minimumLabelWidth = ChartPresenter::textBoundingRect(axis()->labelsFont(),
72 73 QStringLiteral("...")).width();
73 74 qreal titleSpace = availableSpace - minimumLabelWidth;
74 75 title->setHtml(ChartPresenter::truncatedText(axis()->titleFont(), titleText, qreal(90.0),
75 76 titleSpace, gridRect.height(),
76 77 titleBoundingRect));
77 78 title->setTextWidth(titleBoundingRect.height());
78 79
79 80 titleBoundingRect = title->boundingRect();
80 81
81 82 QPointF center = gridRect.center() - titleBoundingRect.center();
82 83 if (axis()->alignment() == Qt::AlignLeft)
83 84 title->setPos(axisRect.left() - titleBoundingRect.width() / 2.0 + titleBoundingRect.height() / 2.0 + titlePadding(), center.y());
84 85 else if (axis()->alignment() == Qt::AlignRight)
85 86 title->setPos(axisRect.right() - titleBoundingRect.width() / 2.0 - titleBoundingRect.height() / 2.0 - titlePadding(), center.y());
86 87
87 88 title->setTransformOriginPoint(titleBoundingRect.center());
88 89 title->setRotation(270);
89 90
90 91 availableSpace -= titleBoundingRect.height();
91 92 }
92 93
93 94 if (layout.isEmpty() && axis()->type() == QAbstractAxis::AxisTypeLogValue)
94 95 return;
95 96
96 97 QList<QGraphicsItem *> lines = gridItems();
97 98 QList<QGraphicsItem *> shades = shadeItems();
98 99
99 100 for (int i = 0; i < layout.size(); ++i) {
100 101 //items
101 102 QGraphicsLineItem *gridItem = static_cast<QGraphicsLineItem *>(lines.at(i));
102 103 QGraphicsLineItem *tickItem = static_cast<QGraphicsLineItem *>(arrow.at(i + 1));
103 104 QGraphicsTextItem *labelItem = static_cast<QGraphicsTextItem *>(labels.at(i));
104 105
105 106 //grid line
106 107 gridItem->setLine(gridRect.left(), layout[i], gridRect.right(), layout[i]);
107 108
108 109 //label text wrapping
109 110 QString text = labelList.at(i);
110 111 QRectF boundingRect;
111 112 // don't truncate empty labels
112 113 if (text.isEmpty()) {
113 114 labelItem->setHtml(text);
114 115 } else {
115 116 qreal labelHeight = (axisRect.height() / layout.count()) - (2 * labelPadding());
116 117 QString truncatedText = ChartPresenter::truncatedText(axis()->labelsFont(), text,
117 118 axis()->labelsAngle(),
118 119 availableSpace,
119 120 labelHeight, boundingRect);
120 121 labelItem->setTextWidth(ChartPresenter::textBoundingRect(axis()->labelsFont(),
121 122 truncatedText).width());
122 123 labelItem->setHtml(truncatedText);
123 124 }
124 125
125 126 //label transformation origin point
126 127 const QRectF &rect = labelItem->boundingRect();
127 128 QPointF center = rect.center();
128 129 labelItem->setTransformOriginPoint(center.x(), center.y());
129 130 qreal widthDiff = rect.width() - boundingRect.width();
130 131 qreal heightDiff = rect.height() - boundingRect.height();
131 132
132 133 //ticks and label position
133 134 if (axis()->alignment() == Qt::AlignLeft) {
134 135 labelItem->setPos(axisRect.right() - rect.width() + (widthDiff / 2.0) - labelPadding(), layout[i] - center.y());
135 136 tickItem->setLine(axisRect.right() - labelPadding(), layout[i], axisRect.right(), layout[i]);
136 137 } else if (axis()->alignment() == Qt::AlignRight) {
137 138 labelItem->setPos(axisRect.left() + labelPadding() - (widthDiff / 2.0), layout[i] - center.y());
138 139 tickItem->setLine(axisRect.left(), layout[i], axisRect.left() + labelPadding(), layout[i]);
139 140 }
140 141
141 142 //label in between
142 143 bool forceHide = false;
144 bool labelOnValue = false;
143 145 if (intervalAxis() && (i + 1) != layout.size()) {
144 146 qreal lowerBound = qMin(layout[i], gridRect.bottom());
145 147 qreal upperBound = qMax(layout[i + 1], gridRect.top());
146 148 const qreal delta = lowerBound - upperBound;
147 // Hide label in case visible part of the category at the grid edge is too narrow
148 if (delta < boundingRect.height()
149 && (lowerBound == gridRect.bottom() || upperBound == gridRect.top())) {
150 forceHide = true;
149 if (axis()->type() != QAbstractAxis::AxisTypeCategory) {
150 // Hide label in case visible part of the category at the grid edge is too narrow
151 if (delta < boundingRect.height()
152 && (lowerBound == gridRect.bottom() || upperBound == gridRect.top())) {
153 forceHide = true;
154 } else {
155 labelItem->setPos(labelItem->pos().x(),
156 lowerBound - (delta / 2.0) - center.y());
157 }
151 158 } else {
152 labelItem->setPos(labelItem->pos().x() , lowerBound - (delta / 2.0) - center.y());
159 QCategoryAxis *categoryAxis = static_cast<QCategoryAxis *>(axis());
160 if (categoryAxis->labelsPosition() == QCategoryAxis::AxisLabelsPositionCenter) {
161 if (delta < boundingRect.height()
162 && (lowerBound == gridRect.bottom() || upperBound == gridRect.top())) {
163 forceHide = true;
164 } else {
165 labelItem->setPos(labelItem->pos().x(),
166 lowerBound - (delta / 2.0) - center.y());
167 }
168 } else if (categoryAxis->labelsPosition()
169 == QCategoryAxis::AxisLabelsPositionOnValue) {
170 labelOnValue = true;
171 labelItem->setPos(labelItem->pos().x(), upperBound - center.y());
172 }
153 173 }
154 174 }
155 175
156 176 //label overlap detection - compensate one pixel for rounding errors
157 177 if (labelItem->pos().y() + boundingRect.height() > height || forceHide ||
158 (labelItem->pos().y() + (heightDiff / 2.0) - 1.0) > axisRect.bottom() ||
159 labelItem->pos().y() + (heightDiff / 2.0) < (axisRect.top() - 1.0)) {
178 ((labelItem->pos().y() + (heightDiff / 2.0) - 1.0) > axisRect.bottom()
179 && !labelOnValue) ||
180 (labelItem->pos().y() + (heightDiff / 2.0) < (axisRect.top() - 1.0) && !labelOnValue)) {
160 181 labelItem->setVisible(false);
161 182 }
162 183 else {
163 184 labelItem->setVisible(true);
164 185 height=labelItem->pos().y();
165 186 }
166 187
167 188 //shades
168 189 QGraphicsRectItem *shadeItem = 0;
169 190 if (i == 0)
170 191 shadeItem = static_cast<QGraphicsRectItem *>(shades.at(0));
171 192 else if (i % 2)
172 193 shadeItem = static_cast<QGraphicsRectItem *>(shades.at((i / 2) + 1));
173 194 if (shadeItem) {
174 195 qreal lowerBound;
175 196 qreal upperBound;
176 197 if (i == 0) {
177 198 lowerBound = gridRect.bottom();
178 199 upperBound = layout[0];
179 200 } else {
180 201 lowerBound = layout[i];
181 202 if (i == layout.size() - 1)
182 203 upperBound = gridRect.top();
183 204 else
184 205 upperBound = qMax(layout[i + 1], gridRect.top());
185 206
186 207 }
187 208 if (lowerBound > gridRect.bottom())
188 209 lowerBound = gridRect.bottom();
189 210 if (upperBound < gridRect.top())
190 211 upperBound = gridRect.top();
191 212 shadeItem->setRect(gridRect.left(), upperBound, gridRect.width(),
192 213 lowerBound - upperBound);
193 214 if (shadeItem->rect().height() <= 0.0)
194 215 shadeItem->setVisible(false);
195 216 else
196 217 shadeItem->setVisible(true);
197 218 }
198 219
199 220 // check if the grid line and the axis tick should be shown
200 221 qreal y = gridItem->line().p1().y();
201 222 if ((y < gridRect.top() || y > gridRect.bottom()))
202 223 {
203 224 gridItem->setVisible(false);
204 225 tickItem->setVisible(false);
205 226 }else{
206 227 gridItem->setVisible(true);
207 228 tickItem->setVisible(true);
208 229 }
209 230
210 231 }
211 232 //begin/end grid line in case labels between
212 233 if (intervalAxis()) {
213 234 QGraphicsLineItem *gridLine;
214 235 gridLine = static_cast<QGraphicsLineItem *>(lines.at(layout.size()));
215 236 gridLine->setLine(gridRect.left(), gridRect.top(), gridRect.right(), gridRect.top());
216 237 gridLine->setVisible(true);
217 238 gridLine = static_cast<QGraphicsLineItem*>(lines.at(layout.size() + 1));
218 239 gridLine->setLine(gridRect.left(), gridRect.bottom(), gridRect.right(), gridRect.bottom());
219 240 gridLine->setVisible(true);
220 241 }
221 242 }
222 243
223 244 QSizeF VerticalAxis::sizeHint(Qt::SizeHint which, const QSizeF &constraint) const
224 245 {
225 246 Q_UNUSED(constraint);
226 247 QSizeF sh(0, 0);
227 248
228 249 if (axis()->titleText().isEmpty() || !titleItem()->isVisible())
229 250 return sh;
230 251
231 252 switch (which) {
232 253 case Qt::MinimumSize: {
233 254 QRectF titleRect = ChartPresenter::textBoundingRect(axis()->titleFont(),
234 255 QStringLiteral("..."));
235 256 sh = QSizeF(titleRect.height() + (titlePadding() * 2.0), titleRect.width());
236 257 break;
237 258 }
238 259 case Qt::MaximumSize:
239 260 case Qt::PreferredSize: {
240 261 QRectF titleRect = ChartPresenter::textBoundingRect(axis()->titleFont(), axis()->titleText());
241 262 sh = QSizeF(titleRect.height() + (titlePadding() * 2.0), titleRect.width());
242 263 break;
243 264 }
244 265 default:
245 266 break;
246 267 }
247 268
248 269 return sh;
249 270 }
250 271
251 272 QT_CHARTS_END_NAMESPACE
@@ -1,310 +1,314
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2015 The Qt Company Ltd
4 4 ** All rights reserved.
5 5 ** For any questions to The Qt Company, please use contact form at http://qt.io
6 6 **
7 7 ** This file is part of the Qt Charts module.
8 8 **
9 9 ** Licensees holding valid commercial license for Qt may use this file in
10 10 ** accordance with the Qt License Agreement provided with the Software
11 11 ** or, alternatively, in accordance with the terms contained in a written
12 12 ** agreement between you and The Qt Company.
13 13 **
14 14 ** If you have questions regarding the use of this file, please use
15 15 ** contact form at http://qt.io
16 16 **
17 17 ****************************************************************************/
18 18
19 19 #include <QtCharts/QChart>
20 20 #include <QtCharts/QAbstractAxis>
21 21 #include <QtCharts/QValueAxis>
22 22 #include <QtCharts/QLogValueAxis>
23 23 #include "declarativecategoryaxis.h"
24 24 #include <QtCharts/QBarCategoryAxis>
25 25 #include "declarativechart.h"
26 26 #include "declarativepolarchart.h"
27 27 #include "declarativexypoint.h"
28 28 #include "declarativelineseries.h"
29 29 #include "declarativesplineseries.h"
30 30 #include "declarativeareaseries.h"
31 31 #include "declarativescatterseries.h"
32 32 #include "declarativebarseries.h"
33 33 #include "declarativeboxplotseries.h"
34 34 #include "declarativepieseries.h"
35 35 #include "declarativeaxes.h"
36 36 #include <QtCharts/QVXYModelMapper>
37 37 #include <QtCharts/QHXYModelMapper>
38 38 #include <QtCharts/QHPieModelMapper>
39 39 #include <QtCharts/QVPieModelMapper>
40 40 #include <QtCharts/QHBarModelMapper>
41 41 #include <QtCharts/QVBarModelMapper>
42 42 #include "declarativemargins.h"
43 43 #include <QtCharts/QAreaLegendMarker>
44 44 #include <QtCharts/QBarLegendMarker>
45 45 #include <QtCharts/QPieLegendMarker>
46 46 #include <QtCharts/QXYLegendMarker>
47 47 #include <QtCharts/QBoxPlotModelMapper>
48 48 #include <QtCharts/QVBoxPlotModelMapper>
49 49 #ifndef QT_ON_ARM
50 50 #include <QtCharts/QDateTimeAxis>
51 51 #endif
52 52 #include <QtCore/QAbstractItemModel>
53 53 #include <QtQml>
54 54
55 55 QT_CHARTS_USE_NAMESPACE
56 56
57 57 QML_DECLARE_TYPE(QList<QPieSlice *>)
58 58 QML_DECLARE_TYPE(QList<QBarSet *>)
59 59 QML_DECLARE_TYPE(QList<QAbstractAxis *>)
60 60
61 61 QML_DECLARE_TYPE(DeclarativeChart)
62 62 QML_DECLARE_TYPE(DeclarativePolarChart)
63 63 QML_DECLARE_TYPE(DeclarativeMargins)
64 64 QML_DECLARE_TYPE(DeclarativeAreaSeries)
65 65 QML_DECLARE_TYPE(DeclarativeBarSeries)
66 66 QML_DECLARE_TYPE(DeclarativeBarSet)
67 67 QML_DECLARE_TYPE(DeclarativeBoxPlotSeries)
68 68 QML_DECLARE_TYPE(DeclarativeBoxSet)
69 69 QML_DECLARE_TYPE(DeclarativeLineSeries)
70 70 QML_DECLARE_TYPE(DeclarativePieSeries)
71 71 QML_DECLARE_TYPE(DeclarativePieSlice)
72 72 QML_DECLARE_TYPE(DeclarativeScatterSeries)
73 73 QML_DECLARE_TYPE(DeclarativeSplineSeries)
74 74
75 75 QML_DECLARE_TYPE(QAbstractAxis)
76 76 QML_DECLARE_TYPE(QValueAxis)
77 77 QML_DECLARE_TYPE(QBarCategoryAxis)
78 78 QML_DECLARE_TYPE(QCategoryAxis)
79 79 QML_DECLARE_TYPE(QDateTimeAxis)
80 80 QML_DECLARE_TYPE(QLogValueAxis)
81 81
82 82 QML_DECLARE_TYPE(QLegend)
83 83 QML_DECLARE_TYPE(QLegendMarker)
84 84 QML_DECLARE_TYPE(QAreaLegendMarker)
85 85 QML_DECLARE_TYPE(QBarLegendMarker)
86 86 QML_DECLARE_TYPE(QPieLegendMarker)
87 87
88 88 QML_DECLARE_TYPE(QHPieModelMapper)
89 89 QML_DECLARE_TYPE(QHXYModelMapper)
90 90 QML_DECLARE_TYPE(QPieModelMapper)
91 91 QML_DECLARE_TYPE(QHBarModelMapper)
92 92 QML_DECLARE_TYPE(QBarModelMapper)
93 93 QML_DECLARE_TYPE(QVBarModelMapper)
94 94 QML_DECLARE_TYPE(QVPieModelMapper)
95 95 QML_DECLARE_TYPE(QVXYModelMapper)
96 96 QML_DECLARE_TYPE(QXYLegendMarker)
97 97 QML_DECLARE_TYPE(QXYModelMapper)
98 98 QML_DECLARE_TYPE(QBoxPlotModelMapper)
99 99 QML_DECLARE_TYPE(QVBoxPlotModelMapper)
100 100
101 101 QML_DECLARE_TYPE(QAbstractSeries)
102 102 QML_DECLARE_TYPE(QXYSeries)
103 103 QML_DECLARE_TYPE(QAbstractBarSeries)
104 104 QML_DECLARE_TYPE(QBarSeries)
105 105 QML_DECLARE_TYPE(QBarSet)
106 106 QML_DECLARE_TYPE(QAreaSeries)
107 107 QML_DECLARE_TYPE(QHorizontalBarSeries)
108 108 QML_DECLARE_TYPE(QHorizontalPercentBarSeries)
109 109 QML_DECLARE_TYPE(QHorizontalStackedBarSeries)
110 110 QML_DECLARE_TYPE(QLineSeries)
111 111 QML_DECLARE_TYPE(QPercentBarSeries)
112 112 QML_DECLARE_TYPE(QPieSeries)
113 113 QML_DECLARE_TYPE(QPieSlice)
114 114 QML_DECLARE_TYPE(QScatterSeries)
115 115 QML_DECLARE_TYPE(QSplineSeries)
116 116 QML_DECLARE_TYPE(QStackedBarSeries)
117 117
118 118 QT_CHARTS_BEGIN_NAMESPACE
119 119
120 120 class QtChartsQml2Plugin : public QQmlExtensionPlugin
121 121 {
122 122 Q_OBJECT
123 123
124 124 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
125 125
126 126 public:
127 127 virtual void registerTypes(const char *uri)
128 128 {
129 129 Q_ASSERT(QLatin1String(uri) == QLatin1String("QtCharts"));
130 130
131 131 // @uri QtCharts
132 132
133 133 qRegisterMetaType<QList<QPieSlice *> >();
134 134 qRegisterMetaType<QList<QBarSet *> >();
135 135 qRegisterMetaType<QList<QAbstractAxis *> >();
136 136
137 137 // QtCharts 1.0
138 138 qmlRegisterType<DeclarativeChart>(uri, 1, 0, "ChartView");
139 139 qmlRegisterType<DeclarativeXYPoint>(uri, 1, 0, "XYPoint");
140 140 qmlRegisterType<DeclarativeScatterSeries>(uri, 1, 0, "ScatterSeries");
141 141 qmlRegisterType<DeclarativeLineSeries>(uri, 1, 0, "LineSeries");
142 142 qmlRegisterType<DeclarativeSplineSeries>(uri, 1, 0, "SplineSeries");
143 143 qmlRegisterType<DeclarativeAreaSeries>(uri, 1, 0, "AreaSeries");
144 144 qmlRegisterType<DeclarativeBarSeries>(uri, 1, 0, "BarSeries");
145 145 qmlRegisterType<DeclarativeStackedBarSeries>(uri, 1, 0, "StackedBarSeries");
146 146 qmlRegisterType<DeclarativePercentBarSeries>(uri, 1, 0, "PercentBarSeries");
147 147 qmlRegisterType<DeclarativePieSeries>(uri, 1, 0, "PieSeries");
148 148 qmlRegisterType<QPieSlice>(uri, 1, 0, "PieSlice");
149 149 qmlRegisterType<DeclarativeBarSet>(uri, 1, 0, "BarSet");
150 150 qmlRegisterType<QHXYModelMapper>(uri, 1, 0, "HXYModelMapper");
151 151 qmlRegisterType<QVXYModelMapper>(uri, 1, 0, "VXYModelMapper");
152 152 qmlRegisterType<QHPieModelMapper>(uri, 1, 0, "HPieModelMapper");
153 153 qmlRegisterType<QVPieModelMapper>(uri, 1, 0, "VPieModelMapper");
154 154 qmlRegisterType<QHBarModelMapper>(uri, 1, 0, "HBarModelMapper");
155 155 qmlRegisterType<QVBarModelMapper>(uri, 1, 0, "VBarModelMapper");
156 156
157 157 qmlRegisterType<QValueAxis>(uri, 1, 0, "ValuesAxis");
158 158 qmlRegisterType<QBarCategoryAxis>(uri, 1, 0, "BarCategoriesAxis");
159 159 qmlRegisterUncreatableType<QLegend>(uri, 1, 0, "Legend",
160 160 QLatin1String("Trying to create uncreatable: Legend."));
161 161 qmlRegisterUncreatableType<QXYSeries>(uri, 1, 0, "XYSeries",
162 162 QLatin1String("Trying to create uncreatable: XYSeries."));
163 163 qmlRegisterUncreatableType<QAbstractItemModel>(uri, 1, 0, "AbstractItemModel",
164 164 QLatin1String("Trying to create uncreatable: AbstractItemModel."));
165 165 qmlRegisterUncreatableType<QXYModelMapper>(uri, 1, 0, "XYModelMapper",
166 166 QLatin1String("Trying to create uncreatable: XYModelMapper."));
167 167 qmlRegisterUncreatableType<QPieModelMapper>(uri, 1, 0, "PieModelMapper",
168 168 QLatin1String("Trying to create uncreatable: PieModelMapper."));
169 169 qmlRegisterUncreatableType<QBarModelMapper>(uri, 1, 0, "BarModelMapper",
170 170 QLatin1String("Trying to create uncreatable: BarModelMapper."));
171 171 qmlRegisterUncreatableType<QAbstractSeries>(uri, 1, 0, "AbstractSeries",
172 172 QLatin1String("Trying to create uncreatable: AbstractSeries."));
173 173 qmlRegisterUncreatableType<QAbstractBarSeries>(uri, 1, 0, "AbstractBarSeries",
174 174 QLatin1String("Trying to create uncreatable: AbstractBarSeries."));
175 175 qmlRegisterUncreatableType<QAbstractAxis>(uri, 1, 0, "AbstractAxis",
176 176 QLatin1String("Trying to create uncreatable: AbstractAxis. Use specific types of axis instead."));
177 177 qmlRegisterUncreatableType<QBarSet>(uri, 1, 0, "BarSetBase",
178 178 QLatin1String("Trying to create uncreatable: BarsetBase."));
179 179 qmlRegisterUncreatableType<QPieSeries>(uri, 1, 0, "QPieSeries",
180 180 QLatin1String("Trying to create uncreatable: QPieSeries. Use PieSeries instead."));
181 181 qmlRegisterUncreatableType<DeclarativeAxes>(uri, 1, 0, "DeclarativeAxes",
182 182 QLatin1String("Trying to create uncreatable: DeclarativeAxes."));
183 183
184 184 // QtCharts 1.1
185 185 qmlRegisterType<DeclarativeChart, 1>(uri, 1, 1, "ChartView");
186 186 qmlRegisterType<DeclarativeScatterSeries, 1>(uri, 1, 1, "ScatterSeries");
187 187 qmlRegisterType<DeclarativeLineSeries, 1>(uri, 1, 1, "LineSeries");
188 188 qmlRegisterType<DeclarativeSplineSeries, 1>(uri, 1, 1, "SplineSeries");
189 189 qmlRegisterType<DeclarativeAreaSeries, 1>(uri, 1, 1, "AreaSeries");
190 190 qmlRegisterType<DeclarativeBarSeries, 1>(uri, 1, 1, "BarSeries");
191 191 qmlRegisterType<DeclarativeStackedBarSeries, 1>(uri, 1, 1, "StackedBarSeries");
192 192 qmlRegisterType<DeclarativePercentBarSeries, 1>(uri, 1, 1, "PercentBarSeries");
193 193 qmlRegisterType<DeclarativeHorizontalBarSeries, 1>(uri, 1, 1, "HorizontalBarSeries");
194 194 qmlRegisterType<DeclarativeHorizontalStackedBarSeries, 1>(uri, 1, 1, "HorizontalStackedBarSeries");
195 195 qmlRegisterType<DeclarativeHorizontalPercentBarSeries, 1>(uri, 1, 1, "HorizontalPercentBarSeries");
196 196 qmlRegisterType<DeclarativePieSeries>(uri, 1, 1, "PieSeries");
197 197 qmlRegisterType<DeclarativeBarSet>(uri, 1, 1, "BarSet");
198 198 qmlRegisterType<QValueAxis>(uri, 1, 1, "ValueAxis");
199 199 #ifndef QT_ON_ARM
200 200 qmlRegisterType<QDateTimeAxis>(uri, 1, 1, "DateTimeAxis");
201 201 #endif
202 202 qmlRegisterType<DeclarativeCategoryAxis>(uri, 1, 1, "CategoryAxis");
203 203 qmlRegisterType<DeclarativeCategoryRange>(uri, 1, 1, "CategoryRange");
204 204 qmlRegisterType<QBarCategoryAxis>(uri, 1, 1, "BarCategoryAxis");
205 205 qmlRegisterUncreatableType<DeclarativeMargins>(uri, 1, 1, "Margins",
206 206 QLatin1String("Trying to create uncreatable: Margins."));
207 207
208 208 // QtCharts 1.2
209 209 qmlRegisterType<DeclarativeChart, 2>(uri, 1, 2, "ChartView");
210 210 qmlRegisterType<DeclarativeScatterSeries, 2>(uri, 1, 2, "ScatterSeries");
211 211 qmlRegisterType<DeclarativeLineSeries, 2>(uri, 1, 2, "LineSeries");
212 212 qmlRegisterType<DeclarativeSplineSeries, 2>(uri, 1, 2, "SplineSeries");
213 213 qmlRegisterType<DeclarativeAreaSeries, 2>(uri, 1, 2, "AreaSeries");
214 214 qmlRegisterType<DeclarativeBarSeries, 2>(uri, 1, 2, "BarSeries");
215 215 qmlRegisterType<DeclarativeStackedBarSeries, 2>(uri, 1, 2, "StackedBarSeries");
216 216 qmlRegisterType<DeclarativePercentBarSeries, 2>(uri, 1, 2, "PercentBarSeries");
217 217 qmlRegisterType<DeclarativeHorizontalBarSeries, 2>(uri, 1, 2, "HorizontalBarSeries");
218 218 qmlRegisterType<DeclarativeHorizontalStackedBarSeries, 2>(uri, 1, 2, "HorizontalStackedBarSeries");
219 219 qmlRegisterType<DeclarativeHorizontalPercentBarSeries, 2>(uri, 1, 2, "HorizontalPercentBarSeries");
220 220
221 221 // QtCharts 1.3
222 222 qmlRegisterType<DeclarativeChart, 3>(uri, 1, 3, "ChartView");
223 223 qmlRegisterType<DeclarativePolarChart, 1>(uri, 1, 3, "PolarChartView");
224 224 qmlRegisterType<DeclarativeSplineSeries, 3>(uri, 1, 3, "SplineSeries");
225 225 qmlRegisterType<DeclarativeScatterSeries, 3>(uri, 1, 3, "ScatterSeries");
226 226 qmlRegisterType<DeclarativeLineSeries, 3>(uri, 1, 3, "LineSeries");
227 227 qmlRegisterType<DeclarativeAreaSeries, 3>(uri, 1, 3, "AreaSeries");
228 228 qmlRegisterType<QLogValueAxis>(uri, 1, 3, "LogValueAxis");
229 229 qmlRegisterType<DeclarativeBoxPlotSeries>(uri, 1, 3, "BoxPlotSeries");
230 230 qmlRegisterType<DeclarativeBoxSet>(uri, 1, 3, "BoxSet");
231 231
232 232 // QtCharts 1.4
233 233 qmlRegisterType<DeclarativeAreaSeries, 4>(uri, 1, 4, "AreaSeries");
234 234 qmlRegisterType<DeclarativeBarSet, 2>(uri, 1, 4, "BarSet");
235 235 qmlRegisterType<DeclarativeBoxPlotSeries, 1>(uri, 1, 4, "BoxPlotSeries");
236 236 qmlRegisterType<DeclarativeBoxSet, 1>(uri, 1, 4, "BoxSet");
237 237 qmlRegisterType<DeclarativePieSlice>(uri, 1, 4, "PieSlice");
238 238 qmlRegisterType<DeclarativeScatterSeries, 4>(uri, 1, 4, "ScatterSeries");
239 239
240 240 // QtCharts 2.0
241 241 qmlRegisterType<QVBoxPlotModelMapper>(uri, 2, 0, "VBoxPlotModelMapper");
242 242 qmlRegisterUncreatableType<QBoxPlotModelMapper>(uri, 2, 0, "BoxPlotModelMapper",
243 243 QLatin1String("Trying to create uncreatable: BoxPlotModelMapper."));
244 244 qmlRegisterType<DeclarativeChart, 4>(uri, 2, 0, "ChartView");
245 245 qmlRegisterType<DeclarativeXYPoint>(uri, 2, 0, "XYPoint");
246 246 qmlRegisterType<DeclarativeScatterSeries, 4>(uri, 2, 0, "ScatterSeries");
247 247 qmlRegisterType<DeclarativeLineSeries, 3>(uri, 2, 0, "LineSeries");
248 248 qmlRegisterType<DeclarativeSplineSeries, 3>(uri, 2, 0, "SplineSeries");
249 249 qmlRegisterType<DeclarativeAreaSeries, 4>(uri, 2, 0, "AreaSeries");
250 250 qmlRegisterType<DeclarativeBarSeries, 2>(uri, 2, 0, "BarSeries");
251 251 qmlRegisterType<DeclarativeStackedBarSeries, 2>(uri, 2, 0, "StackedBarSeries");
252 252 qmlRegisterType<DeclarativePercentBarSeries, 2>(uri, 2, 0, "PercentBarSeries");
253 253 qmlRegisterType<DeclarativePieSeries>(uri, 2, 0, "PieSeries");
254 254 qmlRegisterType<QPieSlice>(uri, 2, 0, "PieSlice");
255 255 qmlRegisterType<DeclarativeBarSet, 2>(uri, 2, 0, "BarSet");
256 256 qmlRegisterType<QHXYModelMapper>(uri, 2, 0, "HXYModelMapper");
257 257 qmlRegisterType<QVXYModelMapper>(uri, 2, 0, "VXYModelMapper");
258 258 qmlRegisterType<QHPieModelMapper>(uri, 2, 0, "HPieModelMapper");
259 259 qmlRegisterType<QVPieModelMapper>(uri, 2, 0, "VPieModelMapper");
260 260 qmlRegisterType<QHBarModelMapper>(uri, 2, 0, "HBarModelMapper");
261 261 qmlRegisterType<QVBarModelMapper>(uri, 2, 0, "VBarModelMapper");
262 262 qmlRegisterType<QValueAxis>(uri, 2, 0, "ValueAxis");
263 263 #ifndef QT_ON_ARM
264 264 qmlRegisterType<QDateTimeAxis>(uri, 2, 0, "DateTimeAxis");
265 265 #endif
266 266 qmlRegisterType<DeclarativeCategoryAxis>(uri, 2, 0, "CategoryAxis");
267 267 qmlRegisterType<DeclarativeCategoryRange>(uri, 2, 0, "CategoryRange");
268 268 qmlRegisterType<QBarCategoryAxis>(uri, 2, 0, "BarCategoryAxis");
269 269 qmlRegisterType<DeclarativePolarChart, 1>(uri, 2, 0, "PolarChartView");
270 270 qmlRegisterType<QLogValueAxis, 1>(uri, 2, 0, "LogValueAxis");
271 271 qmlRegisterType<DeclarativeBoxPlotSeries, 1>(uri, 2, 0, "BoxPlotSeries");
272 272 qmlRegisterType<DeclarativeBoxSet, 1>(uri, 2, 0, "BoxSet");
273 273 qmlRegisterType<DeclarativeHorizontalBarSeries, 2>(uri, 2, 0, "HorizontalBarSeries");
274 274 qmlRegisterType<DeclarativeHorizontalStackedBarSeries, 2>(uri, 2, 0, "HorizontalStackedBarSeries");
275 275 qmlRegisterType<DeclarativeHorizontalPercentBarSeries, 2>(uri, 2, 0, "HorizontalPercentBarSeries");
276 276 qmlRegisterType<DeclarativePieSlice>(uri, 2, 0, "PieSlice");
277 277 qmlRegisterUncreatableType<QLegend>(uri, 2, 0, "Legend",
278 278 QLatin1String("Trying to create uncreatable: Legend."));
279 279 qmlRegisterUncreatableType<QXYSeries>(uri, 2, 0, "XYSeries",
280 280 QLatin1String("Trying to create uncreatable: XYSeries."));
281 281 qmlRegisterUncreatableType<QAbstractItemModel>(uri, 2, 0, "AbstractItemModel",
282 282 QLatin1String("Trying to create uncreatable: AbstractItemModel."));
283 283 qmlRegisterUncreatableType<QXYModelMapper>(uri, 2, 0, "XYModelMapper",
284 284 QLatin1String("Trying to create uncreatable: XYModelMapper."));
285 285 qmlRegisterUncreatableType<QPieModelMapper>(uri, 2, 0, "PieModelMapper",
286 286 QLatin1String("Trying to create uncreatable: PieModelMapper."));
287 287 qmlRegisterUncreatableType<QBarModelMapper>(uri, 2, 0, "BarModelMapper",
288 288 QLatin1String("Trying to create uncreatable: BarModelMapper."));
289 289 qmlRegisterUncreatableType<QAbstractSeries>(uri, 2, 0, "AbstractSeries",
290 290 QLatin1String("Trying to create uncreatable: AbstractSeries."));
291 291 qmlRegisterUncreatableType<QAbstractBarSeries>(uri, 2, 0, "AbstractBarSeries",
292 292 QLatin1String("Trying to create uncreatable: AbstractBarSeries."));
293 293 qmlRegisterUncreatableType<QAbstractAxis>(uri, 2, 0, "AbstractAxis",
294 294 QLatin1String("Trying to create uncreatable: AbstractAxis. Use specific types of axis instead."));
295 295 qmlRegisterUncreatableType<QBarSet>(uri, 2, 0, "BarSetBase",
296 296 QLatin1String("Trying to create uncreatable: BarsetBase."));
297 297 qmlRegisterUncreatableType<QPieSeries>(uri, 2, 0, "QPieSeries",
298 298 QLatin1String("Trying to create uncreatable: QPieSeries. Use PieSeries instead."));
299 299 qmlRegisterUncreatableType<DeclarativeAxes>(uri, 2, 0, "DeclarativeAxes",
300 300 QLatin1String("Trying to create uncreatable: DeclarativeAxes."));
301 301 qmlRegisterUncreatableType<DeclarativeMargins>(uri, 2, 0, "Margins",
302 302 QLatin1String("Trying to create uncreatable: Margins."));
303
304 // QtCharts 2.1
305 qmlRegisterType<DeclarativeCategoryAxis, 1>(uri, 2, 1, "CategoryAxis");
303 306 }
307
304 308 };
305 309
306 310 QT_CHARTS_END_NAMESPACE
307 311
308 312 #include "chartsqml2_plugin.moc"
309 313
310 314 QT_CHARTS_USE_NAMESPACE
@@ -1,98 +1,112
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2015 The Qt Company Ltd
4 4 ** All rights reserved.
5 5 ** For any questions to The Qt Company, please use contact form at http://qt.io
6 6 **
7 7 ** This file is part of the Qt Charts module.
8 8 **
9 9 ** Licensees holding valid commercial license for Qt may use this file in
10 10 ** accordance with the Qt License Agreement provided with the Software
11 11 ** or, alternatively, in accordance with the terms contained in a written
12 12 ** agreement between you and The Qt Company.
13 13 **
14 14 ** If you have questions regarding the use of this file, please use
15 15 ** contact form at http://qt.io
16 16 **
17 17 ****************************************************************************/
18 18
19 19 #include "declarativecategoryaxis.h"
20 20 #include <QtCore/QDebug>
21 21
22 22 QT_CHARTS_BEGIN_NAMESPACE
23 23
24 24 /*!
25 25 \qmltype CategoryRange
26 26 \inqmlmodule QtCharts
27 27
28 28 \brief With CategoryRange you can define a range used by a CategoryAxis.
29 29 \sa CategoryAxis
30 30 */
31 31
32 32 DeclarativeCategoryRange::DeclarativeCategoryRange(QObject *parent) :
33 33 QObject(parent),
34 34 m_endValue(0),
35 35 m_label(QString())
36 36 {
37 37 }
38 38
39 39 DeclarativeCategoryAxis::DeclarativeCategoryAxis(QObject *parent) :
40 40 QCategoryAxis(parent)
41 41 {
42 42 }
43 43
44 44 void DeclarativeCategoryAxis::classBegin()
45 45 {
46 46 }
47 47
48 48 void DeclarativeCategoryAxis::componentComplete()
49 49 {
50 50 QList<QPair<QString, qreal> > ranges;
51 51 foreach (QObject *child, children()) {
52 52 if (qobject_cast<DeclarativeCategoryRange *>(child)) {
53 53 DeclarativeCategoryRange *range = qobject_cast<DeclarativeCategoryRange *>(child);
54 54 ranges.append(QPair<QString, qreal>(range->label(), range->endValue()));
55 55 }
56 56 }
57 57
58 58 // Sort and append the range objects according to end value
59 59 qSort(ranges.begin(), ranges.end(), endValueLessThan);
60 60 for (int i(0); i < ranges.count(); i++)
61 61 append(ranges.at(i).first, ranges.at(i).second);
62 62 }
63 63
64 64 bool DeclarativeCategoryAxis::endValueLessThan(const QPair<QString, qreal> &value1, const QPair<QString, qreal> &value2)
65 65 {
66 66 return value1.second < value2.second;
67 67 }
68 68
69 69 QQmlListProperty<QObject> DeclarativeCategoryAxis::axisChildren()
70 70 {
71 71 return QQmlListProperty<QObject>(this, 0, &DeclarativeCategoryAxis::appendAxisChildren ,0,0,0);
72 72 }
73 73
74 74 void DeclarativeCategoryAxis::append(const QString &label, qreal categoryEndValue)
75 75 {
76 76 QCategoryAxis::append(label, categoryEndValue);
77 77 }
78 78
79 79 void DeclarativeCategoryAxis::remove(const QString &label)
80 80 {
81 81 QCategoryAxis::remove(label);
82 82 }
83 83
84 84 void DeclarativeCategoryAxis::replace(const QString &oldLabel, const QString &newLabel)
85 85 {
86 86 QCategoryAxis::replaceLabel(oldLabel, newLabel);
87 87 }
88 88
89 89 void DeclarativeCategoryAxis::appendAxisChildren(QQmlListProperty<QObject> *list, QObject *element)
90 90 {
91 91 // Empty implementation; the children are parsed in componentComplete instead
92 92 Q_UNUSED(list)
93 93 Q_UNUSED(element)
94 94 }
95 95
96 DeclarativeCategoryAxis::AxisLabelsPosition DeclarativeCategoryAxis::labelsPosition() const
97 {
98 return (DeclarativeCategoryAxis::AxisLabelsPosition) QCategoryAxis::labelsPosition();
99 }
100
101 void DeclarativeCategoryAxis::setLabelsPosition(AxisLabelsPosition position)
102 {
103 QCategoryAxis::AxisLabelsPosition labelsPosition = (QCategoryAxis::AxisLabelsPosition) position;
104 if (labelsPosition != m_labelsPosition) {
105 QCategoryAxis::setLabelsPosition(labelsPosition);
106 emit labelsPositionChanged(position);
107 }
108 }
109
96 110 #include "moc_declarativecategoryaxis.cpp"
97 111
98 112 QT_CHARTS_END_NAMESPACE
@@ -1,74 +1,93
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2015 The Qt Company Ltd
4 4 ** All rights reserved.
5 5 ** For any questions to The Qt Company, please use contact form at http://qt.io
6 6 **
7 7 ** This file is part of the Qt Charts module.
8 8 **
9 9 ** Licensees holding valid commercial license for Qt may use this file in
10 10 ** accordance with the Qt License Agreement provided with the Software
11 11 ** or, alternatively, in accordance with the terms contained in a written
12 12 ** agreement between you and The Qt Company.
13 13 **
14 14 ** If you have questions regarding the use of this file, please use
15 15 ** contact form at http://qt.io
16 16 **
17 17 ****************************************************************************/
18 18
19 19 #ifndef DECLARATIVECATEGORYAXIS_H
20 20 #define DECLARATIVECATEGORYAXIS_H
21 21
22 22 #include <QtCharts/QCategoryAxis>
23 23
24 24 #include <QtQml/QQmlListProperty>
25 25 #include <QtQml/QQmlParserStatus>
26 26
27 27 QT_CHARTS_BEGIN_NAMESPACE
28 28
29 29 class DeclarativeCategoryRange : public QObject
30 30 {
31 31 Q_OBJECT
32 32 Q_PROPERTY(qreal endValue READ endValue WRITE setEndValue)
33 33 Q_PROPERTY(QString label READ label WRITE setLabel)
34 34
35 35 public:
36 36 explicit DeclarativeCategoryRange(QObject *parent = 0);
37 37 qreal endValue() { return m_endValue; }
38 38 void setEndValue(qreal endValue) { m_endValue = endValue; }
39 39 QString label() { return m_label; }
40 40 void setLabel(QString label) { m_label = label; }
41 41
42 42 private:
43 43 qreal m_endValue;
44 44 QString m_label;
45 45 };
46 46
47 47 class DeclarativeCategoryAxis : public QCategoryAxis, public QQmlParserStatus
48 48 {
49 49 Q_OBJECT
50 50 Q_INTERFACES(QQmlParserStatus)
51 51 Q_PROPERTY(QQmlListProperty<QObject> axisChildren READ axisChildren)
52 52 Q_CLASSINFO("DefaultProperty", "axisChildren")
53 Q_PROPERTY(AxisLabelsPosition labelsPosition READ labelsPosition WRITE setLabelsPosition NOTIFY labelsPositionChanged REVISION 1)
54 Q_ENUMS(AxisLabelsPosition)
53 55
54 56 public:
57 // duplicating enums from QChart to make the QML api namings 1-to-1 with the C++ api
58 enum AxisLabelsPosition {
59 AxisLabelsPositionCenter = 0x0,
60 AxisLabelsPositionOnValue = 0x1
61 };
62
55 63 explicit DeclarativeCategoryAxis(QObject *parent = 0);
56 64 QQmlListProperty<QObject> axisChildren();
57 65
66
58 67 public: // from QDeclarativeParserStatus
59 68 void classBegin();
60 69 void componentComplete();
61 70
71 public:
72 AxisLabelsPosition labelsPosition() const;
73 void setLabelsPosition(AxisLabelsPosition position);
74
75 Q_SIGNALS:
76 Q_REVISION(1) void labelsPositionChanged(AxisLabelsPosition position);
77
62 78 public Q_SLOTS:
63 79 Q_INVOKABLE void append(const QString &label, qreal categoryEndValue);
64 80 Q_INVOKABLE void remove(const QString &label);
65 81 Q_INVOKABLE void replace(const QString &oldLabel, const QString &newLabel);
66 82 static void appendAxisChildren(QQmlListProperty<QObject> *list, QObject *element);
67 83
68 84 private:
69 85 static bool endValueLessThan(const QPair<QString, qreal> &value1, const QPair<QString, qreal> &value2);
86
87 private:
88 AxisLabelsPosition m_labelsPosition;
70 89 };
71 90
72 91 QT_CHARTS_END_NAMESPACE
73 92
74 93 #endif // DECLARATIVECATEGORYAXIS_H
@@ -1,2378 +1,2407
1 1 import QtQuick.tooling 1.1
2 2
3 3 // This file describes the plugin-supplied types contained in the library.
4 4 // It is used for QML tooling purposes only.
5 5 //
6 6 // This file was auto-generated by:
7 7 // 'qmlplugindump -nonrelocatable QtCharts 2.0'
8 8
9 9 Module {
10 10 Component {
11 11 name: "QGraphicsObject"
12 12 defaultProperty: "children"
13 13 prototype: "QObject"
14 14 Property { name: "parent"; type: "QGraphicsObject"; isPointer: true }
15 15 Property { name: "opacity"; type: "double" }
16 16 Property { name: "enabled"; type: "bool" }
17 17 Property { name: "visible"; type: "bool" }
18 18 Property { name: "pos"; type: "QPointF" }
19 19 Property { name: "x"; type: "double" }
20 20 Property { name: "y"; type: "double" }
21 21 Property { name: "z"; type: "double" }
22 22 Property { name: "rotation"; type: "double" }
23 23 Property { name: "scale"; type: "double" }
24 24 Property { name: "transformOriginPoint"; type: "QPointF" }
25 25 Property { name: "effect"; type: "QGraphicsEffect"; isPointer: true }
26 26 Property {
27 27 name: "children"
28 28 type: "QDeclarativeListProperty<QGraphicsObject>"
29 29 isReadonly: true
30 30 }
31 31 Property { name: "width"; type: "double" }
32 32 Property { name: "height"; type: "double" }
33 33 }
34 34 Component {
35 35 name: "QGraphicsWidget"
36 36 defaultProperty: "children"
37 37 prototype: "QGraphicsObject"
38 38 Property { name: "palette"; type: "QPalette" }
39 39 Property { name: "font"; type: "QFont" }
40 40 Property { name: "layoutDirection"; type: "Qt::LayoutDirection" }
41 41 Property { name: "size"; type: "QSizeF" }
42 42 Property { name: "minimumSize"; type: "QSizeF" }
43 43 Property { name: "preferredSize"; type: "QSizeF" }
44 44 Property { name: "maximumSize"; type: "QSizeF" }
45 45 Property { name: "sizePolicy"; type: "QSizePolicy" }
46 46 Property { name: "focusPolicy"; type: "Qt::FocusPolicy" }
47 47 Property { name: "windowFlags"; type: "Qt::WindowFlags" }
48 48 Property { name: "windowTitle"; type: "string" }
49 49 Property { name: "geometry"; type: "QRectF" }
50 50 Property { name: "autoFillBackground"; type: "bool" }
51 51 Property { name: "layout"; type: "QGraphicsLayout"; isPointer: true }
52 52 Method { name: "close"; type: "bool" }
53 53 }
54 54 Component {
55 55 name: "QtCharts::DeclarativeAreaSeries"
56 56 prototype: "QtCharts::QAreaSeries"
57 57 exports: [
58 58 "QtCharts/AreaSeries 1.0",
59 59 "QtCharts/AreaSeries 1.1",
60 60 "QtCharts/AreaSeries 1.2",
61 61 "QtCharts/AreaSeries 1.3",
62 62 "QtCharts/AreaSeries 1.4",
63 63 "QtCharts/AreaSeries 2.0"
64 64 ]
65 65 exportMetaObjectRevisions: [0, 1, 2, 3, 4, 4]
66 66 Property { name: "upperSeries"; type: "DeclarativeLineSeries"; isPointer: true }
67 67 Property { name: "lowerSeries"; type: "DeclarativeLineSeries"; isPointer: true }
68 68 Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true }
69 69 Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true }
70 70 Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true }
71 71 Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true }
72 72 Property { name: "axisAngular"; revision: 3; type: "QAbstractAxis"; isPointer: true }
73 73 Property { name: "axisRadial"; revision: 3; type: "QAbstractAxis"; isPointer: true }
74 74 Property { name: "borderWidth"; revision: 1; type: "double" }
75 75 Property { name: "brushFilename"; revision: 4; type: "string" }
76 76 Property { name: "brush"; revision: 4; type: "QBrush" }
77 77 Signal {
78 78 name: "axisXChanged"
79 79 revision: 1
80 80 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
81 81 }
82 82 Signal {
83 83 name: "axisYChanged"
84 84 revision: 1
85 85 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
86 86 }
87 87 Signal {
88 88 name: "borderWidthChanged"
89 89 revision: 1
90 90 Parameter { name: "width"; type: "double" }
91 91 }
92 92 Signal {
93 93 name: "axisXTopChanged"
94 94 revision: 2
95 95 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
96 96 }
97 97 Signal {
98 98 name: "axisYRightChanged"
99 99 revision: 2
100 100 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
101 101 }
102 102 Signal {
103 103 name: "axisAngularChanged"
104 104 revision: 3
105 105 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
106 106 }
107 107 Signal {
108 108 name: "axisRadialChanged"
109 109 revision: 3
110 110 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
111 111 }
112 112 Signal { name: "brushChanged"; revision: 4 }
113 113 Signal {
114 114 name: "brushFilenameChanged"
115 115 revision: 4
116 116 Parameter { name: "brushFilename"; type: "string" }
117 117 }
118 118 }
119 119 Component {
120 120 name: "QtCharts::DeclarativeAxes"
121 121 prototype: "QObject"
122 122 exports: [
123 123 "QtCharts/DeclarativeAxes 1.0",
124 124 "QtCharts/DeclarativeAxes 2.0"
125 125 ]
126 126 isCreatable: false
127 127 exportMetaObjectRevisions: [0, 0]
128 128 Property { name: "axisX"; type: "QAbstractAxis"; isPointer: true }
129 129 Property { name: "axisY"; type: "QAbstractAxis"; isPointer: true }
130 130 Property { name: "axisXTop"; type: "QAbstractAxis"; isPointer: true }
131 131 Property { name: "axisYRight"; type: "QAbstractAxis"; isPointer: true }
132 132 Signal {
133 133 name: "axisXChanged"
134 134 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
135 135 }
136 136 Signal {
137 137 name: "axisYChanged"
138 138 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
139 139 }
140 140 Signal {
141 141 name: "axisXTopChanged"
142 142 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
143 143 }
144 144 Signal {
145 145 name: "axisYRightChanged"
146 146 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
147 147 }
148 148 }
149 149 Component {
150 150 name: "QtCharts::DeclarativeBarSeries"
151 151 defaultProperty: "seriesChildren"
152 152 prototype: "QtCharts::QBarSeries"
153 153 exports: [
154 154 "QtCharts/BarSeries 1.0",
155 155 "QtCharts/BarSeries 1.1",
156 156 "QtCharts/BarSeries 1.2",
157 157 "QtCharts/BarSeries 2.0"
158 158 ]
159 159 exportMetaObjectRevisions: [0, 1, 2, 2]
160 160 Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true }
161 161 Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true }
162 162 Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true }
163 163 Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true }
164 164 Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true }
165 165 Signal {
166 166 name: "axisXChanged"
167 167 revision: 1
168 168 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
169 169 }
170 170 Signal {
171 171 name: "axisYChanged"
172 172 revision: 1
173 173 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
174 174 }
175 175 Signal {
176 176 name: "axisXTopChanged"
177 177 revision: 2
178 178 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
179 179 }
180 180 Signal {
181 181 name: "axisYRightChanged"
182 182 revision: 2
183 183 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
184 184 }
185 185 Method {
186 186 name: "appendSeriesChildren"
187 187 Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true }
188 188 Parameter { name: "element"; type: "QObject"; isPointer: true }
189 189 }
190 190 Method {
191 191 name: "at"
192 192 type: "DeclarativeBarSet*"
193 193 Parameter { name: "index"; type: "int" }
194 194 }
195 195 Method {
196 196 name: "append"
197 197 type: "DeclarativeBarSet*"
198 198 Parameter { name: "label"; type: "string" }
199 199 Parameter { name: "values"; type: "QVariantList" }
200 200 }
201 201 Method {
202 202 name: "insert"
203 203 type: "DeclarativeBarSet*"
204 204 Parameter { name: "index"; type: "int" }
205 205 Parameter { name: "label"; type: "string" }
206 206 Parameter { name: "values"; type: "QVariantList" }
207 207 }
208 208 Method {
209 209 name: "remove"
210 210 type: "bool"
211 211 Parameter { name: "barset"; type: "QBarSet"; isPointer: true }
212 212 }
213 213 Method { name: "clear" }
214 214 }
215 215 Component {
216 216 name: "QtCharts::DeclarativeBarSet"
217 217 prototype: "QtCharts::QBarSet"
218 218 exports: [
219 219 "QtCharts/BarSet 1.0",
220 220 "QtCharts/BarSet 1.1",
221 221 "QtCharts/BarSet 1.4",
222 222 "QtCharts/BarSet 2.0"
223 223 ]
224 224 exportMetaObjectRevisions: [0, 0, 2, 2]
225 225 Property { name: "values"; type: "QVariantList" }
226 226 Property { name: "borderWidth"; revision: 1; type: "double" }
227 227 Property { name: "count"; type: "int"; isReadonly: true }
228 228 Property { name: "brushFilename"; revision: 2; type: "string" }
229 229 Signal {
230 230 name: "countChanged"
231 231 Parameter { name: "count"; type: "int" }
232 232 }
233 233 Signal {
234 234 name: "borderWidthChanged"
235 235 revision: 1
236 236 Parameter { name: "width"; type: "double" }
237 237 }
238 238 Signal {
239 239 name: "brushFilenameChanged"
240 240 revision: 2
241 241 Parameter { name: "brushFilename"; type: "string" }
242 242 }
243 243 Method {
244 244 name: "append"
245 245 Parameter { name: "value"; type: "double" }
246 246 }
247 247 Method {
248 248 name: "remove"
249 249 Parameter { name: "index"; type: "int" }
250 250 Parameter { name: "count"; type: "int" }
251 251 }
252 252 Method {
253 253 name: "remove"
254 254 Parameter { name: "index"; type: "int" }
255 255 }
256 256 Method {
257 257 name: "replace"
258 258 Parameter { name: "index"; type: "int" }
259 259 Parameter { name: "value"; type: "double" }
260 260 }
261 261 Method {
262 262 name: "at"
263 263 type: "double"
264 264 Parameter { name: "index"; type: "int" }
265 265 }
266 266 }
267 267 Component {
268 268 name: "QtCharts::DeclarativeBoxPlotSeries"
269 269 defaultProperty: "seriesChildren"
270 270 prototype: "QtCharts::QBoxPlotSeries"
271 271 exports: [
272 272 "QtCharts/BoxPlotSeries 1.3",
273 273 "QtCharts/BoxPlotSeries 1.4",
274 274 "QtCharts/BoxPlotSeries 2.0"
275 275 ]
276 276 exportMetaObjectRevisions: [0, 1, 1]
277 277 Property { name: "axisX"; type: "QAbstractAxis"; isPointer: true }
278 278 Property { name: "axisY"; type: "QAbstractAxis"; isPointer: true }
279 279 Property { name: "axisXTop"; type: "QAbstractAxis"; isPointer: true }
280 280 Property { name: "axisYRight"; type: "QAbstractAxis"; isPointer: true }
281 281 Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true }
282 282 Property { name: "brushFilename"; revision: 1; type: "string" }
283 283 Signal {
284 284 name: "axisXChanged"
285 285 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
286 286 }
287 287 Signal {
288 288 name: "axisYChanged"
289 289 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
290 290 }
291 291 Signal {
292 292 name: "axisXTopChanged"
293 293 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
294 294 }
295 295 Signal {
296 296 name: "axisYRightChanged"
297 297 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
298 298 }
299 299 Signal {
300 300 name: "clicked"
301 301 Parameter { name: "boxset"; type: "DeclarativeBoxSet"; isPointer: true }
302 302 }
303 303 Signal {
304 304 name: "hovered"
305 305 Parameter { name: "status"; type: "bool" }
306 306 Parameter { name: "boxset"; type: "DeclarativeBoxSet"; isPointer: true }
307 307 }
308 308 Signal {
309 309 name: "pressed"
310 310 Parameter { name: "boxset"; type: "DeclarativeBoxSet"; isPointer: true }
311 311 }
312 312 Signal {
313 313 name: "released"
314 314 Parameter { name: "boxset"; type: "DeclarativeBoxSet"; isPointer: true }
315 315 }
316 316 Signal {
317 317 name: "doubleClicked"
318 318 Parameter { name: "boxset"; type: "DeclarativeBoxSet"; isPointer: true }
319 319 }
320 320 Signal {
321 321 name: "brushFilenameChanged"
322 322 revision: 1
323 323 Parameter { name: "brushFilename"; type: "string" }
324 324 }
325 325 Method {
326 326 name: "appendSeriesChildren"
327 327 Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true }
328 328 Parameter { name: "element"; type: "QObject"; isPointer: true }
329 329 }
330 330 Method {
331 331 name: "onHovered"
332 332 Parameter { name: "status"; type: "bool" }
333 333 Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true }
334 334 }
335 335 Method {
336 336 name: "onClicked"
337 337 Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true }
338 338 }
339 339 Method {
340 340 name: "onPressed"
341 341 Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true }
342 342 }
343 343 Method {
344 344 name: "onReleased"
345 345 Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true }
346 346 }
347 347 Method {
348 348 name: "onDoubleClicked"
349 349 Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true }
350 350 }
351 351 Method {
352 352 name: "at"
353 353 type: "DeclarativeBoxSet*"
354 354 Parameter { name: "index"; type: "int" }
355 355 }
356 356 Method {
357 357 name: "append"
358 358 type: "DeclarativeBoxSet*"
359 359 Parameter { name: "label"; type: "string" }
360 360 Parameter { name: "values"; type: "QVariantList" }
361 361 }
362 362 Method {
363 363 name: "append"
364 364 Parameter { name: "box"; type: "DeclarativeBoxSet"; isPointer: true }
365 365 }
366 366 Method {
367 367 name: "insert"
368 368 type: "DeclarativeBoxSet*"
369 369 Parameter { name: "index"; type: "int" }
370 370 Parameter { name: "label"; type: "string" }
371 371 Parameter { name: "values"; type: "QVariantList" }
372 372 }
373 373 Method {
374 374 name: "remove"
375 375 type: "bool"
376 376 Parameter { name: "box"; type: "DeclarativeBoxSet"; isPointer: true }
377 377 }
378 378 Method { name: "clear" }
379 379 }
380 380 Component {
381 381 name: "QtCharts::DeclarativeBoxSet"
382 382 prototype: "QtCharts::QBoxSet"
383 383 exports: [
384 384 "QtCharts/BoxSet 1.3",
385 385 "QtCharts/BoxSet 1.4",
386 386 "QtCharts/BoxSet 2.0"
387 387 ]
388 388 exportMetaObjectRevisions: [0, 1, 1]
389 389 Enum {
390 390 name: "ValuePositions"
391 391 values: {
392 392 "LowerExtreme": 0,
393 393 "LowerQuartile": 1,
394 394 "Median": 2,
395 395 "UpperQuartile": 3,
396 396 "UpperExtreme": 4
397 397 }
398 398 }
399 399 Property { name: "values"; type: "QVariantList" }
400 400 Property { name: "label"; type: "string" }
401 401 Property { name: "count"; type: "int"; isReadonly: true }
402 402 Property { name: "brushFilename"; revision: 1; type: "string" }
403 403 Signal { name: "changedValues" }
404 404 Signal {
405 405 name: "changedValue"
406 406 Parameter { name: "index"; type: "int" }
407 407 }
408 408 Signal {
409 409 name: "brushFilenameChanged"
410 410 revision: 1
411 411 Parameter { name: "brushFilename"; type: "string" }
412 412 }
413 413 Method {
414 414 name: "append"
415 415 Parameter { name: "value"; type: "double" }
416 416 }
417 417 Method { name: "clear" }
418 418 Method {
419 419 name: "at"
420 420 type: "double"
421 421 Parameter { name: "index"; type: "int" }
422 422 }
423 423 Method {
424 424 name: "setValue"
425 425 Parameter { name: "index"; type: "int" }
426 426 Parameter { name: "value"; type: "double" }
427 427 }
428 428 }
429 429 Component {
430 430 name: "QtCharts::DeclarativeCategoryAxis"
431 431 defaultProperty: "axisChildren"
432 432 prototype: "QtCharts::QCategoryAxis"
433 exports: ["QtCharts/CategoryAxis 1.1", "QtCharts/CategoryAxis 2.0"]
434 exportMetaObjectRevisions: [0, 0]
433 exports: [
434 "QtCharts/CategoryAxis 1.1",
435 "QtCharts/CategoryAxis 2.0",
436 "QtCharts/CategoryAxis 2.1"
437 ]
438 exportMetaObjectRevisions: [0, 0, 1]
439 Enum {
440 name: "AxisLabelsPosition"
441 values: {
442 "AxisLabelsPositionCenter": 0,
443 "AxisLabelsPositionOnValue": 1
444 }
445 }
435 446 Property { name: "axisChildren"; type: "QObject"; isList: true; isReadonly: true }
447 Property { name: "labelsPosition"; revision: 1; type: "AxisLabelsPosition" }
448 Signal {
449 name: "labelsPositionChanged"
450 revision: 1
451 Parameter { name: "position"; type: "AxisLabelsPosition" }
452 }
436 453 Method {
437 454 name: "append"
438 455 Parameter { name: "label"; type: "string" }
439 456 Parameter { name: "categoryEndValue"; type: "double" }
440 457 }
441 458 Method {
442 459 name: "remove"
443 460 Parameter { name: "label"; type: "string" }
444 461 }
445 462 Method {
446 463 name: "replace"
447 464 Parameter { name: "oldLabel"; type: "string" }
448 465 Parameter { name: "newLabel"; type: "string" }
449 466 }
450 467 Method {
451 468 name: "appendAxisChildren"
452 469 Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true }
453 470 Parameter { name: "element"; type: "QObject"; isPointer: true }
454 471 }
455 472 }
456 473 Component {
457 474 name: "QtCharts::DeclarativeCategoryRange"
458 475 prototype: "QObject"
459 476 exports: ["QtCharts/CategoryRange 1.1", "QtCharts/CategoryRange 2.0"]
460 477 exportMetaObjectRevisions: [0, 0]
461 478 Property { name: "endValue"; type: "double" }
462 479 Property { name: "label"; type: "string" }
463 480 }
464 481 Component {
465 482 name: "QtCharts::DeclarativeChart"
466 483 defaultProperty: "data"
467 484 prototype: "QQuickPaintedItem"
468 485 exports: [
469 486 "QtCharts/ChartView 1.0",
470 487 "QtCharts/ChartView 1.1",
471 488 "QtCharts/ChartView 1.2",
472 489 "QtCharts/ChartView 1.3",
473 490 "QtCharts/ChartView 2.0"
474 491 ]
475 492 exportMetaObjectRevisions: [0, 1, 2, 3, 4]
476 493 Enum {
477 494 name: "Theme"
478 495 values: {
479 496 "ChartThemeLight": 0,
480 497 "ChartThemeBlueCerulean": 1,
481 498 "ChartThemeDark": 2,
482 499 "ChartThemeBrownSand": 3,
483 500 "ChartThemeBlueNcs": 4,
484 501 "ChartThemeHighContrast": 5,
485 502 "ChartThemeBlueIcy": 6,
486 503 "ChartThemeQt": 7
487 504 }
488 505 }
489 506 Enum {
490 507 name: "Animation"
491 508 values: {
492 509 "NoAnimation": 0,
493 510 "GridAxisAnimations": 1,
494 511 "SeriesAnimations": 2,
495 512 "AllAnimations": 3
496 513 }
497 514 }
498 515 Enum {
499 516 name: "SeriesType"
500 517 values: {
501 518 "SeriesTypeLine": 0,
502 519 "SeriesTypeArea": 1,
503 520 "SeriesTypeBar": 2,
504 521 "SeriesTypeStackedBar": 3,
505 522 "SeriesTypePercentBar": 4,
506 523 "SeriesTypeBoxPlot": 5,
507 524 "SeriesTypePie": 6,
508 525 "SeriesTypeScatter": 7,
509 526 "SeriesTypeSpline": 8,
510 527 "SeriesTypeHorizontalBar": 9,
511 528 "SeriesTypeHorizontalStackedBar": 10,
512 529 "SeriesTypeHorizontalPercentBar": 11
513 530 }
514 531 }
515 532 Property { name: "theme"; type: "Theme" }
516 533 Property { name: "animationOptions"; type: "Animation" }
517 534 Property { name: "title"; type: "string" }
518 535 Property { name: "titleFont"; type: "QFont" }
519 536 Property { name: "titleColor"; type: "QColor" }
520 537 Property { name: "legend"; type: "QLegend"; isReadonly: true; isPointer: true }
521 538 Property { name: "count"; type: "int"; isReadonly: true }
522 539 Property { name: "backgroundColor"; type: "QColor" }
523 540 Property { name: "dropShadowEnabled"; type: "bool" }
524 541 Property { name: "backgroundRoundness"; revision: 3; type: "double" }
525 542 Property {
526 543 name: "margins"
527 544 revision: 2
528 545 type: "DeclarativeMargins"
529 546 isReadonly: true
530 547 isPointer: true
531 548 }
532 549 Property { name: "plotArea"; revision: 1; type: "QRectF"; isReadonly: true }
533 550 Property { name: "plotAreaColor"; revision: 3; type: "QColor" }
534 551 Property { name: "axes"; revision: 2; type: "QAbstractAxis"; isList: true; isReadonly: true }
535 552 Property { name: "localizeNumbers"; revision: 4; type: "bool" }
536 553 Property { name: "locale"; revision: 4; type: "QLocale" }
537 554 Signal { name: "axisLabelsChanged" }
538 555 Signal {
539 556 name: "titleColorChanged"
540 557 Parameter { name: "color"; type: "QColor" }
541 558 }
542 559 Signal {
543 560 name: "dropShadowEnabledChanged"
544 561 Parameter { name: "enabled"; type: "bool" }
545 562 }
546 563 Signal { name: "marginsChanged"; revision: 2 }
547 564 Signal {
548 565 name: "plotAreaChanged"
549 566 Parameter { name: "plotArea"; type: "QRectF" }
550 567 }
551 568 Signal {
552 569 name: "seriesAdded"
553 570 Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true }
554 571 }
555 572 Signal {
556 573 name: "seriesRemoved"
557 574 Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true }
558 575 }
559 576 Signal { name: "plotAreaColorChanged"; revision: 3 }
560 577 Signal {
561 578 name: "backgroundRoundnessChanged"
562 579 revision: 3
563 580 Parameter { name: "diameter"; type: "double" }
564 581 }
565 582 Signal { name: "localizeNumbersChanged"; revision: 4 }
566 583 Signal { name: "localeChanged"; revision: 4 }
567 584 Method {
568 585 name: "series"
569 586 type: "QAbstractSeries*"
570 587 Parameter { name: "index"; type: "int" }
571 588 }
572 589 Method {
573 590 name: "series"
574 591 type: "QAbstractSeries*"
575 592 Parameter { name: "seriesName"; type: "string" }
576 593 }
577 594 Method {
578 595 name: "createSeries"
579 596 type: "QAbstractSeries*"
580 597 Parameter { name: "type"; type: "int" }
581 598 Parameter { name: "name"; type: "string" }
582 599 Parameter { name: "axisX"; type: "QAbstractAxis"; isPointer: true }
583 600 Parameter { name: "axisY"; type: "QAbstractAxis"; isPointer: true }
584 601 }
585 602 Method {
586 603 name: "createSeries"
587 604 type: "QAbstractSeries*"
588 605 Parameter { name: "type"; type: "int" }
589 606 Parameter { name: "name"; type: "string" }
590 607 Parameter { name: "axisX"; type: "QAbstractAxis"; isPointer: true }
591 608 }
592 609 Method {
593 610 name: "createSeries"
594 611 type: "QAbstractSeries*"
595 612 Parameter { name: "type"; type: "int" }
596 613 Parameter { name: "name"; type: "string" }
597 614 }
598 615 Method {
599 616 name: "createSeries"
600 617 type: "QAbstractSeries*"
601 618 Parameter { name: "type"; type: "int" }
602 619 }
603 620 Method {
604 621 name: "removeSeries"
605 622 Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true }
606 623 }
607 624 Method { name: "removeAllSeries" }
608 625 Method {
609 626 name: "setAxisX"
610 627 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
611 628 Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true }
612 629 }
613 630 Method {
614 631 name: "setAxisX"
615 632 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
616 633 }
617 634 Method {
618 635 name: "setAxisY"
619 636 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
620 637 Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true }
621 638 }
622 639 Method {
623 640 name: "setAxisY"
624 641 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
625 642 }
626 643 Method {
627 644 name: "axisX"
628 645 type: "QAbstractAxis*"
629 646 Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true }
630 647 }
631 648 Method { name: "axisX"; type: "QAbstractAxis*" }
632 649 Method {
633 650 name: "axisY"
634 651 type: "QAbstractAxis*"
635 652 Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true }
636 653 }
637 654 Method { name: "axisY"; type: "QAbstractAxis*" }
638 655 Method {
639 656 name: "zoom"
640 657 Parameter { name: "factor"; type: "double" }
641 658 }
642 659 Method {
643 660 name: "scrollLeft"
644 661 Parameter { name: "pixels"; type: "double" }
645 662 }
646 663 Method {
647 664 name: "scrollRight"
648 665 Parameter { name: "pixels"; type: "double" }
649 666 }
650 667 Method {
651 668 name: "scrollUp"
652 669 Parameter { name: "pixels"; type: "double" }
653 670 }
654 671 Method {
655 672 name: "scrollDown"
656 673 Parameter { name: "pixels"; type: "double" }
657 674 }
658 675 }
659 676 Component {
660 677 name: "QtCharts::DeclarativeHorizontalBarSeries"
661 678 defaultProperty: "seriesChildren"
662 679 prototype: "QtCharts::QHorizontalBarSeries"
663 680 exports: [
664 681 "QtCharts/HorizontalBarSeries 1.1",
665 682 "QtCharts/HorizontalBarSeries 1.2",
666 683 "QtCharts/HorizontalBarSeries 2.0"
667 684 ]
668 685 exportMetaObjectRevisions: [1, 2, 2]
669 686 Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true }
670 687 Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true }
671 688 Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true }
672 689 Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true }
673 690 Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true }
674 691 Signal {
675 692 name: "axisXChanged"
676 693 revision: 1
677 694 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
678 695 }
679 696 Signal {
680 697 name: "axisYChanged"
681 698 revision: 1
682 699 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
683 700 }
684 701 Signal {
685 702 name: "axisXTopChanged"
686 703 revision: 2
687 704 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
688 705 }
689 706 Signal {
690 707 name: "axisYRightChanged"
691 708 revision: 2
692 709 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
693 710 }
694 711 Method {
695 712 name: "appendSeriesChildren"
696 713 Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true }
697 714 Parameter { name: "element"; type: "QObject"; isPointer: true }
698 715 }
699 716 Method {
700 717 name: "at"
701 718 type: "DeclarativeBarSet*"
702 719 Parameter { name: "index"; type: "int" }
703 720 }
704 721 Method {
705 722 name: "append"
706 723 type: "DeclarativeBarSet*"
707 724 Parameter { name: "label"; type: "string" }
708 725 Parameter { name: "values"; type: "QVariantList" }
709 726 }
710 727 Method {
711 728 name: "insert"
712 729 type: "DeclarativeBarSet*"
713 730 Parameter { name: "index"; type: "int" }
714 731 Parameter { name: "label"; type: "string" }
715 732 Parameter { name: "values"; type: "QVariantList" }
716 733 }
717 734 Method {
718 735 name: "remove"
719 736 type: "bool"
720 737 Parameter { name: "barset"; type: "QBarSet"; isPointer: true }
721 738 }
722 739 Method { name: "clear" }
723 740 }
724 741 Component {
725 742 name: "QtCharts::DeclarativeHorizontalPercentBarSeries"
726 743 defaultProperty: "seriesChildren"
727 744 prototype: "QtCharts::QHorizontalPercentBarSeries"
728 745 exports: [
729 746 "QtCharts/HorizontalPercentBarSeries 1.1",
730 747 "QtCharts/HorizontalPercentBarSeries 1.2",
731 748 "QtCharts/HorizontalPercentBarSeries 2.0"
732 749 ]
733 750 exportMetaObjectRevisions: [1, 2, 2]
734 751 Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true }
735 752 Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true }
736 753 Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true }
737 754 Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true }
738 755 Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true }
739 756 Signal {
740 757 name: "axisXChanged"
741 758 revision: 1
742 759 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
743 760 }
744 761 Signal {
745 762 name: "axisYChanged"
746 763 revision: 1
747 764 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
748 765 }
749 766 Signal {
750 767 name: "axisXTopChanged"
751 768 revision: 2
752 769 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
753 770 }
754 771 Signal {
755 772 name: "axisYRightChanged"
756 773 revision: 2
757 774 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
758 775 }
759 776 Method {
760 777 name: "appendSeriesChildren"
761 778 Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true }
762 779 Parameter { name: "element"; type: "QObject"; isPointer: true }
763 780 }
764 781 Method {
765 782 name: "at"
766 783 type: "DeclarativeBarSet*"
767 784 Parameter { name: "index"; type: "int" }
768 785 }
769 786 Method {
770 787 name: "append"
771 788 type: "DeclarativeBarSet*"
772 789 Parameter { name: "label"; type: "string" }
773 790 Parameter { name: "values"; type: "QVariantList" }
774 791 }
775 792 Method {
776 793 name: "insert"
777 794 type: "DeclarativeBarSet*"
778 795 Parameter { name: "index"; type: "int" }
779 796 Parameter { name: "label"; type: "string" }
780 797 Parameter { name: "values"; type: "QVariantList" }
781 798 }
782 799 Method {
783 800 name: "remove"
784 801 type: "bool"
785 802 Parameter { name: "barset"; type: "QBarSet"; isPointer: true }
786 803 }
787 804 Method { name: "clear" }
788 805 }
789 806 Component {
790 807 name: "QtCharts::DeclarativeHorizontalStackedBarSeries"
791 808 defaultProperty: "seriesChildren"
792 809 prototype: "QtCharts::QHorizontalStackedBarSeries"
793 810 exports: [
794 811 "QtCharts/HorizontalStackedBarSeries 1.1",
795 812 "QtCharts/HorizontalStackedBarSeries 1.2",
796 813 "QtCharts/HorizontalStackedBarSeries 2.0"
797 814 ]
798 815 exportMetaObjectRevisions: [1, 2, 2]
799 816 Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true }
800 817 Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true }
801 818 Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true }
802 819 Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true }
803 820 Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true }
804 821 Signal {
805 822 name: "axisXChanged"
806 823 revision: 1
807 824 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
808 825 }
809 826 Signal {
810 827 name: "axisYChanged"
811 828 revision: 1
812 829 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
813 830 }
814 831 Signal {
815 832 name: "axisXTopChanged"
816 833 revision: 2
817 834 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
818 835 }
819 836 Signal {
820 837 name: "axisYRightChanged"
821 838 revision: 2
822 839 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
823 840 }
824 841 Method {
825 842 name: "appendSeriesChildren"
826 843 Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true }
827 844 Parameter { name: "element"; type: "QObject"; isPointer: true }
828 845 }
829 846 Method {
830 847 name: "at"
831 848 type: "DeclarativeBarSet*"
832 849 Parameter { name: "index"; type: "int" }
833 850 }
834 851 Method {
835 852 name: "append"
836 853 type: "DeclarativeBarSet*"
837 854 Parameter { name: "label"; type: "string" }
838 855 Parameter { name: "values"; type: "QVariantList" }
839 856 }
840 857 Method {
841 858 name: "insert"
842 859 type: "DeclarativeBarSet*"
843 860 Parameter { name: "index"; type: "int" }
844 861 Parameter { name: "label"; type: "string" }
845 862 Parameter { name: "values"; type: "QVariantList" }
846 863 }
847 864 Method {
848 865 name: "remove"
849 866 type: "bool"
850 867 Parameter { name: "barset"; type: "QBarSet"; isPointer: true }
851 868 }
852 869 Method { name: "clear" }
853 870 }
854 871 Component {
855 872 name: "QtCharts::DeclarativeLineSeries"
856 873 defaultProperty: "declarativeChildren"
857 874 prototype: "QtCharts::QLineSeries"
858 875 exports: [
859 876 "QtCharts/LineSeries 1.0",
860 877 "QtCharts/LineSeries 1.1",
861 878 "QtCharts/LineSeries 1.2",
862 879 "QtCharts/LineSeries 1.3",
863 880 "QtCharts/LineSeries 2.0"
864 881 ]
865 882 exportMetaObjectRevisions: [0, 1, 2, 3, 3]
866 883 Property { name: "count"; type: "int"; isReadonly: true }
867 884 Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true }
868 885 Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true }
869 886 Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true }
870 887 Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true }
871 888 Property { name: "axisAngular"; revision: 3; type: "QAbstractAxis"; isPointer: true }
872 889 Property { name: "axisRadial"; revision: 3; type: "QAbstractAxis"; isPointer: true }
873 890 Property { name: "width"; revision: 1; type: "double" }
874 891 Property { name: "style"; revision: 1; type: "Qt::PenStyle" }
875 892 Property { name: "capStyle"; revision: 1; type: "Qt::PenCapStyle" }
876 893 Property { name: "declarativeChildren"; type: "QObject"; isList: true; isReadonly: true }
877 894 Signal {
878 895 name: "countChanged"
879 896 Parameter { name: "count"; type: "int" }
880 897 }
881 898 Signal {
882 899 name: "axisXChanged"
883 900 revision: 1
884 901 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
885 902 }
886 903 Signal {
887 904 name: "axisYChanged"
888 905 revision: 1
889 906 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
890 907 }
891 908 Signal {
892 909 name: "axisXTopChanged"
893 910 revision: 2
894 911 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
895 912 }
896 913 Signal {
897 914 name: "axisYRightChanged"
898 915 revision: 2
899 916 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
900 917 }
901 918 Signal {
902 919 name: "axisAngularChanged"
903 920 revision: 3
904 921 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
905 922 }
906 923 Signal {
907 924 name: "axisRadialChanged"
908 925 revision: 3
909 926 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
910 927 }
911 928 Signal {
912 929 name: "widthChanged"
913 930 revision: 1
914 931 Parameter { name: "width"; type: "double" }
915 932 }
916 933 Signal {
917 934 name: "styleChanged"
918 935 revision: 1
919 936 Parameter { name: "style"; type: "Qt::PenStyle" }
920 937 }
921 938 Signal {
922 939 name: "capStyleChanged"
923 940 revision: 1
924 941 Parameter { name: "capStyle"; type: "Qt::PenCapStyle" }
925 942 }
926 943 Method {
927 944 name: "appendDeclarativeChildren"
928 945 Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true }
929 946 Parameter { name: "element"; type: "QObject"; isPointer: true }
930 947 }
931 948 Method {
932 949 name: "handleCountChanged"
933 950 Parameter { name: "index"; type: "int" }
934 951 }
935 952 Method {
936 953 name: "append"
937 954 Parameter { name: "x"; type: "double" }
938 955 Parameter { name: "y"; type: "double" }
939 956 }
940 957 Method {
941 958 name: "replace"
942 959 Parameter { name: "oldX"; type: "double" }
943 960 Parameter { name: "oldY"; type: "double" }
944 961 Parameter { name: "newX"; type: "double" }
945 962 Parameter { name: "newY"; type: "double" }
946 963 }
947 964 Method {
948 965 name: "replace"
949 966 revision: 3
950 967 Parameter { name: "index"; type: "int" }
951 968 Parameter { name: "newX"; type: "double" }
952 969 Parameter { name: "newY"; type: "double" }
953 970 }
954 971 Method {
955 972 name: "remove"
956 973 Parameter { name: "x"; type: "double" }
957 974 Parameter { name: "y"; type: "double" }
958 975 }
959 976 Method {
960 977 name: "remove"
961 978 revision: 3
962 979 Parameter { name: "index"; type: "int" }
963 980 }
964 981 Method {
965 982 name: "insert"
966 983 Parameter { name: "index"; type: "int" }
967 984 Parameter { name: "x"; type: "double" }
968 985 Parameter { name: "y"; type: "double" }
969 986 }
970 987 Method { name: "clear" }
971 988 Method {
972 989 name: "at"
973 990 type: "QPointF"
974 991 Parameter { name: "index"; type: "int" }
975 992 }
976 993 }
977 994 Component {
978 995 name: "QtCharts::DeclarativeMargins"
979 996 prototype: "QObject"
980 997 exports: ["QtCharts/Margins 1.1", "QtCharts/Margins 2.0"]
981 998 isCreatable: false
982 999 exportMetaObjectRevisions: [0, 0]
983 1000 Property { name: "top"; type: "int" }
984 1001 Property { name: "bottom"; type: "int" }
985 1002 Property { name: "left"; type: "int" }
986 1003 Property { name: "right"; type: "int" }
987 1004 Signal {
988 1005 name: "topChanged"
989 1006 Parameter { name: "top"; type: "int" }
990 1007 Parameter { name: "bottom"; type: "int" }
991 1008 Parameter { name: "left"; type: "int" }
992 1009 Parameter { name: "right"; type: "int" }
993 1010 }
994 1011 Signal {
995 1012 name: "bottomChanged"
996 1013 Parameter { name: "top"; type: "int" }
997 1014 Parameter { name: "bottom"; type: "int" }
998 1015 Parameter { name: "left"; type: "int" }
999 1016 Parameter { name: "right"; type: "int" }
1000 1017 }
1001 1018 Signal {
1002 1019 name: "leftChanged"
1003 1020 Parameter { name: "top"; type: "int" }
1004 1021 Parameter { name: "bottom"; type: "int" }
1005 1022 Parameter { name: "left"; type: "int" }
1006 1023 Parameter { name: "right"; type: "int" }
1007 1024 }
1008 1025 Signal {
1009 1026 name: "rightChanged"
1010 1027 Parameter { name: "top"; type: "int" }
1011 1028 Parameter { name: "bottom"; type: "int" }
1012 1029 Parameter { name: "left"; type: "int" }
1013 1030 Parameter { name: "right"; type: "int" }
1014 1031 }
1015 1032 }
1016 1033 Component {
1017 1034 name: "QtCharts::DeclarativePercentBarSeries"
1018 1035 defaultProperty: "seriesChildren"
1019 1036 prototype: "QtCharts::QPercentBarSeries"
1020 1037 exports: [
1021 1038 "QtCharts/PercentBarSeries 1.0",
1022 1039 "QtCharts/PercentBarSeries 1.1",
1023 1040 "QtCharts/PercentBarSeries 1.2",
1024 1041 "QtCharts/PercentBarSeries 2.0"
1025 1042 ]
1026 1043 exportMetaObjectRevisions: [0, 1, 2, 2]
1027 1044 Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true }
1028 1045 Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true }
1029 1046 Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true }
1030 1047 Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true }
1031 1048 Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true }
1032 1049 Signal {
1033 1050 name: "axisXChanged"
1034 1051 revision: 1
1035 1052 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1036 1053 }
1037 1054 Signal {
1038 1055 name: "axisYChanged"
1039 1056 revision: 1
1040 1057 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1041 1058 }
1042 1059 Signal {
1043 1060 name: "axisXTopChanged"
1044 1061 revision: 2
1045 1062 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1046 1063 }
1047 1064 Signal {
1048 1065 name: "axisYRightChanged"
1049 1066 revision: 2
1050 1067 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1051 1068 }
1052 1069 Method {
1053 1070 name: "appendSeriesChildren"
1054 1071 Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true }
1055 1072 Parameter { name: "element"; type: "QObject"; isPointer: true }
1056 1073 }
1057 1074 Method {
1058 1075 name: "at"
1059 1076 type: "DeclarativeBarSet*"
1060 1077 Parameter { name: "index"; type: "int" }
1061 1078 }
1062 1079 Method {
1063 1080 name: "append"
1064 1081 type: "DeclarativeBarSet*"
1065 1082 Parameter { name: "label"; type: "string" }
1066 1083 Parameter { name: "values"; type: "QVariantList" }
1067 1084 }
1068 1085 Method {
1069 1086 name: "insert"
1070 1087 type: "DeclarativeBarSet*"
1071 1088 Parameter { name: "index"; type: "int" }
1072 1089 Parameter { name: "label"; type: "string" }
1073 1090 Parameter { name: "values"; type: "QVariantList" }
1074 1091 }
1075 1092 Method {
1076 1093 name: "remove"
1077 1094 type: "bool"
1078 1095 Parameter { name: "barset"; type: "QBarSet"; isPointer: true }
1079 1096 }
1080 1097 Method { name: "clear" }
1081 1098 }
1082 1099 Component {
1083 1100 name: "QtCharts::DeclarativePieSeries"
1084 1101 defaultProperty: "seriesChildren"
1085 1102 prototype: "QtCharts::QPieSeries"
1086 1103 exports: [
1087 1104 "QtCharts/PieSeries 1.0",
1088 1105 "QtCharts/PieSeries 1.1",
1089 1106 "QtCharts/PieSeries 2.0"
1090 1107 ]
1091 1108 exportMetaObjectRevisions: [0, 0, 0]
1092 1109 Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true }
1093 1110 Signal {
1094 1111 name: "sliceAdded"
1095 1112 Parameter { name: "slice"; type: "QPieSlice"; isPointer: true }
1096 1113 }
1097 1114 Signal {
1098 1115 name: "sliceRemoved"
1099 1116 Parameter { name: "slice"; type: "QPieSlice"; isPointer: true }
1100 1117 }
1101 1118 Method {
1102 1119 name: "appendSeriesChildren"
1103 1120 Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true }
1104 1121 Parameter { name: "element"; type: "QObject"; isPointer: true }
1105 1122 }
1106 1123 Method {
1107 1124 name: "handleAdded"
1108 1125 Parameter { name: "slices"; type: "QList<QPieSlice*>" }
1109 1126 }
1110 1127 Method {
1111 1128 name: "handleRemoved"
1112 1129 Parameter { name: "slices"; type: "QList<QPieSlice*>" }
1113 1130 }
1114 1131 Method {
1115 1132 name: "at"
1116 1133 type: "QPieSlice*"
1117 1134 Parameter { name: "index"; type: "int" }
1118 1135 }
1119 1136 Method {
1120 1137 name: "find"
1121 1138 type: "QPieSlice*"
1122 1139 Parameter { name: "label"; type: "string" }
1123 1140 }
1124 1141 Method {
1125 1142 name: "append"
1126 1143 type: "DeclarativePieSlice*"
1127 1144 Parameter { name: "label"; type: "string" }
1128 1145 Parameter { name: "value"; type: "double" }
1129 1146 }
1130 1147 Method {
1131 1148 name: "remove"
1132 1149 type: "bool"
1133 1150 Parameter { name: "slice"; type: "QPieSlice"; isPointer: true }
1134 1151 }
1135 1152 Method { name: "clear" }
1136 1153 }
1137 1154 Component {
1138 1155 name: "QtCharts::DeclarativePieSlice"
1139 1156 prototype: "QtCharts::QPieSlice"
1140 1157 exports: ["QtCharts/PieSlice 1.4", "QtCharts/PieSlice 2.0"]
1141 1158 exportMetaObjectRevisions: [0, 0]
1142 1159 Property { name: "brushFilename"; type: "string" }
1143 1160 Signal {
1144 1161 name: "brushFilenameChanged"
1145 1162 Parameter { name: "brushFilename"; type: "string" }
1146 1163 }
1147 1164 }
1148 1165 Component {
1149 1166 name: "QtCharts::DeclarativePolarChart"
1150 1167 defaultProperty: "data"
1151 1168 prototype: "QtCharts::DeclarativeChart"
1152 1169 exports: [
1153 1170 "QtCharts/PolarChartView 1.3",
1154 1171 "QtCharts/PolarChartView 2.0"
1155 1172 ]
1156 1173 exportMetaObjectRevisions: [1, 1]
1157 1174 }
1158 1175 Component {
1159 1176 name: "QtCharts::DeclarativeScatterSeries"
1160 1177 defaultProperty: "declarativeChildren"
1161 1178 prototype: "QtCharts::QScatterSeries"
1162 1179 exports: [
1163 1180 "QtCharts/ScatterSeries 1.0",
1164 1181 "QtCharts/ScatterSeries 1.1",
1165 1182 "QtCharts/ScatterSeries 1.2",
1166 1183 "QtCharts/ScatterSeries 1.3",
1167 1184 "QtCharts/ScatterSeries 1.4",
1168 1185 "QtCharts/ScatterSeries 2.0"
1169 1186 ]
1170 1187 exportMetaObjectRevisions: [0, 1, 2, 3, 4, 4]
1171 1188 Property { name: "count"; type: "int"; isReadonly: true }
1172 1189 Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true }
1173 1190 Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true }
1174 1191 Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true }
1175 1192 Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true }
1176 1193 Property { name: "axisAngular"; revision: 3; type: "QAbstractAxis"; isPointer: true }
1177 1194 Property { name: "axisRadial"; revision: 3; type: "QAbstractAxis"; isPointer: true }
1178 1195 Property { name: "borderWidth"; revision: 1; type: "double" }
1179 1196 Property { name: "declarativeChildren"; type: "QObject"; isList: true; isReadonly: true }
1180 1197 Property { name: "brushFilename"; revision: 4; type: "string" }
1181 1198 Property { name: "brush"; revision: 4; type: "QBrush" }
1182 1199 Signal {
1183 1200 name: "countChanged"
1184 1201 Parameter { name: "count"; type: "int" }
1185 1202 }
1186 1203 Signal {
1187 1204 name: "axisXChanged"
1188 1205 revision: 1
1189 1206 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1190 1207 }
1191 1208 Signal {
1192 1209 name: "axisYChanged"
1193 1210 revision: 1
1194 1211 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1195 1212 }
1196 1213 Signal {
1197 1214 name: "borderWidthChanged"
1198 1215 revision: 1
1199 1216 Parameter { name: "width"; type: "double" }
1200 1217 }
1201 1218 Signal {
1202 1219 name: "axisXTopChanged"
1203 1220 revision: 2
1204 1221 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1205 1222 }
1206 1223 Signal {
1207 1224 name: "axisYRightChanged"
1208 1225 revision: 2
1209 1226 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1210 1227 }
1211 1228 Signal {
1212 1229 name: "axisAngularChanged"
1213 1230 revision: 3
1214 1231 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1215 1232 }
1216 1233 Signal {
1217 1234 name: "axisRadialChanged"
1218 1235 revision: 3
1219 1236 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1220 1237 }
1221 1238 Signal {
1222 1239 name: "brushFilenameChanged"
1223 1240 revision: 4
1224 1241 Parameter { name: "brushFilename"; type: "string" }
1225 1242 }
1226 1243 Signal { name: "brushChanged"; revision: 4 }
1227 1244 Method {
1228 1245 name: "appendDeclarativeChildren"
1229 1246 Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true }
1230 1247 Parameter { name: "element"; type: "QObject"; isPointer: true }
1231 1248 }
1232 1249 Method {
1233 1250 name: "handleCountChanged"
1234 1251 Parameter { name: "index"; type: "int" }
1235 1252 }
1236 1253 Method {
1237 1254 name: "append"
1238 1255 Parameter { name: "x"; type: "double" }
1239 1256 Parameter { name: "y"; type: "double" }
1240 1257 }
1241 1258 Method {
1242 1259 name: "replace"
1243 1260 Parameter { name: "oldX"; type: "double" }
1244 1261 Parameter { name: "oldY"; type: "double" }
1245 1262 Parameter { name: "newX"; type: "double" }
1246 1263 Parameter { name: "newY"; type: "double" }
1247 1264 }
1248 1265 Method {
1249 1266 name: "replace"
1250 1267 revision: 3
1251 1268 Parameter { name: "index"; type: "int" }
1252 1269 Parameter { name: "newX"; type: "double" }
1253 1270 Parameter { name: "newY"; type: "double" }
1254 1271 }
1255 1272 Method {
1256 1273 name: "remove"
1257 1274 Parameter { name: "x"; type: "double" }
1258 1275 Parameter { name: "y"; type: "double" }
1259 1276 }
1260 1277 Method {
1261 1278 name: "remove"
1262 1279 revision: 3
1263 1280 Parameter { name: "index"; type: "int" }
1264 1281 }
1265 1282 Method {
1266 1283 name: "insert"
1267 1284 Parameter { name: "index"; type: "int" }
1268 1285 Parameter { name: "x"; type: "double" }
1269 1286 Parameter { name: "y"; type: "double" }
1270 1287 }
1271 1288 Method { name: "clear" }
1272 1289 Method {
1273 1290 name: "at"
1274 1291 type: "QPointF"
1275 1292 Parameter { name: "index"; type: "int" }
1276 1293 }
1277 1294 }
1278 1295 Component {
1279 1296 name: "QtCharts::DeclarativeSplineSeries"
1280 1297 defaultProperty: "declarativeChildren"
1281 1298 prototype: "QtCharts::QSplineSeries"
1282 1299 exports: [
1283 1300 "QtCharts/SplineSeries 1.0",
1284 1301 "QtCharts/SplineSeries 1.1",
1285 1302 "QtCharts/SplineSeries 1.2",
1286 1303 "QtCharts/SplineSeries 1.3",
1287 1304 "QtCharts/SplineSeries 2.0"
1288 1305 ]
1289 1306 exportMetaObjectRevisions: [0, 1, 2, 3, 3]
1290 1307 Property { name: "count"; type: "int"; isReadonly: true }
1291 1308 Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true }
1292 1309 Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true }
1293 1310 Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true }
1294 1311 Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true }
1295 1312 Property { name: "axisAngular"; revision: 3; type: "QAbstractAxis"; isPointer: true }
1296 1313 Property { name: "axisRadial"; revision: 3; type: "QAbstractAxis"; isPointer: true }
1297 1314 Property { name: "width"; revision: 1; type: "double" }
1298 1315 Property { name: "style"; revision: 1; type: "Qt::PenStyle" }
1299 1316 Property { name: "capStyle"; revision: 1; type: "Qt::PenCapStyle" }
1300 1317 Property { name: "declarativeChildren"; type: "QObject"; isList: true; isReadonly: true }
1301 1318 Signal {
1302 1319 name: "countChanged"
1303 1320 Parameter { name: "count"; type: "int" }
1304 1321 }
1305 1322 Signal {
1306 1323 name: "axisXChanged"
1307 1324 revision: 1
1308 1325 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1309 1326 }
1310 1327 Signal {
1311 1328 name: "axisYChanged"
1312 1329 revision: 1
1313 1330 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1314 1331 }
1315 1332 Signal {
1316 1333 name: "axisXTopChanged"
1317 1334 revision: 2
1318 1335 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1319 1336 }
1320 1337 Signal {
1321 1338 name: "axisYRightChanged"
1322 1339 revision: 2
1323 1340 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1324 1341 }
1325 1342 Signal {
1326 1343 name: "axisAngularChanged"
1327 1344 revision: 3
1328 1345 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1329 1346 }
1330 1347 Signal {
1331 1348 name: "axisRadialChanged"
1332 1349 revision: 3
1333 1350 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1334 1351 }
1335 1352 Signal {
1336 1353 name: "widthChanged"
1337 1354 revision: 1
1338 1355 Parameter { name: "width"; type: "double" }
1339 1356 }
1340 1357 Signal {
1341 1358 name: "styleChanged"
1342 1359 revision: 1
1343 1360 Parameter { name: "style"; type: "Qt::PenStyle" }
1344 1361 }
1345 1362 Signal {
1346 1363 name: "capStyleChanged"
1347 1364 revision: 1
1348 1365 Parameter { name: "capStyle"; type: "Qt::PenCapStyle" }
1349 1366 }
1350 1367 Method {
1351 1368 name: "appendDeclarativeChildren"
1352 1369 Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true }
1353 1370 Parameter { name: "element"; type: "QObject"; isPointer: true }
1354 1371 }
1355 1372 Method {
1356 1373 name: "handleCountChanged"
1357 1374 Parameter { name: "index"; type: "int" }
1358 1375 }
1359 1376 Method {
1360 1377 name: "append"
1361 1378 Parameter { name: "x"; type: "double" }
1362 1379 Parameter { name: "y"; type: "double" }
1363 1380 }
1364 1381 Method {
1365 1382 name: "replace"
1366 1383 Parameter { name: "oldX"; type: "double" }
1367 1384 Parameter { name: "oldY"; type: "double" }
1368 1385 Parameter { name: "newX"; type: "double" }
1369 1386 Parameter { name: "newY"; type: "double" }
1370 1387 }
1371 1388 Method {
1372 1389 name: "replace"
1373 1390 revision: 3
1374 1391 Parameter { name: "index"; type: "int" }
1375 1392 Parameter { name: "newX"; type: "double" }
1376 1393 Parameter { name: "newY"; type: "double" }
1377 1394 }
1378 1395 Method {
1379 1396 name: "remove"
1380 1397 Parameter { name: "x"; type: "double" }
1381 1398 Parameter { name: "y"; type: "double" }
1382 1399 }
1383 1400 Method {
1384 1401 name: "remove"
1385 1402 revision: 3
1386 1403 Parameter { name: "index"; type: "int" }
1387 1404 }
1388 1405 Method {
1389 1406 name: "insert"
1390 1407 Parameter { name: "index"; type: "int" }
1391 1408 Parameter { name: "x"; type: "double" }
1392 1409 Parameter { name: "y"; type: "double" }
1393 1410 }
1394 1411 Method { name: "clear" }
1395 1412 Method {
1396 1413 name: "at"
1397 1414 type: "QPointF"
1398 1415 Parameter { name: "index"; type: "int" }
1399 1416 }
1400 1417 }
1401 1418 Component {
1402 1419 name: "QtCharts::DeclarativeStackedBarSeries"
1403 1420 defaultProperty: "seriesChildren"
1404 1421 prototype: "QtCharts::QStackedBarSeries"
1405 1422 exports: [
1406 1423 "QtCharts/StackedBarSeries 1.0",
1407 1424 "QtCharts/StackedBarSeries 1.1",
1408 1425 "QtCharts/StackedBarSeries 1.2",
1409 1426 "QtCharts/StackedBarSeries 2.0"
1410 1427 ]
1411 1428 exportMetaObjectRevisions: [0, 1, 2, 2]
1412 1429 Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true }
1413 1430 Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true }
1414 1431 Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true }
1415 1432 Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true }
1416 1433 Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true }
1417 1434 Signal {
1418 1435 name: "axisXChanged"
1419 1436 revision: 1
1420 1437 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1421 1438 }
1422 1439 Signal {
1423 1440 name: "axisYChanged"
1424 1441 revision: 1
1425 1442 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1426 1443 }
1427 1444 Signal {
1428 1445 name: "axisXTopChanged"
1429 1446 revision: 2
1430 1447 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1431 1448 }
1432 1449 Signal {
1433 1450 name: "axisYRightChanged"
1434 1451 revision: 2
1435 1452 Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true }
1436 1453 }
1437 1454 Method {
1438 1455 name: "appendSeriesChildren"
1439 1456 Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true }
1440 1457 Parameter { name: "element"; type: "QObject"; isPointer: true }
1441 1458 }
1442 1459 Method {
1443 1460 name: "at"
1444 1461 type: "DeclarativeBarSet*"
1445 1462 Parameter { name: "index"; type: "int" }
1446 1463 }
1447 1464 Method {
1448 1465 name: "append"
1449 1466 type: "DeclarativeBarSet*"
1450 1467 Parameter { name: "label"; type: "string" }
1451 1468 Parameter { name: "values"; type: "QVariantList" }
1452 1469 }
1453 1470 Method {
1454 1471 name: "insert"
1455 1472 type: "DeclarativeBarSet*"
1456 1473 Parameter { name: "index"; type: "int" }
1457 1474 Parameter { name: "label"; type: "string" }
1458 1475 Parameter { name: "values"; type: "QVariantList" }
1459 1476 }
1460 1477 Method {
1461 1478 name: "remove"
1462 1479 type: "bool"
1463 1480 Parameter { name: "barset"; type: "QBarSet"; isPointer: true }
1464 1481 }
1465 1482 Method { name: "clear" }
1466 1483 }
1467 1484 Component {
1468 1485 name: "QtCharts::DeclarativeXYPoint"
1469 1486 prototype: "QObject"
1470 1487 exports: ["QtCharts/XYPoint 1.0", "QtCharts/XYPoint 2.0"]
1471 1488 exportMetaObjectRevisions: [0, 0]
1472 1489 Property { name: "x"; type: "double" }
1473 1490 Property { name: "y"; type: "double" }
1474 1491 }
1475 1492 Component {
1476 1493 name: "QtCharts::LegendScroller"
1477 1494 defaultProperty: "children"
1478 1495 prototype: "QtCharts::QLegend"
1479 1496 }
1480 1497 Component {
1481 1498 name: "QtCharts::QAbstractAxis"
1482 1499 prototype: "QObject"
1483 1500 exports: ["QtCharts/AbstractAxis 1.0", "QtCharts/AbstractAxis 2.0"]
1484 1501 isCreatable: false
1485 1502 exportMetaObjectRevisions: [0, 0]
1486 1503 Property { name: "visible"; type: "bool" }
1487 1504 Property { name: "lineVisible"; type: "bool" }
1488 1505 Property { name: "linePen"; type: "QPen" }
1489 1506 Property { name: "color"; type: "QColor" }
1490 1507 Property { name: "labelsVisible"; type: "bool" }
1491 1508 Property { name: "labelsBrush"; type: "QBrush" }
1492 1509 Property { name: "labelsAngle"; type: "int" }
1493 1510 Property { name: "labelsFont"; type: "QFont" }
1494 1511 Property { name: "labelsColor"; type: "QColor" }
1495 1512 Property { name: "gridVisible"; type: "bool" }
1496 1513 Property { name: "gridLinePen"; type: "QPen" }
1497 1514 Property { name: "shadesVisible"; type: "bool" }
1498 1515 Property { name: "shadesColor"; type: "QColor" }
1499 1516 Property { name: "shadesBorderColor"; type: "QColor" }
1500 1517 Property { name: "shadesPen"; type: "QPen" }
1501 1518 Property { name: "shadesBrush"; type: "QBrush" }
1502 1519 Property { name: "titleText"; type: "string" }
1503 1520 Property { name: "titleBrush"; type: "QBrush" }
1504 1521 Property { name: "titleVisible"; type: "bool" }
1505 1522 Property { name: "titleFont"; type: "QFont" }
1506 1523 Property { name: "orientation"; type: "Qt::Orientation"; isReadonly: true }
1507 1524 Property { name: "alignment"; type: "Qt::Alignment"; isReadonly: true }
1508 1525 Signal {
1509 1526 name: "visibleChanged"
1510 1527 Parameter { name: "visible"; type: "bool" }
1511 1528 }
1512 1529 Signal {
1513 1530 name: "linePenChanged"
1514 1531 Parameter { name: "pen"; type: "QPen" }
1515 1532 }
1516 1533 Signal {
1517 1534 name: "lineVisibleChanged"
1518 1535 Parameter { name: "visible"; type: "bool" }
1519 1536 }
1520 1537 Signal {
1521 1538 name: "labelsVisibleChanged"
1522 1539 Parameter { name: "visible"; type: "bool" }
1523 1540 }
1524 1541 Signal {
1525 1542 name: "labelsBrushChanged"
1526 1543 Parameter { name: "brush"; type: "QBrush" }
1527 1544 }
1528 1545 Signal {
1529 1546 name: "labelsFontChanged"
1530 1547 Parameter { name: "pen"; type: "QFont" }
1531 1548 }
1532 1549 Signal {
1533 1550 name: "labelsAngleChanged"
1534 1551 Parameter { name: "angle"; type: "int" }
1535 1552 }
1536 1553 Signal {
1537 1554 name: "gridLinePenChanged"
1538 1555 Parameter { name: "pen"; type: "QPen" }
1539 1556 }
1540 1557 Signal {
1541 1558 name: "gridVisibleChanged"
1542 1559 Parameter { name: "visible"; type: "bool" }
1543 1560 }
1544 1561 Signal {
1545 1562 name: "colorChanged"
1546 1563 Parameter { name: "color"; type: "QColor" }
1547 1564 }
1548 1565 Signal {
1549 1566 name: "labelsColorChanged"
1550 1567 Parameter { name: "color"; type: "QColor" }
1551 1568 }
1552 1569 Signal {
1553 1570 name: "titleTextChanged"
1554 1571 Parameter { name: "title"; type: "string" }
1555 1572 }
1556 1573 Signal {
1557 1574 name: "titleBrushChanged"
1558 1575 Parameter { name: "brush"; type: "QBrush" }
1559 1576 }
1560 1577 Signal {
1561 1578 name: "titleVisibleChanged"
1562 1579 Parameter { name: "visible"; type: "bool" }
1563 1580 }
1564 1581 Signal {
1565 1582 name: "titleFontChanged"
1566 1583 Parameter { name: "font"; type: "QFont" }
1567 1584 }
1568 1585 Signal {
1569 1586 name: "shadesVisibleChanged"
1570 1587 Parameter { name: "visible"; type: "bool" }
1571 1588 }
1572 1589 Signal {
1573 1590 name: "shadesColorChanged"
1574 1591 Parameter { name: "color"; type: "QColor" }
1575 1592 }
1576 1593 Signal {
1577 1594 name: "shadesBorderColorChanged"
1578 1595 Parameter { name: "color"; type: "QColor" }
1579 1596 }
1580 1597 Signal {
1581 1598 name: "shadesPenChanged"
1582 1599 Parameter { name: "pen"; type: "QPen" }
1583 1600 }
1584 1601 Signal {
1585 1602 name: "shadesBrushChanged"
1586 1603 Parameter { name: "brush"; type: "QBrush" }
1587 1604 }
1588 1605 }
1589 1606 Component {
1590 1607 name: "QtCharts::QAbstractBarSeries"
1591 1608 prototype: "QtCharts::QAbstractSeries"
1592 1609 exports: [
1593 1610 "QtCharts/AbstractBarSeries 1.0",
1594 1611 "QtCharts/AbstractBarSeries 2.0"
1595 1612 ]
1596 1613 isCreatable: false
1597 1614 exportMetaObjectRevisions: [0, 0]
1598 1615 Enum {
1599 1616 name: "LabelsPosition"
1600 1617 values: {
1601 1618 "LabelsCenter": 0,
1602 1619 "LabelsInsideEnd": 1,
1603 1620 "LabelsInsideBase": 2,
1604 1621 "LabelsOutsideEnd": 3
1605 1622 }
1606 1623 }
1607 1624 Property { name: "barWidth"; type: "double" }
1608 1625 Property { name: "count"; type: "int"; isReadonly: true }
1609 1626 Property { name: "labelsVisible"; type: "bool" }
1610 1627 Property { name: "labelsFormat"; type: "string" }
1611 1628 Property { name: "labelsPosition"; type: "LabelsPosition" }
1612 1629 Signal {
1613 1630 name: "clicked"
1614 1631 Parameter { name: "index"; type: "int" }
1615 1632 Parameter { name: "barset"; type: "QBarSet"; isPointer: true }
1616 1633 }
1617 1634 Signal {
1618 1635 name: "hovered"
1619 1636 Parameter { name: "status"; type: "bool" }
1620 1637 Parameter { name: "index"; type: "int" }
1621 1638 Parameter { name: "barset"; type: "QBarSet"; isPointer: true }
1622 1639 }
1623 1640 Signal {
1624 1641 name: "pressed"
1625 1642 Parameter { name: "index"; type: "int" }
1626 1643 Parameter { name: "barset"; type: "QBarSet"; isPointer: true }
1627 1644 }
1628 1645 Signal {
1629 1646 name: "released"
1630 1647 Parameter { name: "index"; type: "int" }
1631 1648 Parameter { name: "barset"; type: "QBarSet"; isPointer: true }
1632 1649 }
1633 1650 Signal {
1634 1651 name: "doubleClicked"
1635 1652 Parameter { name: "index"; type: "int" }
1636 1653 Parameter { name: "barset"; type: "QBarSet"; isPointer: true }
1637 1654 }
1638 1655 Signal {
1639 1656 name: "labelsFormatChanged"
1640 1657 Parameter { name: "format"; type: "string" }
1641 1658 }
1642 1659 Signal {
1643 1660 name: "labelsPositionChanged"
1644 1661 Parameter { name: "position"; type: "QAbstractBarSeries::LabelsPosition" }
1645 1662 }
1646 1663 Signal {
1647 1664 name: "barsetsAdded"
1648 1665 Parameter { name: "sets"; type: "QList<QBarSet*>" }
1649 1666 }
1650 1667 Signal {
1651 1668 name: "barsetsRemoved"
1652 1669 Parameter { name: "sets"; type: "QList<QBarSet*>" }
1653 1670 }
1654 1671 }
1655 1672 Component {
1656 1673 name: "QtCharts::QAbstractSeries"
1657 1674 prototype: "QObject"
1658 1675 exports: [
1659 1676 "QtCharts/AbstractSeries 1.0",
1660 1677 "QtCharts/AbstractSeries 2.0"
1661 1678 ]
1662 1679 isCreatable: false
1663 1680 exportMetaObjectRevisions: [0, 0]
1664 1681 Enum {
1665 1682 name: "SeriesType"
1666 1683 values: {
1667 1684 "SeriesTypeLine": 0,
1668 1685 "SeriesTypeArea": 1,
1669 1686 "SeriesTypeBar": 2,
1670 1687 "SeriesTypeStackedBar": 3,
1671 1688 "SeriesTypePercentBar": 4,
1672 1689 "SeriesTypePie": 5,
1673 1690 "SeriesTypeScatter": 6,
1674 1691 "SeriesTypeSpline": 7,
1675 1692 "SeriesTypeHorizontalBar": 8,
1676 1693 "SeriesTypeHorizontalStackedBar": 9,
1677 1694 "SeriesTypeHorizontalPercentBar": 10,
1678 1695 "SeriesTypeBoxPlot": 11
1679 1696 }
1680 1697 }
1681 1698 Property { name: "name"; type: "string" }
1682 1699 Property { name: "visible"; type: "bool" }
1683 1700 Property { name: "opacity"; type: "double" }
1684 1701 Property { name: "type"; type: "SeriesType"; isReadonly: true }
1685 1702 }
1686 1703 Component {
1687 1704 name: "QtCharts::QAreaSeries"
1688 1705 prototype: "QtCharts::QAbstractSeries"
1689 1706 Property { name: "upperSeries"; type: "QLineSeries"; isReadonly: true; isPointer: true }
1690 1707 Property { name: "lowerSeries"; type: "QLineSeries"; isReadonly: true; isPointer: true }
1691 1708 Property { name: "color"; type: "QColor" }
1692 1709 Property { name: "borderColor"; type: "QColor" }
1693 1710 Property { name: "pointLabelsFormat"; type: "string" }
1694 1711 Property { name: "pointLabelsVisible"; type: "bool" }
1695 1712 Property { name: "pointLabelsFont"; type: "QFont" }
1696 1713 Property { name: "pointLabelsColor"; type: "QColor" }
1697 1714 Signal {
1698 1715 name: "clicked"
1699 1716 Parameter { name: "point"; type: "QPointF" }
1700 1717 }
1701 1718 Signal {
1702 1719 name: "hovered"
1703 1720 Parameter { name: "point"; type: "QPointF" }
1704 1721 Parameter { name: "state"; type: "bool" }
1705 1722 }
1706 1723 Signal {
1707 1724 name: "pressed"
1708 1725 Parameter { name: "point"; type: "QPointF" }
1709 1726 }
1710 1727 Signal {
1711 1728 name: "released"
1712 1729 Parameter { name: "point"; type: "QPointF" }
1713 1730 }
1714 1731 Signal {
1715 1732 name: "doubleClicked"
1716 1733 Parameter { name: "point"; type: "QPointF" }
1717 1734 }
1718 1735 Signal { name: "selected" }
1719 1736 Signal {
1720 1737 name: "colorChanged"
1721 1738 Parameter { name: "color"; type: "QColor" }
1722 1739 }
1723 1740 Signal {
1724 1741 name: "borderColorChanged"
1725 1742 Parameter { name: "color"; type: "QColor" }
1726 1743 }
1727 1744 Signal {
1728 1745 name: "pointLabelsFormatChanged"
1729 1746 Parameter { name: "format"; type: "string" }
1730 1747 }
1731 1748 Signal {
1732 1749 name: "pointLabelsVisibilityChanged"
1733 1750 Parameter { name: "visible"; type: "bool" }
1734 1751 }
1735 1752 Signal {
1736 1753 name: "pointLabelsFontChanged"
1737 1754 Parameter { name: "font"; type: "QFont" }
1738 1755 }
1739 1756 Signal {
1740 1757 name: "pointLabelsColorChanged"
1741 1758 Parameter { name: "color"; type: "QColor" }
1742 1759 }
1743 1760 }
1744 1761 Component {
1745 1762 name: "QtCharts::QBarCategoryAxis"
1746 1763 prototype: "QtCharts::QAbstractAxis"
1747 1764 exports: [
1748 1765 "QtCharts/BarCategoriesAxis 1.0",
1749 1766 "QtCharts/BarCategoryAxis 1.1",
1750 1767 "QtCharts/BarCategoryAxis 2.0"
1751 1768 ]
1752 1769 exportMetaObjectRevisions: [0, 0, 0]
1753 1770 Property { name: "categories"; type: "QStringList" }
1754 1771 Property { name: "min"; type: "string" }
1755 1772 Property { name: "max"; type: "string" }
1756 1773 Property { name: "count"; type: "int"; isReadonly: true }
1757 1774 Signal {
1758 1775 name: "minChanged"
1759 1776 Parameter { name: "min"; type: "string" }
1760 1777 }
1761 1778 Signal {
1762 1779 name: "maxChanged"
1763 1780 Parameter { name: "max"; type: "string" }
1764 1781 }
1765 1782 Signal {
1766 1783 name: "rangeChanged"
1767 1784 Parameter { name: "min"; type: "string" }
1768 1785 Parameter { name: "max"; type: "string" }
1769 1786 }
1770 1787 Method { name: "clear" }
1771 1788 }
1772 1789 Component {
1773 1790 name: "QtCharts::QBarModelMapper"
1774 1791 prototype: "QObject"
1775 1792 exports: [
1776 1793 "QtCharts/BarModelMapper 1.0",
1777 1794 "QtCharts/BarModelMapper 2.0"
1778 1795 ]
1779 1796 isCreatable: false
1780 1797 exportMetaObjectRevisions: [0, 0]
1781 1798 }
1782 1799 Component { name: "QtCharts::QBarSeries"; prototype: "QtCharts::QAbstractBarSeries" }
1783 1800 Component {
1784 1801 name: "QtCharts::QBarSet"
1785 1802 prototype: "QObject"
1786 1803 exports: ["QtCharts/BarSetBase 1.0", "QtCharts/BarSetBase 2.0"]
1787 1804 isCreatable: false
1788 1805 exportMetaObjectRevisions: [0, 0]
1789 1806 Property { name: "label"; type: "string" }
1790 1807 Property { name: "pen"; type: "QPen" }
1791 1808 Property { name: "brush"; type: "QBrush" }
1792 1809 Property { name: "labelBrush"; type: "QBrush" }
1793 1810 Property { name: "labelFont"; type: "QFont" }
1794 1811 Property { name: "color"; type: "QColor" }
1795 1812 Property { name: "borderColor"; type: "QColor" }
1796 1813 Property { name: "labelColor"; type: "QColor" }
1797 1814 Signal {
1798 1815 name: "clicked"
1799 1816 Parameter { name: "index"; type: "int" }
1800 1817 }
1801 1818 Signal {
1802 1819 name: "hovered"
1803 1820 Parameter { name: "status"; type: "bool" }
1804 1821 Parameter { name: "index"; type: "int" }
1805 1822 }
1806 1823 Signal {
1807 1824 name: "pressed"
1808 1825 Parameter { name: "index"; type: "int" }
1809 1826 }
1810 1827 Signal {
1811 1828 name: "released"
1812 1829 Parameter { name: "index"; type: "int" }
1813 1830 }
1814 1831 Signal {
1815 1832 name: "doubleClicked"
1816 1833 Parameter { name: "index"; type: "int" }
1817 1834 }
1818 1835 Signal {
1819 1836 name: "colorChanged"
1820 1837 Parameter { name: "color"; type: "QColor" }
1821 1838 }
1822 1839 Signal {
1823 1840 name: "borderColorChanged"
1824 1841 Parameter { name: "color"; type: "QColor" }
1825 1842 }
1826 1843 Signal {
1827 1844 name: "labelColorChanged"
1828 1845 Parameter { name: "color"; type: "QColor" }
1829 1846 }
1830 1847 Signal {
1831 1848 name: "valuesAdded"
1832 1849 Parameter { name: "index"; type: "int" }
1833 1850 Parameter { name: "count"; type: "int" }
1834 1851 }
1835 1852 Signal {
1836 1853 name: "valuesRemoved"
1837 1854 Parameter { name: "index"; type: "int" }
1838 1855 Parameter { name: "count"; type: "int" }
1839 1856 }
1840 1857 Signal {
1841 1858 name: "valueChanged"
1842 1859 Parameter { name: "index"; type: "int" }
1843 1860 }
1844 1861 }
1845 1862 Component {
1846 1863 name: "QtCharts::QBoxPlotModelMapper"
1847 1864 prototype: "QObject"
1848 1865 exports: ["QtCharts/BoxPlotModelMapper 2.0"]
1849 1866 isCreatable: false
1850 1867 exportMetaObjectRevisions: [0]
1851 1868 }
1852 1869 Component {
1853 1870 name: "QtCharts::QBoxPlotSeries"
1854 1871 prototype: "QtCharts::QAbstractSeries"
1855 1872 Property { name: "boxOutlineVisible"; type: "bool" }
1856 1873 Property { name: "boxWidth"; type: "double" }
1857 1874 Property { name: "pen"; type: "QPen" }
1858 1875 Property { name: "brush"; type: "QBrush" }
1859 1876 Property { name: "count"; revision: 1; type: "int"; isReadonly: true }
1860 1877 Signal {
1861 1878 name: "clicked"
1862 1879 Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true }
1863 1880 }
1864 1881 Signal {
1865 1882 name: "hovered"
1866 1883 Parameter { name: "status"; type: "bool" }
1867 1884 Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true }
1868 1885 }
1869 1886 Signal {
1870 1887 name: "pressed"
1871 1888 Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true }
1872 1889 }
1873 1890 Signal {
1874 1891 name: "released"
1875 1892 Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true }
1876 1893 }
1877 1894 Signal {
1878 1895 name: "doubleClicked"
1879 1896 Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true }
1880 1897 }
1881 1898 Signal { name: "boxOutlineVisibilityChanged" }
1882 1899 Signal {
1883 1900 name: "boxsetsAdded"
1884 1901 Parameter { name: "sets"; type: "QList<QBoxSet*>" }
1885 1902 }
1886 1903 Signal {
1887 1904 name: "boxsetsRemoved"
1888 1905 Parameter { name: "sets"; type: "QList<QBoxSet*>" }
1889 1906 }
1890 1907 }
1891 1908 Component {
1892 1909 name: "QtCharts::QBoxSet"
1893 1910 prototype: "QObject"
1894 1911 Property { name: "pen"; type: "QPen" }
1895 1912 Property { name: "brush"; type: "QBrush" }
1896 1913 Signal { name: "clicked" }
1897 1914 Signal {
1898 1915 name: "hovered"
1899 1916 Parameter { name: "status"; type: "bool" }
1900 1917 }
1901 1918 Signal { name: "pressed" }
1902 1919 Signal { name: "released" }
1903 1920 Signal { name: "doubleClicked" }
1904 1921 Signal { name: "valuesChanged" }
1905 1922 Signal {
1906 1923 name: "valueChanged"
1907 1924 Parameter { name: "index"; type: "int" }
1908 1925 }
1909 1926 Signal { name: "cleared" }
1910 1927 }
1911 1928 Component {
1912 1929 name: "QtCharts::QCategoryAxis"
1913 1930 prototype: "QtCharts::QValueAxis"
1931 Enum {
1932 name: "AxisLabelsPosition"
1933 values: {
1934 "AxisLabelsPositionCenter": 0,
1935 "AxisLabelsPositionOnValue": 1
1936 }
1937 }
1914 1938 Property { name: "startValue"; type: "double" }
1915 1939 Property { name: "count"; type: "int"; isReadonly: true }
1916 1940 Property { name: "categoriesLabels"; type: "QStringList"; isReadonly: true }
1941 Property { name: "labelsPosition"; type: "AxisLabelsPosition" }
1917 1942 Signal { name: "categoriesChanged" }
1943 Signal {
1944 name: "labelsPositionChanged"
1945 Parameter { name: "position"; type: "QCategoryAxis::AxisLabelsPosition" }
1946 }
1918 1947 }
1919 1948 Component {
1920 1949 name: "QtCharts::QDateTimeAxis"
1921 1950 prototype: "QtCharts::QAbstractAxis"
1922 1951 exports: ["QtCharts/DateTimeAxis 1.1", "QtCharts/DateTimeAxis 2.0"]
1923 1952 exportMetaObjectRevisions: [0, 0]
1924 1953 Property { name: "tickCount"; type: "int" }
1925 1954 Property { name: "min"; type: "QDateTime" }
1926 1955 Property { name: "max"; type: "QDateTime" }
1927 1956 Property { name: "format"; type: "string" }
1928 1957 Signal {
1929 1958 name: "minChanged"
1930 1959 Parameter { name: "min"; type: "QDateTime" }
1931 1960 }
1932 1961 Signal {
1933 1962 name: "maxChanged"
1934 1963 Parameter { name: "max"; type: "QDateTime" }
1935 1964 }
1936 1965 Signal {
1937 1966 name: "rangeChanged"
1938 1967 Parameter { name: "min"; type: "QDateTime" }
1939 1968 Parameter { name: "max"; type: "QDateTime" }
1940 1969 }
1941 1970 Signal {
1942 1971 name: "formatChanged"
1943 1972 Parameter { name: "format"; type: "string" }
1944 1973 }
1945 1974 Signal {
1946 1975 name: "tickCountChanged"
1947 1976 Parameter { name: "tick"; type: "int" }
1948 1977 }
1949 1978 }
1950 1979 Component {
1951 1980 name: "QtCharts::QHBarModelMapper"
1952 1981 prototype: "QtCharts::QBarModelMapper"
1953 1982 exports: [
1954 1983 "QtCharts/HBarModelMapper 1.0",
1955 1984 "QtCharts/HBarModelMapper 2.0"
1956 1985 ]
1957 1986 exportMetaObjectRevisions: [0, 0]
1958 1987 Property { name: "series"; type: "QAbstractBarSeries"; isPointer: true }
1959 1988 Property { name: "model"; type: "QAbstractItemModel"; isPointer: true }
1960 1989 Property { name: "firstBarSetRow"; type: "int" }
1961 1990 Property { name: "lastBarSetRow"; type: "int" }
1962 1991 Property { name: "firstColumn"; type: "int" }
1963 1992 Property { name: "columnCount"; type: "int" }
1964 1993 Signal { name: "seriesReplaced" }
1965 1994 Signal { name: "modelReplaced" }
1966 1995 }
1967 1996 Component {
1968 1997 name: "QtCharts::QHPieModelMapper"
1969 1998 prototype: "QtCharts::QPieModelMapper"
1970 1999 exports: [
1971 2000 "QtCharts/HPieModelMapper 1.0",
1972 2001 "QtCharts/HPieModelMapper 2.0"
1973 2002 ]
1974 2003 exportMetaObjectRevisions: [0, 0]
1975 2004 Property { name: "series"; type: "QPieSeries"; isPointer: true }
1976 2005 Property { name: "model"; type: "QAbstractItemModel"; isPointer: true }
1977 2006 Property { name: "valuesRow"; type: "int" }
1978 2007 Property { name: "labelsRow"; type: "int" }
1979 2008 Property { name: "firstColumn"; type: "int" }
1980 2009 Property { name: "columnCount"; type: "int" }
1981 2010 Signal { name: "seriesReplaced" }
1982 2011 Signal { name: "modelReplaced" }
1983 2012 }
1984 2013 Component {
1985 2014 name: "QtCharts::QHXYModelMapper"
1986 2015 prototype: "QtCharts::QXYModelMapper"
1987 2016 exports: [
1988 2017 "QtCharts/HXYModelMapper 1.0",
1989 2018 "QtCharts/HXYModelMapper 2.0"
1990 2019 ]
1991 2020 exportMetaObjectRevisions: [0, 0]
1992 2021 Property { name: "series"; type: "QXYSeries"; isPointer: true }
1993 2022 Property { name: "model"; type: "QAbstractItemModel"; isPointer: true }
1994 2023 Property { name: "xRow"; type: "int" }
1995 2024 Property { name: "yRow"; type: "int" }
1996 2025 Property { name: "firstColumn"; type: "int" }
1997 2026 Property { name: "columnCount"; type: "int" }
1998 2027 Signal { name: "seriesReplaced" }
1999 2028 Signal { name: "modelReplaced" }
2000 2029 }
2001 2030 Component { name: "QtCharts::QHorizontalBarSeries"; prototype: "QtCharts::QAbstractBarSeries" }
2002 2031 Component {
2003 2032 name: "QtCharts::QHorizontalPercentBarSeries"
2004 2033 prototype: "QtCharts::QAbstractBarSeries"
2005 2034 }
2006 2035 Component {
2007 2036 name: "QtCharts::QHorizontalStackedBarSeries"
2008 2037 prototype: "QtCharts::QAbstractBarSeries"
2009 2038 }
2010 2039 Component {
2011 2040 name: "QtCharts::QLegend"
2012 2041 defaultProperty: "children"
2013 2042 prototype: "QGraphicsWidget"
2014 2043 exports: ["QtCharts/Legend 1.0", "QtCharts/Legend 2.0"]
2015 2044 isCreatable: false
2016 2045 exportMetaObjectRevisions: [0, 0]
2017 2046 Property { name: "alignment"; type: "Qt::Alignment" }
2018 2047 Property { name: "backgroundVisible"; type: "bool" }
2019 2048 Property { name: "color"; type: "QColor" }
2020 2049 Property { name: "borderColor"; type: "QColor" }
2021 2050 Property { name: "font"; type: "QFont" }
2022 2051 Property { name: "labelColor"; type: "QColor" }
2023 2052 Property { name: "reverseMarkers"; type: "bool" }
2024 2053 Signal {
2025 2054 name: "backgroundVisibleChanged"
2026 2055 Parameter { name: "visible"; type: "bool" }
2027 2056 }
2028 2057 Signal {
2029 2058 name: "colorChanged"
2030 2059 Parameter { name: "color"; type: "QColor" }
2031 2060 }
2032 2061 Signal {
2033 2062 name: "borderColorChanged"
2034 2063 Parameter { name: "color"; type: "QColor" }
2035 2064 }
2036 2065 Signal {
2037 2066 name: "fontChanged"
2038 2067 Parameter { name: "font"; type: "QFont" }
2039 2068 }
2040 2069 Signal {
2041 2070 name: "labelColorChanged"
2042 2071 Parameter { name: "color"; type: "QColor" }
2043 2072 }
2044 2073 Signal {
2045 2074 name: "reverseMarkersChanged"
2046 2075 Parameter { name: "reverseMarkers"; type: "bool" }
2047 2076 }
2048 2077 }
2049 2078 Component { name: "QtCharts::QLineSeries"; prototype: "QtCharts::QXYSeries" }
2050 2079 Component {
2051 2080 name: "QtCharts::QLogValueAxis"
2052 2081 prototype: "QtCharts::QAbstractAxis"
2053 2082 exports: ["QtCharts/LogValueAxis 1.3", "QtCharts/LogValueAxis 2.0"]
2054 2083 exportMetaObjectRevisions: [0, 1]
2055 2084 Property { name: "min"; type: "double" }
2056 2085 Property { name: "max"; type: "double" }
2057 2086 Property { name: "labelFormat"; type: "string" }
2058 2087 Property { name: "base"; type: "double" }
2059 2088 Signal {
2060 2089 name: "minChanged"
2061 2090 Parameter { name: "min"; type: "double" }
2062 2091 }
2063 2092 Signal {
2064 2093 name: "maxChanged"
2065 2094 Parameter { name: "max"; type: "double" }
2066 2095 }
2067 2096 Signal {
2068 2097 name: "rangeChanged"
2069 2098 Parameter { name: "min"; type: "double" }
2070 2099 Parameter { name: "max"; type: "double" }
2071 2100 }
2072 2101 Signal {
2073 2102 name: "labelFormatChanged"
2074 2103 Parameter { name: "format"; type: "string" }
2075 2104 }
2076 2105 Signal {
2077 2106 name: "baseChanged"
2078 2107 Parameter { name: "base"; type: "double" }
2079 2108 }
2080 2109 }
2081 2110 Component { name: "QtCharts::QPercentBarSeries"; prototype: "QtCharts::QAbstractBarSeries" }
2082 2111 Component {
2083 2112 name: "QtCharts::QPieModelMapper"
2084 2113 prototype: "QObject"
2085 2114 exports: [
2086 2115 "QtCharts/PieModelMapper 1.0",
2087 2116 "QtCharts/PieModelMapper 2.0"
2088 2117 ]
2089 2118 isCreatable: false
2090 2119 exportMetaObjectRevisions: [0, 0]
2091 2120 }
2092 2121 Component {
2093 2122 name: "QtCharts::QPieSeries"
2094 2123 prototype: "QtCharts::QAbstractSeries"
2095 2124 exports: ["QtCharts/QPieSeries 1.0", "QtCharts/QPieSeries 2.0"]
2096 2125 isCreatable: false
2097 2126 exportMetaObjectRevisions: [0, 0]
2098 2127 Property { name: "horizontalPosition"; type: "double" }
2099 2128 Property { name: "verticalPosition"; type: "double" }
2100 2129 Property { name: "size"; type: "double" }
2101 2130 Property { name: "startAngle"; type: "double" }
2102 2131 Property { name: "endAngle"; type: "double" }
2103 2132 Property { name: "count"; type: "int"; isReadonly: true }
2104 2133 Property { name: "sum"; type: "double"; isReadonly: true }
2105 2134 Property { name: "holeSize"; type: "double" }
2106 2135 Signal {
2107 2136 name: "added"
2108 2137 Parameter { name: "slices"; type: "QList<QPieSlice*>" }
2109 2138 }
2110 2139 Signal {
2111 2140 name: "removed"
2112 2141 Parameter { name: "slices"; type: "QList<QPieSlice*>" }
2113 2142 }
2114 2143 Signal {
2115 2144 name: "clicked"
2116 2145 Parameter { name: "slice"; type: "QPieSlice"; isPointer: true }
2117 2146 }
2118 2147 Signal {
2119 2148 name: "hovered"
2120 2149 Parameter { name: "slice"; type: "QPieSlice"; isPointer: true }
2121 2150 Parameter { name: "state"; type: "bool" }
2122 2151 }
2123 2152 Signal {
2124 2153 name: "pressed"
2125 2154 Parameter { name: "slice"; type: "QPieSlice"; isPointer: true }
2126 2155 }
2127 2156 Signal {
2128 2157 name: "released"
2129 2158 Parameter { name: "slice"; type: "QPieSlice"; isPointer: true }
2130 2159 }
2131 2160 Signal {
2132 2161 name: "doubleClicked"
2133 2162 Parameter { name: "slice"; type: "QPieSlice"; isPointer: true }
2134 2163 }
2135 2164 }
2136 2165 Component {
2137 2166 name: "QtCharts::QPieSlice"
2138 2167 prototype: "QObject"
2139 2168 exports: ["QtCharts/PieSlice 1.0", "QtCharts/PieSlice 2.0"]
2140 2169 exportMetaObjectRevisions: [0, 0]
2141 2170 Enum {
2142 2171 name: "LabelPosition"
2143 2172 values: {
2144 2173 "LabelOutside": 0,
2145 2174 "LabelInsideHorizontal": 1,
2146 2175 "LabelInsideTangential": 2,
2147 2176 "LabelInsideNormal": 3
2148 2177 }
2149 2178 }
2150 2179 Property { name: "label"; type: "string" }
2151 2180 Property { name: "value"; type: "double" }
2152 2181 Property { name: "labelVisible"; type: "bool" }
2153 2182 Property { name: "labelPosition"; type: "LabelPosition" }
2154 2183 Property { name: "exploded"; type: "bool" }
2155 2184 Property { name: "pen"; type: "QPen" }
2156 2185 Property { name: "borderColor"; type: "QColor" }
2157 2186 Property { name: "borderWidth"; type: "int" }
2158 2187 Property { name: "brush"; type: "QBrush" }
2159 2188 Property { name: "color"; type: "QColor" }
2160 2189 Property { name: "labelBrush"; type: "QBrush" }
2161 2190 Property { name: "labelColor"; type: "QColor" }
2162 2191 Property { name: "labelFont"; type: "QFont" }
2163 2192 Property { name: "labelArmLengthFactor"; type: "double" }
2164 2193 Property { name: "explodeDistanceFactor"; type: "double" }
2165 2194 Property { name: "percentage"; type: "double"; isReadonly: true }
2166 2195 Property { name: "startAngle"; type: "double"; isReadonly: true }
2167 2196 Property { name: "angleSpan"; type: "double"; isReadonly: true }
2168 2197 Signal { name: "clicked" }
2169 2198 Signal {
2170 2199 name: "hovered"
2171 2200 Parameter { name: "state"; type: "bool" }
2172 2201 }
2173 2202 Signal { name: "pressed" }
2174 2203 Signal { name: "released" }
2175 2204 Signal { name: "doubleClicked" }
2176 2205 }
2177 2206 Component {
2178 2207 name: "QtCharts::QScatterSeries"
2179 2208 prototype: "QtCharts::QXYSeries"
2180 2209 Enum {
2181 2210 name: "MarkerShape"
2182 2211 values: {
2183 2212 "MarkerShapeCircle": 0,
2184 2213 "MarkerShapeRectangle": 1
2185 2214 }
2186 2215 }
2187 2216 Property { name: "color"; type: "QColor" }
2188 2217 Property { name: "borderColor"; type: "QColor" }
2189 2218 Property { name: "markerShape"; type: "MarkerShape" }
2190 2219 Property { name: "markerSize"; type: "double" }
2191 2220 Property { name: "brush"; type: "QBrush" }
2192 2221 Signal {
2193 2222 name: "colorChanged"
2194 2223 Parameter { name: "color"; type: "QColor" }
2195 2224 }
2196 2225 Signal {
2197 2226 name: "borderColorChanged"
2198 2227 Parameter { name: "color"; type: "QColor" }
2199 2228 }
2200 2229 }
2201 2230 Component { name: "QtCharts::QSplineSeries"; prototype: "QtCharts::QLineSeries" }
2202 2231 Component { name: "QtCharts::QStackedBarSeries"; prototype: "QtCharts::QAbstractBarSeries" }
2203 2232 Component {
2204 2233 name: "QtCharts::QVBarModelMapper"
2205 2234 prototype: "QtCharts::QBarModelMapper"
2206 2235 exports: [
2207 2236 "QtCharts/VBarModelMapper 1.0",
2208 2237 "QtCharts/VBarModelMapper 2.0"
2209 2238 ]
2210 2239 exportMetaObjectRevisions: [0, 0]
2211 2240 Property { name: "series"; type: "QAbstractBarSeries"; isPointer: true }
2212 2241 Property { name: "model"; type: "QAbstractItemModel"; isPointer: true }
2213 2242 Property { name: "firstBarSetColumn"; type: "int" }
2214 2243 Property { name: "lastBarSetColumn"; type: "int" }
2215 2244 Property { name: "firstRow"; type: "int" }
2216 2245 Property { name: "rowCount"; type: "int" }
2217 2246 Signal { name: "seriesReplaced" }
2218 2247 Signal { name: "modelReplaced" }
2219 2248 }
2220 2249 Component {
2221 2250 name: "QtCharts::QVBoxPlotModelMapper"
2222 2251 prototype: "QtCharts::QBoxPlotModelMapper"
2223 2252 exports: ["QtCharts/VBoxPlotModelMapper 2.0"]
2224 2253 exportMetaObjectRevisions: [0]
2225 2254 Property { name: "series"; type: "QBoxPlotSeries"; isPointer: true }
2226 2255 Property { name: "model"; type: "QAbstractItemModel"; isPointer: true }
2227 2256 Property { name: "firstBoxSetColumn"; type: "int" }
2228 2257 Property { name: "lastBoxSetColumn"; type: "int" }
2229 2258 Property { name: "firstRow"; type: "int" }
2230 2259 Property { name: "rowCount"; type: "int" }
2231 2260 Signal { name: "seriesReplaced" }
2232 2261 Signal { name: "modelReplaced" }
2233 2262 }
2234 2263 Component {
2235 2264 name: "QtCharts::QVPieModelMapper"
2236 2265 prototype: "QtCharts::QPieModelMapper"
2237 2266 exports: [
2238 2267 "QtCharts/VPieModelMapper 1.0",
2239 2268 "QtCharts/VPieModelMapper 2.0"
2240 2269 ]
2241 2270 exportMetaObjectRevisions: [0, 0]
2242 2271 Property { name: "series"; type: "QPieSeries"; isPointer: true }
2243 2272 Property { name: "model"; type: "QAbstractItemModel"; isPointer: true }
2244 2273 Property { name: "valuesColumn"; type: "int" }
2245 2274 Property { name: "labelsColumn"; type: "int" }
2246 2275 Property { name: "firstRow"; type: "int" }
2247 2276 Property { name: "rowCount"; type: "int" }
2248 2277 Signal { name: "seriesReplaced" }
2249 2278 Signal { name: "modelReplaced" }
2250 2279 }
2251 2280 Component {
2252 2281 name: "QtCharts::QVXYModelMapper"
2253 2282 prototype: "QtCharts::QXYModelMapper"
2254 2283 exports: [
2255 2284 "QtCharts/VXYModelMapper 1.0",
2256 2285 "QtCharts/VXYModelMapper 2.0"
2257 2286 ]
2258 2287 exportMetaObjectRevisions: [0, 0]
2259 2288 Property { name: "series"; type: "QXYSeries"; isPointer: true }
2260 2289 Property { name: "model"; type: "QAbstractItemModel"; isPointer: true }
2261 2290 Property { name: "xColumn"; type: "int" }
2262 2291 Property { name: "yColumn"; type: "int" }
2263 2292 Property { name: "firstRow"; type: "int" }
2264 2293 Property { name: "rowCount"; type: "int" }
2265 2294 Signal { name: "seriesReplaced" }
2266 2295 Signal { name: "modelReplaced" }
2267 2296 }
2268 2297 Component {
2269 2298 name: "QtCharts::QValueAxis"
2270 2299 prototype: "QtCharts::QAbstractAxis"
2271 2300 exports: [
2272 2301 "QtCharts/ValueAxis 1.1",
2273 2302 "QtCharts/ValueAxis 2.0",
2274 2303 "QtCharts/ValuesAxis 1.0"
2275 2304 ]
2276 2305 exportMetaObjectRevisions: [0, 0, 0]
2277 2306 Property { name: "tickCount"; type: "int" }
2278 2307 Property { name: "min"; type: "double" }
2279 2308 Property { name: "max"; type: "double" }
2280 2309 Property { name: "labelFormat"; type: "string" }
2281 2310 Signal {
2282 2311 name: "minChanged"
2283 2312 Parameter { name: "min"; type: "double" }
2284 2313 }
2285 2314 Signal {
2286 2315 name: "maxChanged"
2287 2316 Parameter { name: "max"; type: "double" }
2288 2317 }
2289 2318 Signal {
2290 2319 name: "rangeChanged"
2291 2320 Parameter { name: "min"; type: "double" }
2292 2321 Parameter { name: "max"; type: "double" }
2293 2322 }
2294 2323 Signal {
2295 2324 name: "tickCountChanged"
2296 2325 Parameter { name: "tickCount"; type: "int" }
2297 2326 }
2298 2327 Signal {
2299 2328 name: "labelFormatChanged"
2300 2329 Parameter { name: "format"; type: "string" }
2301 2330 }
2302 2331 Method { name: "applyNiceNumbers" }
2303 2332 }
2304 2333 Component {
2305 2334 name: "QtCharts::QXYModelMapper"
2306 2335 prototype: "QObject"
2307 2336 exports: ["QtCharts/XYModelMapper 1.0", "QtCharts/XYModelMapper 2.0"]
2308 2337 isCreatable: false
2309 2338 exportMetaObjectRevisions: [0, 0]
2310 2339 }
2311 2340 Component {
2312 2341 name: "QtCharts::QXYSeries"
2313 2342 prototype: "QtCharts::QAbstractSeries"
2314 2343 exports: ["QtCharts/XYSeries 1.0", "QtCharts/XYSeries 2.0"]
2315 2344 isCreatable: false
2316 2345 exportMetaObjectRevisions: [0, 0]
2317 2346 Property { name: "pointsVisible"; type: "bool" }
2318 2347 Property { name: "color"; type: "QColor" }
2319 2348 Property { name: "pointLabelsFormat"; type: "string" }
2320 2349 Property { name: "pointLabelsVisible"; type: "bool" }
2321 2350 Property { name: "pointLabelsFont"; type: "QFont" }
2322 2351 Property { name: "pointLabelsColor"; type: "QColor" }
2323 2352 Signal {
2324 2353 name: "clicked"
2325 2354 Parameter { name: "point"; type: "QPointF" }
2326 2355 }
2327 2356 Signal {
2328 2357 name: "hovered"
2329 2358 Parameter { name: "point"; type: "QPointF" }
2330 2359 Parameter { name: "state"; type: "bool" }
2331 2360 }
2332 2361 Signal {
2333 2362 name: "pressed"
2334 2363 Parameter { name: "point"; type: "QPointF" }
2335 2364 }
2336 2365 Signal {
2337 2366 name: "released"
2338 2367 Parameter { name: "point"; type: "QPointF" }
2339 2368 }
2340 2369 Signal {
2341 2370 name: "doubleClicked"
2342 2371 Parameter { name: "point"; type: "QPointF" }
2343 2372 }
2344 2373 Signal {
2345 2374 name: "pointReplaced"
2346 2375 Parameter { name: "index"; type: "int" }
2347 2376 }
2348 2377 Signal {
2349 2378 name: "pointRemoved"
2350 2379 Parameter { name: "index"; type: "int" }
2351 2380 }
2352 2381 Signal {
2353 2382 name: "pointAdded"
2354 2383 Parameter { name: "index"; type: "int" }
2355 2384 }
2356 2385 Signal {
2357 2386 name: "colorChanged"
2358 2387 Parameter { name: "color"; type: "QColor" }
2359 2388 }
2360 2389 Signal { name: "pointsReplaced" }
2361 2390 Signal {
2362 2391 name: "pointLabelsFormatChanged"
2363 2392 Parameter { name: "format"; type: "string" }
2364 2393 }
2365 2394 Signal {
2366 2395 name: "pointLabelsVisibilityChanged"
2367 2396 Parameter { name: "visible"; type: "bool" }
2368 2397 }
2369 2398 Signal {
2370 2399 name: "pointLabelsFontChanged"
2371 2400 Parameter { name: "font"; type: "QFont" }
2372 2401 }
2373 2402 Signal {
2374 2403 name: "pointLabelsColorChanged"
2375 2404 Parameter { name: "color"; type: "QColor" }
2376 2405 }
2377 2406 }
2378 2407 }
@@ -1,306 +1,318
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2015 The Qt Company Ltd
4 4 ** All rights reserved.
5 5 ** For any questions to The Qt Company, please use contact form at http://qt.io
6 6 **
7 7 ** This file is part of the Qt Charts module.
8 8 **
9 9 ** Licensees holding valid commercial license for Qt may use this file in
10 10 ** accordance with the Qt License Agreement provided with the Software
11 11 ** or, alternatively, in accordance with the terms contained in a written
12 12 ** agreement between you and The Qt Company.
13 13 **
14 14 ** If you have questions regarding the use of this file, please use
15 15 ** contact form at http://qt.io
16 16 **
17 17 ****************************************************************************/
18 18
19 19 #include "../qabstractaxis/tst_qabstractaxis.h"
20 20 #include <QtCharts/QCategoryAxis>
21 21 #include <QtCharts/QLineSeries>
22 22
23 23 class tst_QCategoryAxis: public tst_QAbstractAxis
24 24 {
25 25 Q_OBJECT
26 26
27 27 public slots:
28 28 void initTestCase();
29 29 void cleanupTestCase();
30 30 void init();
31 31 void cleanup();
32 32
33 33 private slots:
34 34 void qcategoryaxis_data();
35 35 void qcategoryaxis();
36 36
37 37 void max_raw_data();
38 38 void max_raw();
39 39 void max_data();
40 40 void max();
41 41 void max_animation_data();
42 42 void max_animation();
43 43 void min_raw_data();
44 44 void min_raw();
45 45 void min_data();
46 46 void min();
47 47 void min_animation_data();
48 48 void min_animation();
49 49 void range_raw_data();
50 50 void range_raw();
51 51 void range_data();
52 52 void range();
53 53 void range_animation_data();
54 54 void range_animation();
55 void labels_position();
55 56
56 57 void interval_data();
57 58 void interval();
58 59
59 60 private:
60 61 QCategoryAxis* m_categoryaxis;
61 62 QLineSeries* m_series;
62 63 };
63 64
64 65 void tst_QCategoryAxis::initTestCase()
65 66 {
67 qRegisterMetaType<QCategoryAxis::AxisLabelsPosition>("QCategoryAxis::AxisLabelsPosition");
66 68 }
67 69
68 70 void tst_QCategoryAxis::cleanupTestCase()
69 71 {
70 72 QTest::qWait(1); // Allow final deleteLaters to run
71 73 }
72 74
73 75 void tst_QCategoryAxis::init()
74 76 {
75 77 m_categoryaxis = new QCategoryAxis();
76 78 m_series = new QLineSeries();
77 79 *m_series << QPointF(-100, -100) << QPointF(0, 0) << QPointF(100, 100);
78 80 tst_QAbstractAxis::init(m_categoryaxis, m_series);
79 81 m_chart->addSeries(m_series);
80 82 m_chart->createDefaultAxes();
81 83 }
82 84
83 85 void tst_QCategoryAxis::cleanup()
84 86 {
85 87 delete m_series;
86 88 delete m_categoryaxis;
87 89 m_series = 0;
88 90 m_categoryaxis = 0;
89 91 tst_QAbstractAxis::cleanup();
90 92 }
91 93
92 94 void tst_QCategoryAxis::qcategoryaxis_data()
93 95 {
94 96 }
95 97
96 98 void tst_QCategoryAxis::qcategoryaxis()
97 99 {
98 100 qabstractaxis();
99 101
100 102 QVERIFY(qFuzzyCompare(m_categoryaxis->max(), 0));
101 103 QVERIFY(qFuzzyCompare(m_categoryaxis->min(), 0));
102 104 QCOMPARE(m_categoryaxis->type(), QAbstractAxis::AxisTypeCategory);
105 QCOMPARE(m_categoryaxis->labelsPosition(), QCategoryAxis::AxisLabelsPositionCenter);
103 106
104 107 m_chart->setAxisX(m_categoryaxis, m_series);
105 108 m_view->show();
106 109 QTest::qWaitForWindowShown(m_view);
107 110
108 111 QVERIFY(!qFuzzyCompare(m_categoryaxis->max(), 0));
109 112 QVERIFY(!qFuzzyCompare(m_categoryaxis->min(), 0));
110 113 }
111 114
112 115 void tst_QCategoryAxis::max_raw_data()
113 116 {
114 117 QTest::addColumn<qreal>("max");
115 118 QTest::newRow("1.0") << (qreal)1.0;
116 119 QTest::newRow("50.0") << (qreal)50.0;
117 120 QTest::newRow("101.0") << (qreal)101.0;
118 121 }
119 122
120 123 void tst_QCategoryAxis::max_raw()
121 124 {
122 125 QFETCH(qreal, max);
123 126
124 127 QSignalSpy spy0(m_categoryaxis, SIGNAL(maxChanged(qreal)));
125 128 QSignalSpy spy1(m_categoryaxis, SIGNAL(minChanged(qreal)));
126 129 QSignalSpy spy2(m_categoryaxis, SIGNAL(rangeChanged(qreal,qreal)));
127 130
128 131 m_categoryaxis->setMax(max);
129 132 QVERIFY2(qFuzzyCompare(m_categoryaxis->max(), max), "Not equal");
130 133
131 134 QCOMPARE(spy0.count(), 1);
132 135 QCOMPARE(spy1.count(), 0);
133 136 QCOMPARE(spy2.count(), 1);
134 137 }
135 138
136 139 void tst_QCategoryAxis::max_data()
137 140 {
138 141 max_raw_data();
139 142 }
140 143
141 144 void tst_QCategoryAxis::max()
142 145 {
143 146 m_chart->setAxisX(m_categoryaxis, m_series);
144 147 m_view->show();
145 148 QTest::qWaitForWindowShown(m_view);
146 149 max_raw();
147 150 }
148 151
149 152 void tst_QCategoryAxis::max_animation_data()
150 153 {
151 154 max_data();
152 155 }
153 156
154 157 void tst_QCategoryAxis::max_animation()
155 158 {
156 159 m_chart->setAnimationOptions(QChart::GridAxisAnimations);
157 160 max();
158 161 }
159 162
160 163 void tst_QCategoryAxis::min_raw_data()
161 164 {
162 165 QTest::addColumn<qreal>("min");
163 166 QTest::newRow("-1.0") << (qreal)-1.0;
164 167 QTest::newRow("-50.0") << (qreal)-50.0;
165 168 QTest::newRow("-101.0") << (qreal)-101.0;
166 169 }
167 170
168 171 void tst_QCategoryAxis::min_raw()
169 172 {
170 173 QFETCH(qreal, min);
171 174
172 175 QSignalSpy spy0(m_categoryaxis, SIGNAL(maxChanged(qreal)));
173 176 QSignalSpy spy1(m_categoryaxis, SIGNAL(minChanged(qreal)));
174 177 QSignalSpy spy2(m_categoryaxis, SIGNAL(rangeChanged(qreal,qreal)));
175 178
176 179 m_categoryaxis->setMin(min);
177 180 QVERIFY2(qFuzzyCompare(m_categoryaxis->min(), min), "Not equal");
178 181
179 182 QCOMPARE(spy0.count(), 0);
180 183 QCOMPARE(spy1.count(), 1);
181 184 QCOMPARE(spy2.count(), 1);
182 185 }
183 186
184 187 void tst_QCategoryAxis::min_data()
185 188 {
186 189 min_raw_data();
187 190 }
188 191
189 192 void tst_QCategoryAxis::min()
190 193 {
191 194 m_chart->setAxisX(m_categoryaxis, m_series);
192 195 m_view->show();
193 196 QTest::qWaitForWindowShown(m_view);
194 197 min_raw();
195 198 }
196 199
197 200 void tst_QCategoryAxis::min_animation_data()
198 201 {
199 202 min_data();
200 203 }
201 204
202 205 void tst_QCategoryAxis::min_animation()
203 206 {
204 207 m_chart->setAnimationOptions(QChart::GridAxisAnimations);
205 208 min();
206 209 }
207 210
208 211 void tst_QCategoryAxis::range_raw_data()
209 212 {
210 213 QTest::addColumn<qreal>("min");
211 214 QTest::addColumn<qreal>("max");
212 215 QTest::newRow("1.0 - 101.0") << (qreal)-1.0 << (qreal)101.0;
213 216 QTest::newRow("25.0 - 75.0") << (qreal)25.0 << (qreal)75.0;
214 217 QTest::newRow("101.0") << (qreal)40.0 << (qreal)60.0;
215 218 QTest::newRow("-35.0 - 0.0") << (qreal)-35.0 << (qreal)10.0;
216 219 QTest::newRow("-35.0 - 0.0") << (qreal)-35.0 << (qreal)-15.0;
217 220 QTest::newRow("0.0 - 0.0") << (qreal)-0.1 << (qreal)0.1;
218 221 }
219 222
220 223 void tst_QCategoryAxis::range_raw()
221 224 {
222 225 QFETCH(qreal, min);
223 226 QFETCH(qreal, max);
224 227
225 228 QSignalSpy spy0(m_categoryaxis, SIGNAL(maxChanged(qreal)));
226 229 QSignalSpy spy1(m_categoryaxis, SIGNAL(minChanged(qreal)));
227 230 QSignalSpy spy2(m_categoryaxis, SIGNAL(rangeChanged(qreal,qreal)));
228 231
229 232 m_categoryaxis->setRange(min, max);
230 233 QVERIFY2(qFuzzyCompare(m_categoryaxis->min(), min), "Min not equal");
231 234 QVERIFY2(qFuzzyCompare(m_categoryaxis->max(), max), "Max not equal");
232 235
233 236 QCOMPARE(spy0.count(), 1);
234 237 QCOMPARE(spy1.count(), 1);
235 238 QCOMPARE(spy2.count(), 1);
236 239 }
237 240
238 241 void tst_QCategoryAxis::range_data()
239 242 {
240 243 range_raw_data();
241 244 }
242 245
243 246 void tst_QCategoryAxis::range()
244 247 {
245 248 m_chart->setAxisX(m_categoryaxis, m_series);
246 249 m_view->show();
247 250 QTest::qWaitForWindowShown(m_view);
248 251 range_raw();
249 252 }
250 253
251 254 void tst_QCategoryAxis::range_animation_data()
252 255 {
253 256 range_data();
254 257 }
255 258
256 259 void tst_QCategoryAxis::range_animation()
257 260 {
258 261 m_chart->setAnimationOptions(QChart::GridAxisAnimations);
259 262 range();
260 263 }
261 264
262 265 void tst_QCategoryAxis::interval_data()
263 266 {
264 267 //
265 268 }
266 269
267 270 void tst_QCategoryAxis::interval()
268 271 {
269 272 // append one correct interval
270 273 m_categoryaxis->append("first", (qreal)45);
271 274 QCOMPARE(m_categoryaxis->startValue("first"), (qreal)0);
272 275 QCOMPARE(m_categoryaxis->endValue("first"), (qreal)45);
273 276
274 277 // append one more correct interval
275 278 m_categoryaxis->append("second", (qreal)75);
276 279 QCOMPARE(m_categoryaxis->startValue("second"), (qreal)45);
277 280 QCOMPARE(m_categoryaxis->endValue("second"), (qreal)75);
278 281
279 282 // append one incorrect interval
280 283 m_categoryaxis->append("third", (qreal)15);
281 284 QCOMPARE(m_categoryaxis->count(), 2);
282 285 QCOMPARE(m_categoryaxis->endValue(m_categoryaxis->categoriesLabels().last()), (qreal)75);
283 286 // QCOMPARE(intervalMax("first"), (qreal)75);
284 287
285 288 // append one more correct interval
286 289 m_categoryaxis->append("third", (qreal)100);
287 290 QCOMPARE(m_categoryaxis->count(), 3);
288 291 QCOMPARE(m_categoryaxis->startValue("third"), (qreal)75);
289 292 QCOMPARE(m_categoryaxis->endValue("third"), (qreal)100);
290 293
291 294 // remove one interval
292 295 m_categoryaxis->remove("first");
293 296 QCOMPARE(m_categoryaxis->count(), 2);
294 297 QCOMPARE(m_categoryaxis->startValue("second"), (qreal)0); // second interval should extend to firstInterval minimum
295 298 QCOMPARE(m_categoryaxis->endValue("second"), (qreal)75);
296 299
297 300 // remove one interval
298 301 m_categoryaxis->replaceLabel("second", "replaced");
299 302 QCOMPARE(m_categoryaxis->count(), 2);
300 303 QCOMPARE(m_categoryaxis->startValue("replaced"), (qreal)0); // second interval should extend to firstInterval minimum
301 304 QCOMPARE(m_categoryaxis->endValue("replaced"), (qreal)75);
302 305 }
303 306
307 void tst_QCategoryAxis::labels_position()
308 {
309 QSignalSpy spy(m_categoryaxis,
310 SIGNAL(labelsPositionChanged(QCategoryAxis::AxisLabelsPosition)));
311 m_categoryaxis->setLabelsPosition(QCategoryAxis::AxisLabelsPositionOnValue);
312 QCOMPARE(m_categoryaxis->labelsPosition(), QCategoryAxis::AxisLabelsPositionOnValue);
313 QCOMPARE(spy.count(), 1);
314 }
315
304 316 QTEST_MAIN(tst_QCategoryAxis)
305 317 #include "tst_qcategoryaxis.moc"
306 318
@@ -1,82 +1,97
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2015 The Qt Company Ltd
4 4 ** All rights reserved.
5 5 ** For any questions to The Qt Company, please use contact form at http://qt.io
6 6 **
7 7 ** This file is part of the Qt Charts module.
8 8 **
9 9 ** Licensees holding valid commercial license for Qt may use this file in
10 10 ** accordance with the Qt License Agreement provided with the Software
11 11 ** or, alternatively, in accordance with the terms contained in a written
12 12 ** agreement between you and The Qt Company.
13 13 **
14 14 ** If you have questions regarding the use of this file, please use
15 15 ** contact form at http://qt.io
16 16 **
17 17 ****************************************************************************/
18 18
19 19 import QtQuick 2.0
20 20 import QtTest 1.0
21 import QtCharts 2.0
21 import QtCharts 2.1
22 22
23 23 Rectangle {
24 24 width: 400
25 25 height: 300
26 26
27 27 TestCase {
28 28 id: tc1
29 29 name: "tst_qml-qtquicktest CategoryAxis"
30 30 when: windowShown
31 31
32 32 function test_minMax() {
33 33 compare(lineSeries1.axisX.min, 0, "AxisX min");
34 34 compare(lineSeries1.axisX.max, 10, "AxisX max");
35 35 compare(lineSeries1.axisY.min, 0, "AxisY min");
36 36 compare(lineSeries1.axisY.max, 10, "AxisY max");
37 37 }
38 38
39 39 function test_categories() {
40 40 compare(lineSeries1.axisY.startValue, 0, "AxisY start value");
41 41 compare(lineSeries1.axisY.count, 3, "AxisY count");
42 42 compare(lineSeries1.axisY.categoriesLabels[0], "label0", "AxisY categories labels");
43 43 compare(lineSeries1.axisY.categoriesLabels[1], "label1", "AxisY categories labels");
44 44 compare(lineSeries1.axisY.categoriesLabels[2], "label2", "AxisY categories labels");
45 45 }
46
47 function test_properties() {
48 compare(lineSeries1.axisY.labelsPosition, CategoryAxis.AxisLabelsPositionCenter);
49 }
50
51 function test_signals() {
52 axisLabelsPositionSpy.clear();
53 lineSeries1.axisY.labelsPosition = CategoryAxis.AxisLabelsPositionOnValue;
54 compare(axisLabelsPositionSpy.count, 1, "onLabelsPositionChanged")
55 }
46 56 }
47 57
48 58 ChartView {
49 59 id: chartView
50 60 anchors.fill: parent
51 61
52 62 LineSeries {
53 63 id: lineSeries1
54 64 axisX: ValueAxis {
55 65 id: axisX
56 66 min: 0
57 67 max: 10
58 68 }
59 69 axisY: CategoryAxis {
60 70 id: axisY
61 71 min: 0
62 72 max: 10
63 73 startValue: 0
64 74 CategoryRange {
65 75 label: "label0"
66 76 endValue: 1
67 77 }
68 78 CategoryRange {
69 79 label: "label1"
70 80 endValue: 3
71 81 }
72 82 CategoryRange {
73 83 label: "label2"
74 84 endValue: 10
75 85 }
86 SignalSpy {
87 id: axisLabelsPositionSpy
88 target: axisY
89 signalName: "labelsPositionChanged"
90 }
76 91 }
77 92 XYPoint { x: -1; y: -1 }
78 93 XYPoint { x: 0; y: 0 }
79 94 XYPoint { x: 5; y: 5 }
80 95 }
81 96 }
82 97 }
@@ -1,190 +1,199
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2015 The Qt Company Ltd
4 4 ** All rights reserved.
5 5 ** For any questions to The Qt Company, please use contact form at http://qt.io
6 6 **
7 7 ** This file is part of the Qt Charts module.
8 8 **
9 9 ** Licensees holding valid commercial license for Qt may use this file in
10 10 ** accordance with the Qt License Agreement provided with the Software
11 11 ** or, alternatively, in accordance with the terms contained in a written
12 12 ** agreement between you and The Qt Company.
13 13 **
14 14 ** If you have questions regarding the use of this file, please use
15 15 ** contact form at http://qt.io
16 16 **
17 17 ****************************************************************************/
18 18 #include <QtTest/QtTest>
19 19 #include <QtQml/QQmlEngine>
20 20 #include <QtQml/QQmlComponent>
21 21 #include "tst_definitions.h"
22 22
23 23 class tst_qml : public QObject
24 24 {
25 25 Q_OBJECT
26 26
27 27 public slots:
28 28 void initTestCase();
29 29 void cleanupTestCase();
30 30 void init();
31 31 void cleanup();
32 32 private slots:
33 33 void checkPlugin_data();
34 34 void checkPlugin();
35 35 private:
36 36 QString componentErrors(const QQmlComponent* component) const;
37 37 QString imports_1_1();
38 38 QString imports_1_3();
39 39 QString imports_1_4();
40 40 QString imports_2_0();
41 QString imports_2_1();
41 42
42 43 };
43 44
44 45 QString tst_qml::componentErrors(const QQmlComponent* component) const
45 46 {
46 47 Q_ASSERT(component);
47 48
48 49 QStringList errors;
49 50
50 51 foreach (QQmlError const& error, component->errors()) {
51 52 errors << error.toString();
52 53 }
53 54
54 55 return errors.join("\n");
55 56 }
56 57
57 58 QString tst_qml::imports_1_1()
58 59 {
59 60 return "import QtQuick 2.0 \n"
60 61 "import QtCharts 1.1 \n";
61 62 }
62 63
63 64 QString tst_qml::imports_1_3()
64 65 {
65 66 return "import QtQuick 2.0 \n"
66 67 "import QtCharts 1.3 \n";
67 68 }
68 69
69 70 QString tst_qml::imports_1_4()
70 71 {
71 72 return "import QtQuick 2.0 \n"
72 73 "import QtCharts 1.4 \n";
73 74 }
74 75
75 76 QString tst_qml::imports_2_0()
76 77 {
77 78 return "import QtQuick 2.0 \n"
78 79 "import QtCharts 2.0 \n";
79 80 }
80 81
82 QString tst_qml::imports_2_1()
83 {
84 return "import QtQuick 2.1 \n"
85 "import QtCharts 2.1 \n";
86 }
87
81 88 void tst_qml::initTestCase()
82 89 {
83 90 }
84 91
85 92 void tst_qml::cleanupTestCase()
86 93 {
87 94 }
88 95
89 96 void tst_qml::init()
90 97 {
91 98
92 99 }
93 100
94 101 void tst_qml::cleanup()
95 102 {
96 103
97 104 }
98 105
99 106 void tst_qml::checkPlugin_data()
100 107 {
101 108 QTest::addColumn<QString>("source");
102 109
103 110 QTest::newRow("createChartView") << imports_1_1() + "ChartView{}";
104 111 QTest::newRow("XYPoint") << imports_1_1() + "XYPoint{}";
105 112 QTest::newRow("scatterSeries") << imports_1_1() + "ScatterSeries{}";
106 113 QTest::newRow("lineSeries") << imports_1_1() + "LineSeries{}";
107 114 QTest::newRow("splineSeries") << imports_1_1() + "SplineSeries{}";
108 115 QTest::newRow("areaSeries") << imports_1_1() + "AreaSeries{}";
109 116 QTest::newRow("barSeries") << imports_1_1() + "BarSeries{}";
110 117 QTest::newRow("stackedBarSeries") << imports_1_1() + "StackedBarSeries{}";
111 118 QTest::newRow("precentBarSeries") << imports_1_1() + "PercentBarSeries{}";
112 119 QTest::newRow("horizonatlBarSeries") << imports_1_1() + "HorizontalBarSeries{}";
113 120 QTest::newRow("horizonatlStackedBarSeries") << imports_1_1() + "HorizontalStackedBarSeries{}";
114 121 QTest::newRow("horizonatlstackedBarSeries") << imports_1_1() + "HorizontalPercentBarSeries{}";
115 122 QTest::newRow("pieSeries") << imports_1_1() + "PieSeries{}";
116 123 QTest::newRow("PieSlice") << imports_1_1() + "PieSlice{}";
117 124 QTest::newRow("BarSet") << imports_1_1() + "BarSet{}";
118 125 QTest::newRow("HXYModelMapper") << imports_1_1() + "HXYModelMapper{}";
119 126 QTest::newRow("VXYModelMapper") << imports_1_1() + "VXYModelMapper{}";
120 127 QTest::newRow("HPieModelMapper") << imports_1_1() + "HPieModelMapper{}";
121 128 QTest::newRow("HPieModelMapper") << imports_1_1() + "HPieModelMapper{}";
122 129 QTest::newRow("HBarModelMapper") << imports_1_1() + "HBarModelMapper{}";
123 130 QTest::newRow("VBarModelMapper") << imports_1_1() + "VBarModelMapper{}";
124 131 QTest::newRow("ValueAxis") << imports_1_1() + "ValueAxis{}";
125 132 #ifndef QT_ON_ARM
126 133 QTest::newRow("DateTimeAxis") << imports_1_1() + "DateTimeAxis{}";
127 134 #endif
128 135 QTest::newRow("CategoryAxis") << imports_1_1() + "CategoryAxis{}";
129 136 QTest::newRow("CategoryRange") << imports_1_1() + "CategoryRange{}";
130 137 QTest::newRow("BarCategoryAxis") << imports_1_1() + "BarCategoryAxis{}";
131 138
132 139 QTest::newRow("createPolarChartView") << imports_1_3() + "PolarChartView{}";
133 140 QTest::newRow("LogValueAxis") << imports_1_3() + "LogValueAxis{}";
134 141 QTest::newRow("BoxPlotSeries") << imports_1_3() + "BoxPlotSeries{}";
135 142 QTest::newRow("BoxSet") << imports_1_3() + "BoxSet{}";
136 143
137 144 QTest::newRow("createChartView_2_0") << imports_2_0() + "ChartView{}";
138 145 QTest::newRow("XYPoint_2_0") << imports_2_0() + "XYPoint{}";
139 146 QTest::newRow("scatterSeries_2_0") << imports_2_0() + "ScatterSeries{}";
140 147 QTest::newRow("lineSeries_2_0") << imports_2_0() + "LineSeries{}";
141 148 QTest::newRow("splineSeries_2_0") << imports_2_0() + "SplineSeries{}";
142 149 QTest::newRow("areaSeries_2_0") << imports_2_0() + "AreaSeries{}";
143 150 QTest::newRow("barSeries_2_0") << imports_2_0() + "BarSeries{}";
144 151 QTest::newRow("stackedBarSeries_2_0") << imports_2_0() + "StackedBarSeries{}";
145 152 QTest::newRow("precentBarSeries_2_0") << imports_2_0() + "PercentBarSeries{}";
146 153 QTest::newRow("horizonatlBarSeries_2_0") << imports_2_0() + "HorizontalBarSeries{}";
147 154 QTest::newRow("horizonatlStackedBarSeries_2_0")
148 155 << imports_2_0() + "HorizontalStackedBarSeries{}";
149 156 QTest::newRow("horizonatlstackedBarSeries_2_0")
150 157 << imports_2_0() + "HorizontalPercentBarSeries{}";
151 158 QTest::newRow("pieSeries_2_0") << imports_2_0() + "PieSeries{}";
152 159 QTest::newRow("PieSlice_2_0") << imports_2_0() + "PieSlice{}";
153 160 QTest::newRow("BarSet_2_0") << imports_2_0() + "BarSet{}";
154 161 QTest::newRow("HXYModelMapper_2_0") << imports_2_0() + "HXYModelMapper{}";
155 162 QTest::newRow("VXYModelMapper_2_0") << imports_2_0() + "VXYModelMapper{}";
156 163 QTest::newRow("HPieModelMapper_2_0") << imports_2_0() + "HPieModelMapper{}";
157 164 QTest::newRow("HPieModelMapper_2_0") << imports_2_0() + "HPieModelMapper{}";
158 165 QTest::newRow("HBarModelMapper_2_0") << imports_2_0() + "HBarModelMapper{}";
159 166 QTest::newRow("VBarModelMapper_2_0") << imports_2_0() + "VBarModelMapper{}";
160 167 QTest::newRow("ValueAxis_2_0") << imports_2_0() + "ValueAxis{}";
161 168 #ifndef QT_ON_ARM
162 169 QTest::newRow("DateTimeAxis_2_0") << imports_2_0() + "DateTimeAxis{}";
163 170 #endif
164 171 QTest::newRow("CategoryAxis_2_0") << imports_2_0() + "CategoryAxis{}";
165 172 QTest::newRow("CategoryRange_2_0") << imports_2_0() + "CategoryRange{}";
166 173 QTest::newRow("BarCategoryAxis_2_0") << imports_2_0() + "BarCategoryAxis{}";
167 174 QTest::newRow("createPolarChartView_2_0") << imports_2_0() + "PolarChartView{}";
168 175 QTest::newRow("LogValueAxis_2_0") << imports_2_0() + "LogValueAxis{}";
169 176 QTest::newRow("BoxPlotSeries_2_0") << imports_2_0() + "BoxPlotSeries{}";
170 177 QTest::newRow("BoxSet_2_0") << imports_2_0() + "BoxSet{}";
178
179 QTest::newRow("CategoryAxis") << imports_2_1() + "CategoryAxis{}";
171 180 }
172 181
173 182 void tst_qml::checkPlugin()
174 183 {
175 184 QFETCH(QString, source);
176 185 QQmlEngine engine;
177 186 engine.addImportPath(QString::fromLatin1("%1/%2").arg(QCoreApplication::applicationDirPath(), QLatin1String("qml")));
178 187 QQmlComponent component(&engine);
179 188 component.setData(source.toLatin1(), QUrl());
180 189 QVERIFY2(!component.isError(), qPrintable(componentErrors(&component)));
181 190 TRY_COMPARE(component.status(), QQmlComponent::Ready);
182 191 QObject *obj = component.create();
183 192 QVERIFY(obj != 0);
184 193 delete obj;
185 194 }
186 195
187 196 QTEST_MAIN(tst_qml)
188 197
189 198 #include "tst_qml.moc"
190 199
General Comments 0
You need to be logged in to leave comments. Login now