@@ -1,306 +1,315 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
3 | ** Copyright (C) 2015 The Qt Company Ltd | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Charts module. |
|
7 | ** This file is part of the Qt Charts module. | |
8 | ** |
|
8 | ** | |
9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
9 | ** Licensees holding valid commercial license for Qt may use this file in | |
10 | ** accordance with the Qt License Agreement provided with the Software |
|
10 | ** accordance with the Qt License Agreement provided with the Software | |
11 | ** or, alternatively, in accordance with the terms contained in a written |
|
11 | ** or, alternatively, in accordance with the terms contained in a written | |
12 | ** agreement between you and The Qt Company. |
|
12 | ** agreement between you and The Qt Company. | |
13 | ** |
|
13 | ** | |
14 | ** If you have questions regarding the use of this file, please use |
|
14 | ** If you have questions regarding the use of this file, please use | |
15 | ** contact form at http://qt.io |
|
15 | ** contact form at http://qt.io | |
16 | ** |
|
16 | ** | |
17 | ****************************************************************************/ |
|
17 | ****************************************************************************/ | |
18 |
|
18 | |||
19 | #include <private/areachartitem_p.h> |
|
19 | #include <private/areachartitem_p.h> | |
20 | #include <QtCharts/QAreaSeries> |
|
20 | #include <QtCharts/QAreaSeries> | |
21 | #include <private/qareaseries_p.h> |
|
21 | #include <private/qareaseries_p.h> | |
22 | #include <QtCharts/QLineSeries> |
|
22 | #include <QtCharts/QLineSeries> | |
23 | #include <private/chartpresenter_p.h> |
|
23 | #include <private/chartpresenter_p.h> | |
24 | #include <private/abstractdomain_p.h> |
|
24 | #include <private/abstractdomain_p.h> | |
25 | #include <QtGui/QPainter> |
|
25 | #include <QtGui/QPainter> | |
26 | #include <QtWidgets/QGraphicsSceneMouseEvent> |
|
26 | #include <QtWidgets/QGraphicsSceneMouseEvent> | |
27 | #include <QtCore/QDebug> |
|
27 | #include <QtCore/QDebug> | |
28 |
|
28 | |||
29 |
|
29 | |||
30 | QT_CHARTS_BEGIN_NAMESPACE |
|
30 | QT_CHARTS_BEGIN_NAMESPACE | |
31 |
|
31 | |||
32 | AreaChartItem::AreaChartItem(QAreaSeries *areaSeries, QGraphicsItem* item) |
|
32 | AreaChartItem::AreaChartItem(QAreaSeries *areaSeries, QGraphicsItem* item) | |
33 | : ChartItem(areaSeries->d_func(),item), |
|
33 | : ChartItem(areaSeries->d_func(),item), | |
34 | m_series(areaSeries), |
|
34 | m_series(areaSeries), | |
35 | m_upper(0), |
|
35 | m_upper(0), | |
36 | m_lower(0), |
|
36 | m_lower(0), | |
37 | m_pointsVisible(false), |
|
37 | m_pointsVisible(false), | |
38 | m_pointLabelsVisible(false), |
|
38 | m_pointLabelsVisible(false), | |
39 | m_pointLabelsFormat(areaSeries->pointLabelsFormat()), |
|
39 | m_pointLabelsFormat(areaSeries->pointLabelsFormat()), | |
40 | m_pointLabelsFont(areaSeries->pointLabelsFont()), |
|
40 | m_pointLabelsFont(areaSeries->pointLabelsFont()), | |
41 | m_pointLabelsColor(areaSeries->pointLabelsColor()), |
|
41 | m_pointLabelsColor(areaSeries->pointLabelsColor()), | |
|
42 | m_pointLabelsClipping(true), | |||
42 | m_mousePressed(false) |
|
43 | m_mousePressed(false) | |
43 | { |
|
44 | { | |
44 | setAcceptHoverEvents(true); |
|
45 | setAcceptHoverEvents(true); | |
45 | setFlag(QGraphicsItem::ItemIsSelectable, true); |
|
46 | setFlag(QGraphicsItem::ItemIsSelectable, true); | |
46 | setZValue(ChartPresenter::LineChartZValue); |
|
47 | setZValue(ChartPresenter::LineChartZValue); | |
47 | if (m_series->upperSeries()) |
|
48 | if (m_series->upperSeries()) | |
48 | m_upper = new AreaBoundItem(this, m_series->upperSeries()); |
|
49 | m_upper = new AreaBoundItem(this, m_series->upperSeries()); | |
49 | if (m_series->lowerSeries()) |
|
50 | if (m_series->lowerSeries()) | |
50 | m_lower = new AreaBoundItem(this, m_series->lowerSeries()); |
|
51 | m_lower = new AreaBoundItem(this, m_series->lowerSeries()); | |
51 |
|
52 | |||
52 | QObject::connect(m_series->d_func(), SIGNAL(updated()), this, SLOT(handleUpdated())); |
|
53 | QObject::connect(m_series->d_func(), SIGNAL(updated()), this, SLOT(handleUpdated())); | |
53 | QObject::connect(m_series, SIGNAL(visibleChanged()), this, SLOT(handleUpdated())); |
|
54 | QObject::connect(m_series, SIGNAL(visibleChanged()), this, SLOT(handleUpdated())); | |
54 | QObject::connect(m_series, SIGNAL(opacityChanged()), this, SLOT(handleUpdated())); |
|
55 | QObject::connect(m_series, SIGNAL(opacityChanged()), this, SLOT(handleUpdated())); | |
55 | QObject::connect(this, SIGNAL(clicked(QPointF)), areaSeries, SIGNAL(clicked(QPointF))); |
|
56 | QObject::connect(this, SIGNAL(clicked(QPointF)), areaSeries, SIGNAL(clicked(QPointF))); | |
56 | QObject::connect(this, SIGNAL(hovered(QPointF,bool)), areaSeries, SIGNAL(hovered(QPointF,bool))); |
|
57 | QObject::connect(this, SIGNAL(hovered(QPointF,bool)), areaSeries, SIGNAL(hovered(QPointF,bool))); | |
57 | QObject::connect(this, SIGNAL(pressed(QPointF)), areaSeries, SIGNAL(pressed(QPointF))); |
|
58 | QObject::connect(this, SIGNAL(pressed(QPointF)), areaSeries, SIGNAL(pressed(QPointF))); | |
58 | QObject::connect(this, SIGNAL(released(QPointF)), areaSeries, SIGNAL(released(QPointF))); |
|
59 | QObject::connect(this, SIGNAL(released(QPointF)), areaSeries, SIGNAL(released(QPointF))); | |
59 | QObject::connect(this, SIGNAL(doubleClicked(QPointF)), |
|
60 | QObject::connect(this, SIGNAL(doubleClicked(QPointF)), | |
60 | areaSeries, SIGNAL(doubleClicked(QPointF))); |
|
61 | areaSeries, SIGNAL(doubleClicked(QPointF))); | |
61 | QObject::connect(areaSeries, SIGNAL(pointLabelsFormatChanged(QString)), |
|
62 | QObject::connect(areaSeries, SIGNAL(pointLabelsFormatChanged(QString)), | |
62 | this, SLOT(handleUpdated())); |
|
63 | this, SLOT(handleUpdated())); | |
63 | QObject::connect(areaSeries, SIGNAL(pointLabelsVisibilityChanged(bool)), |
|
64 | QObject::connect(areaSeries, SIGNAL(pointLabelsVisibilityChanged(bool)), | |
64 | this, SLOT(handleUpdated())); |
|
65 | this, SLOT(handleUpdated())); | |
65 | QObject::connect(areaSeries, SIGNAL(pointLabelsFontChanged(QFont)), |
|
66 | QObject::connect(areaSeries, SIGNAL(pointLabelsFontChanged(QFont)), | |
66 | this, SLOT(handleUpdated())); |
|
67 | this, SLOT(handleUpdated())); | |
67 | QObject::connect(areaSeries, SIGNAL(pointLabelsColorChanged(QColor)), |
|
68 | QObject::connect(areaSeries, SIGNAL(pointLabelsColorChanged(QColor)), | |
68 | this, SLOT(handleUpdated())); |
|
69 | this, SLOT(handleUpdated())); | |
|
70 | QObject::connect(areaSeries, SIGNAL(pointLabelsClippingChanged(bool)), | |||
|
71 | this, SLOT(handleUpdated())); | |||
69 |
|
72 | |||
70 | handleUpdated(); |
|
73 | handleUpdated(); | |
71 | } |
|
74 | } | |
72 |
|
75 | |||
73 | AreaChartItem::~AreaChartItem() |
|
76 | AreaChartItem::~AreaChartItem() | |
74 | { |
|
77 | { | |
75 | delete m_upper; |
|
78 | delete m_upper; | |
76 | delete m_lower; |
|
79 | delete m_lower; | |
77 | } |
|
80 | } | |
78 |
|
81 | |||
79 | void AreaChartItem::setPresenter(ChartPresenter *presenter) |
|
82 | void AreaChartItem::setPresenter(ChartPresenter *presenter) | |
80 | { |
|
83 | { | |
81 | if (m_upper) |
|
84 | if (m_upper) | |
82 | m_upper->setPresenter(presenter); |
|
85 | m_upper->setPresenter(presenter); | |
83 | if (m_lower) { |
|
86 | if (m_lower) { | |
84 | m_lower->setPresenter(presenter); |
|
87 | m_lower->setPresenter(presenter); | |
85 | } |
|
88 | } | |
86 | ChartItem::setPresenter(presenter); |
|
89 | ChartItem::setPresenter(presenter); | |
87 | } |
|
90 | } | |
88 |
|
91 | |||
89 | QRectF AreaChartItem::boundingRect() const |
|
92 | QRectF AreaChartItem::boundingRect() const | |
90 | { |
|
93 | { | |
91 | return m_rect; |
|
94 | return m_rect; | |
92 | } |
|
95 | } | |
93 |
|
96 | |||
94 | QPainterPath AreaChartItem::shape() const |
|
97 | QPainterPath AreaChartItem::shape() const | |
95 | { |
|
98 | { | |
96 | return m_path; |
|
99 | return m_path; | |
97 | } |
|
100 | } | |
98 |
|
101 | |||
99 | void AreaChartItem::updatePath() |
|
102 | void AreaChartItem::updatePath() | |
100 | { |
|
103 | { | |
101 | QPainterPath path; |
|
104 | QPainterPath path; | |
102 | QRectF rect(QPointF(0,0),domain()->size()); |
|
105 | QRectF rect(QPointF(0,0),domain()->size()); | |
103 |
|
106 | |||
104 | path = m_upper->path(); |
|
107 | path = m_upper->path(); | |
105 |
|
108 | |||
106 | if (m_lower) { |
|
109 | if (m_lower) { | |
107 | // Note: Polarcharts always draw area correctly only when both series have equal width or are |
|
110 | // Note: Polarcharts always draw area correctly only when both series have equal width or are | |
108 | // fully displayed. If one series is partally off-chart, the connecting line between |
|
111 | // fully displayed. If one series is partally off-chart, the connecting line between | |
109 | // the series does not attach to the end of the partially hidden series but to the point |
|
112 | // the series does not attach to the end of the partially hidden series but to the point | |
110 | // where it intersects the axis line. The problem is especially noticeable when one of the series |
|
113 | // where it intersects the axis line. The problem is especially noticeable when one of the series | |
111 | // is entirely off-chart, in which case the connecting line connects two ends of the |
|
114 | // is entirely off-chart, in which case the connecting line connects two ends of the | |
112 | // visible series. |
|
115 | // visible series. | |
113 | // This happens because we get the paths from linechart, which omits off-chart segments. |
|
116 | // This happens because we get the paths from linechart, which omits off-chart segments. | |
114 | // To properly fix, linechart would need to provide true full path, in right, left, and the rest |
|
117 | // To properly fix, linechart would need to provide true full path, in right, left, and the rest | |
115 | // portions to enable proper clipping. However, combining those to single visually unified area |
|
118 | // portions to enable proper clipping. However, combining those to single visually unified area | |
116 | // would be a nightmare, since they would have to be painted separately. |
|
119 | // would be a nightmare, since they would have to be painted separately. | |
117 | path.connectPath(m_lower->path().toReversed()); |
|
120 | path.connectPath(m_lower->path().toReversed()); | |
118 | } else { |
|
121 | } else { | |
119 | QPointF first = path.pointAtPercent(0); |
|
122 | QPointF first = path.pointAtPercent(0); | |
120 | QPointF last = path.pointAtPercent(1); |
|
123 | QPointF last = path.pointAtPercent(1); | |
121 | if (presenter()->chartType() == QChart::ChartTypeCartesian) { |
|
124 | if (presenter()->chartType() == QChart::ChartTypeCartesian) { | |
122 | path.lineTo(last.x(), rect.bottom()); |
|
125 | path.lineTo(last.x(), rect.bottom()); | |
123 | path.lineTo(first.x(), rect.bottom()); |
|
126 | path.lineTo(first.x(), rect.bottom()); | |
124 | } else { // polar |
|
127 | } else { // polar | |
125 | path.lineTo(rect.center()); |
|
128 | path.lineTo(rect.center()); | |
126 | } |
|
129 | } | |
127 | } |
|
130 | } | |
128 | path.closeSubpath(); |
|
131 | path.closeSubpath(); | |
129 |
|
132 | |||
130 | // Only zoom in if the bounding rect of the path fits inside int limits. QWidget::update() uses |
|
133 | // Only zoom in if the bounding rect of the path fits inside int limits. QWidget::update() uses | |
131 | // a region that has to be compatible with QRect. |
|
134 | // a region that has to be compatible with QRect. | |
132 | if (path.boundingRect().height() <= INT_MAX |
|
135 | if (path.boundingRect().height() <= INT_MAX | |
133 | && path.boundingRect().width() <= INT_MAX) { |
|
136 | && path.boundingRect().width() <= INT_MAX) { | |
134 | prepareGeometryChange(); |
|
137 | prepareGeometryChange(); | |
135 | m_path = path; |
|
138 | m_path = path; | |
136 | m_rect = path.boundingRect(); |
|
139 | m_rect = path.boundingRect(); | |
137 | update(); |
|
140 | update(); | |
138 | } |
|
141 | } | |
139 | } |
|
142 | } | |
140 |
|
143 | |||
141 | void AreaChartItem::handleUpdated() |
|
144 | void AreaChartItem::handleUpdated() | |
142 | { |
|
145 | { | |
143 | setVisible(m_series->isVisible()); |
|
146 | setVisible(m_series->isVisible()); | |
144 | m_pointsVisible = m_series->pointsVisible(); |
|
147 | m_pointsVisible = m_series->pointsVisible(); | |
145 | m_linePen = m_series->pen(); |
|
148 | m_linePen = m_series->pen(); | |
146 | m_brush = m_series->brush(); |
|
149 | m_brush = m_series->brush(); | |
147 | m_pointPen = m_series->pen(); |
|
150 | m_pointPen = m_series->pen(); | |
148 | m_pointPen.setWidthF(2 * m_pointPen.width()); |
|
151 | m_pointPen.setWidthF(2 * m_pointPen.width()); | |
149 | setOpacity(m_series->opacity()); |
|
152 | setOpacity(m_series->opacity()); | |
150 | m_pointLabelsFormat = m_series->pointLabelsFormat(); |
|
153 | m_pointLabelsFormat = m_series->pointLabelsFormat(); | |
151 | m_pointLabelsVisible = m_series->pointLabelsVisible(); |
|
154 | m_pointLabelsVisible = m_series->pointLabelsVisible(); | |
152 | m_pointLabelsFont = m_series->pointLabelsFont(); |
|
155 | m_pointLabelsFont = m_series->pointLabelsFont(); | |
153 | m_pointLabelsColor = m_series->pointLabelsColor(); |
|
156 | m_pointLabelsColor = m_series->pointLabelsColor(); | |
|
157 | m_pointLabelsClipping = m_series->pointLabelsClipping(); | |||
154 | update(); |
|
158 | update(); | |
155 | } |
|
159 | } | |
156 |
|
160 | |||
157 | void AreaChartItem::handleDomainUpdated() |
|
161 | void AreaChartItem::handleDomainUpdated() | |
158 | { |
|
162 | { | |
159 | if (m_upper) { |
|
163 | if (m_upper) { | |
160 | AbstractDomain* d = m_upper->domain(); |
|
164 | AbstractDomain* d = m_upper->domain(); | |
161 | d->setSize(domain()->size()); |
|
165 | d->setSize(domain()->size()); | |
162 | d->setRange(domain()->minX(),domain()->maxX(),domain()->minY(),domain()->maxY()); |
|
166 | d->setRange(domain()->minX(),domain()->maxX(),domain()->minY(),domain()->maxY()); | |
163 | m_upper->handleDomainUpdated(); |
|
167 | m_upper->handleDomainUpdated(); | |
164 | } |
|
168 | } | |
165 |
|
169 | |||
166 | if (m_lower) { |
|
170 | if (m_lower) { | |
167 | AbstractDomain* d = m_lower->domain(); |
|
171 | AbstractDomain* d = m_lower->domain(); | |
168 | d->setSize(domain()->size()); |
|
172 | d->setSize(domain()->size()); | |
169 | d->setRange(domain()->minX(),domain()->maxX(),domain()->minY(),domain()->maxY()); |
|
173 | d->setRange(domain()->minX(),domain()->maxX(),domain()->minY(),domain()->maxY()); | |
170 | m_lower->handleDomainUpdated(); |
|
174 | m_lower->handleDomainUpdated(); | |
171 | } |
|
175 | } | |
172 | } |
|
176 | } | |
173 |
|
177 | |||
174 | void AreaChartItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) |
|
178 | void AreaChartItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) | |
175 | { |
|
179 | { | |
176 | Q_UNUSED(widget) |
|
180 | Q_UNUSED(widget) | |
177 | Q_UNUSED(option) |
|
181 | Q_UNUSED(option) | |
178 | painter->save(); |
|
182 | painter->save(); | |
179 | painter->setPen(m_linePen); |
|
183 | painter->setPen(m_linePen); | |
180 | painter->setBrush(m_brush); |
|
184 | painter->setBrush(m_brush); | |
181 | QRectF clipRect = QRectF(QPointF(0, 0), domain()->size()); |
|
185 | QRectF clipRect = QRectF(QPointF(0, 0), domain()->size()); | |
182 | if (presenter()->chartType() == QChart::ChartTypePolar) |
|
186 | if (presenter()->chartType() == QChart::ChartTypePolar) | |
183 | painter->setClipRegion(QRegion(clipRect.toRect(), QRegion::Ellipse)); |
|
187 | painter->setClipRegion(QRegion(clipRect.toRect(), QRegion::Ellipse)); | |
184 | else |
|
188 | else | |
185 | painter->setClipRect(clipRect); |
|
189 | painter->setClipRect(clipRect); | |
186 |
|
190 | |||
187 | reversePainter(painter, clipRect); |
|
191 | reversePainter(painter, clipRect); | |
188 |
|
192 | |||
189 | painter->drawPath(m_path); |
|
193 | painter->drawPath(m_path); | |
190 | if (m_pointsVisible) { |
|
194 | if (m_pointsVisible) { | |
191 | painter->setPen(m_pointPen); |
|
195 | painter->setPen(m_pointPen); | |
192 | painter->drawPoints(m_upper->geometryPoints()); |
|
196 | painter->drawPoints(m_upper->geometryPoints()); | |
193 | if (m_lower) |
|
197 | if (m_lower) | |
194 | painter->drawPoints(m_lower->geometryPoints()); |
|
198 | painter->drawPoints(m_lower->geometryPoints()); | |
195 | } |
|
199 | } | |
196 |
|
200 | |||
197 | reversePainter(painter, clipRect); |
|
201 | reversePainter(painter, clipRect); | |
198 |
|
202 | |||
199 | // Draw series point label |
|
203 | // Draw series point label | |
200 | if (m_pointLabelsVisible) { |
|
204 | if (m_pointLabelsVisible) { | |
201 | static const QString xPointTag(QLatin1String("@xPoint")); |
|
205 | static const QString xPointTag(QLatin1String("@xPoint")); | |
202 | static const QString yPointTag(QLatin1String("@yPoint")); |
|
206 | static const QString yPointTag(QLatin1String("@yPoint")); | |
203 | const int labelOffset = 2; |
|
207 | const int labelOffset = 2; | |
204 |
|
208 | |||
|
209 | if (m_pointLabelsClipping) | |||
|
210 | painter->setClipping(true); | |||
|
211 | else | |||
|
212 | painter->setClipping(false); | |||
|
213 | ||||
205 | painter->setFont(m_pointLabelsFont); |
|
214 | painter->setFont(m_pointLabelsFont); | |
206 | painter->setPen(QPen(m_pointLabelsColor)); |
|
215 | painter->setPen(QPen(m_pointLabelsColor)); | |
207 | QFontMetrics fm(painter->font()); |
|
216 | QFontMetrics fm(painter->font()); | |
208 |
|
217 | |||
209 | QString pointLabel; |
|
218 | QString pointLabel; | |
210 |
|
219 | |||
211 | if (m_series->upperSeries()) { |
|
220 | if (m_series->upperSeries()) { | |
212 | for (int i(0); i < m_series->upperSeries()->count(); i++) { |
|
221 | for (int i(0); i < m_series->upperSeries()->count(); i++) { | |
213 | pointLabel = m_pointLabelsFormat; |
|
222 | pointLabel = m_pointLabelsFormat; | |
214 | pointLabel.replace(xPointTag, |
|
223 | pointLabel.replace(xPointTag, | |
215 | presenter()->numberToString(m_series->upperSeries()->at(i).x())); |
|
224 | presenter()->numberToString(m_series->upperSeries()->at(i).x())); | |
216 | pointLabel.replace(yPointTag, |
|
225 | pointLabel.replace(yPointTag, | |
217 | presenter()->numberToString(m_series->upperSeries()->at(i).y())); |
|
226 | presenter()->numberToString(m_series->upperSeries()->at(i).y())); | |
218 |
|
227 | |||
219 | // Position text in relation to the point |
|
228 | // Position text in relation to the point | |
220 | int pointLabelWidth = fm.width(pointLabel); |
|
229 | int pointLabelWidth = fm.width(pointLabel); | |
221 | QPointF position(m_upper->geometryPoints().at(i)); |
|
230 | QPointF position(m_upper->geometryPoints().at(i)); | |
222 | if (!seriesPrivate()->reverseXAxis()) |
|
231 | if (!seriesPrivate()->reverseXAxis()) | |
223 | position.setX(position.x() - pointLabelWidth / 2); |
|
232 | position.setX(position.x() - pointLabelWidth / 2); | |
224 | else |
|
233 | else | |
225 | position.setX(domain()->size().width() - position.x() - pointLabelWidth / 2); |
|
234 | position.setX(domain()->size().width() - position.x() - pointLabelWidth / 2); | |
226 | if (!seriesPrivate()->reverseYAxis()) { |
|
235 | if (!seriesPrivate()->reverseYAxis()) { | |
227 | position.setY(position.y() - m_series->upperSeries()->pen().width() / 2 |
|
236 | position.setY(position.y() - m_series->upperSeries()->pen().width() / 2 | |
228 | - labelOffset); |
|
237 | - labelOffset); | |
229 | } else { |
|
238 | } else { | |
230 | position.setY(domain()->size().height() - position.y() |
|
239 | position.setY(domain()->size().height() - position.y() | |
231 | - m_series->upperSeries()->pen().width() / 2 - labelOffset); |
|
240 | - m_series->upperSeries()->pen().width() / 2 - labelOffset); | |
232 | } |
|
241 | } | |
233 | painter->drawText(position, pointLabel); |
|
242 | painter->drawText(position, pointLabel); | |
234 | } |
|
243 | } | |
235 | } |
|
244 | } | |
236 |
|
245 | |||
237 | if (m_series->lowerSeries()) { |
|
246 | if (m_series->lowerSeries()) { | |
238 | for (int i(0); i < m_series->lowerSeries()->count(); i++) { |
|
247 | for (int i(0); i < m_series->lowerSeries()->count(); i++) { | |
239 | pointLabel = m_pointLabelsFormat; |
|
248 | pointLabel = m_pointLabelsFormat; | |
240 | pointLabel.replace(xPointTag, |
|
249 | pointLabel.replace(xPointTag, | |
241 | presenter()->numberToString(m_series->lowerSeries()->at(i).x())); |
|
250 | presenter()->numberToString(m_series->lowerSeries()->at(i).x())); | |
242 | pointLabel.replace(yPointTag, |
|
251 | pointLabel.replace(yPointTag, | |
243 | presenter()->numberToString(m_series->lowerSeries()->at(i).y())); |
|
252 | presenter()->numberToString(m_series->lowerSeries()->at(i).y())); | |
244 |
|
253 | |||
245 | // Position text in relation to the point |
|
254 | // Position text in relation to the point | |
246 | int pointLabelWidth = fm.width(pointLabel); |
|
255 | int pointLabelWidth = fm.width(pointLabel); | |
247 | QPointF position(m_lower->geometryPoints().at(i)); |
|
256 | QPointF position(m_lower->geometryPoints().at(i)); | |
248 | if (!seriesPrivate()->reverseXAxis()) |
|
257 | if (!seriesPrivate()->reverseXAxis()) | |
249 | position.setX(position.x() - pointLabelWidth / 2); |
|
258 | position.setX(position.x() - pointLabelWidth / 2); | |
250 | else |
|
259 | else | |
251 | position.setX(domain()->size().width() - position.x() - pointLabelWidth / 2); |
|
260 | position.setX(domain()->size().width() - position.x() - pointLabelWidth / 2); | |
252 | if (!seriesPrivate()->reverseYAxis()) { |
|
261 | if (!seriesPrivate()->reverseYAxis()) { | |
253 | position.setY(position.y() - m_series->lowerSeries()->pen().width() / 2 |
|
262 | position.setY(position.y() - m_series->lowerSeries()->pen().width() / 2 | |
254 | - labelOffset); |
|
263 | - labelOffset); | |
255 | } else { |
|
264 | } else { | |
256 | position.setY(domain()->size().height() - position.y() |
|
265 | position.setY(domain()->size().height() - position.y() | |
257 | - m_series->lowerSeries()->pen().width() / 2 - labelOffset); |
|
266 | - m_series->lowerSeries()->pen().width() / 2 - labelOffset); | |
258 | } |
|
267 | } | |
259 | painter->drawText(position, pointLabel); |
|
268 | painter->drawText(position, pointLabel); | |
260 | } |
|
269 | } | |
261 | } |
|
270 | } | |
262 | } |
|
271 | } | |
263 |
|
272 | |||
264 | painter->restore(); |
|
273 | painter->restore(); | |
265 | } |
|
274 | } | |
266 |
|
275 | |||
267 | void AreaChartItem::mousePressEvent(QGraphicsSceneMouseEvent *event) |
|
276 | void AreaChartItem::mousePressEvent(QGraphicsSceneMouseEvent *event) | |
268 | { |
|
277 | { | |
269 | emit pressed(m_upper->domain()->calculateDomainPoint(event->pos())); |
|
278 | emit pressed(m_upper->domain()->calculateDomainPoint(event->pos())); | |
270 | m_lastMousePos = event->pos(); |
|
279 | m_lastMousePos = event->pos(); | |
271 | m_mousePressed = true; |
|
280 | m_mousePressed = true; | |
272 | ChartItem::mousePressEvent(event); |
|
281 | ChartItem::mousePressEvent(event); | |
273 | } |
|
282 | } | |
274 |
|
283 | |||
275 | void AreaChartItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event) |
|
284 | void AreaChartItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event) | |
276 | { |
|
285 | { | |
277 | emit hovered(domain()->calculateDomainPoint(event->pos()), true); |
|
286 | emit hovered(domain()->calculateDomainPoint(event->pos()), true); | |
278 | event->accept(); |
|
287 | event->accept(); | |
279 | // QGraphicsItem::hoverEnterEvent(event); |
|
288 | // QGraphicsItem::hoverEnterEvent(event); | |
280 | } |
|
289 | } | |
281 |
|
290 | |||
282 | void AreaChartItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) |
|
291 | void AreaChartItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) | |
283 | { |
|
292 | { | |
284 | emit hovered(domain()->calculateDomainPoint(event->pos()), false); |
|
293 | emit hovered(domain()->calculateDomainPoint(event->pos()), false); | |
285 | event->accept(); |
|
294 | event->accept(); | |
286 | // QGraphicsItem::hoverEnterEvent(event); |
|
295 | // QGraphicsItem::hoverEnterEvent(event); | |
287 | } |
|
296 | } | |
288 |
|
297 | |||
289 | void AreaChartItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) |
|
298 | void AreaChartItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) | |
290 | { |
|
299 | { | |
291 | emit released(m_upper->domain()->calculateDomainPoint(m_lastMousePos)); |
|
300 | emit released(m_upper->domain()->calculateDomainPoint(m_lastMousePos)); | |
292 | if (m_mousePressed) |
|
301 | if (m_mousePressed) | |
293 | emit clicked(m_upper->domain()->calculateDomainPoint(m_lastMousePos)); |
|
302 | emit clicked(m_upper->domain()->calculateDomainPoint(m_lastMousePos)); | |
294 | m_mousePressed = false; |
|
303 | m_mousePressed = false; | |
295 | ChartItem::mouseReleaseEvent(event); |
|
304 | ChartItem::mouseReleaseEvent(event); | |
296 | } |
|
305 | } | |
297 |
|
306 | |||
298 | void AreaChartItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) |
|
307 | void AreaChartItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) | |
299 | { |
|
308 | { | |
300 | emit doubleClicked(m_upper->domain()->calculateDomainPoint(m_lastMousePos)); |
|
309 | emit doubleClicked(m_upper->domain()->calculateDomainPoint(m_lastMousePos)); | |
301 | ChartItem::mouseDoubleClickEvent(event); |
|
310 | ChartItem::mouseDoubleClickEvent(event); | |
302 | } |
|
311 | } | |
303 |
|
312 | |||
304 | #include "moc_areachartitem_p.cpp" |
|
313 | #include "moc_areachartitem_p.cpp" | |
305 |
|
314 | |||
306 | QT_CHARTS_END_NAMESPACE |
|
315 | QT_CHARTS_END_NAMESPACE |
@@ -1,132 +1,133 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
3 | ** Copyright (C) 2015 The Qt Company Ltd | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Charts module. |
|
7 | ** This file is part of the Qt Charts module. | |
8 | ** |
|
8 | ** | |
9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
9 | ** Licensees holding valid commercial license for Qt may use this file in | |
10 | ** accordance with the Qt License Agreement provided with the Software |
|
10 | ** accordance with the Qt License Agreement provided with the Software | |
11 | ** or, alternatively, in accordance with the terms contained in a written |
|
11 | ** or, alternatively, in accordance with the terms contained in a written | |
12 | ** agreement between you and The Qt Company. |
|
12 | ** agreement between you and The Qt Company. | |
13 | ** |
|
13 | ** | |
14 | ** If you have questions regarding the use of this file, please use |
|
14 | ** If you have questions regarding the use of this file, please use | |
15 | ** contact form at http://qt.io |
|
15 | ** contact form at http://qt.io | |
16 | ** |
|
16 | ** | |
17 | ****************************************************************************/ |
|
17 | ****************************************************************************/ | |
18 |
|
18 | |||
19 | // W A R N I N G |
|
19 | // W A R N I N G | |
20 | // ------------- |
|
20 | // ------------- | |
21 | // |
|
21 | // | |
22 | // This file is not part of the Qt Chart API. It exists purely as an |
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
23 | // implementation detail. This header file may change from version to |
|
23 | // implementation detail. This header file may change from version to | |
24 | // version without notice, or even be removed. |
|
24 | // version without notice, or even be removed. | |
25 | // |
|
25 | // | |
26 | // We mean it. |
|
26 | // We mean it. | |
27 |
|
27 | |||
28 | #ifndef AREACHARTITEM_H |
|
28 | #ifndef AREACHARTITEM_H | |
29 | #define AREACHARTITEM_H |
|
29 | #define AREACHARTITEM_H | |
30 |
|
30 | |||
31 | #include <QtCharts/QChartGlobal> |
|
31 | #include <QtCharts/QChartGlobal> | |
32 | #include <private/linechartitem_p.h> |
|
32 | #include <private/linechartitem_p.h> | |
33 | #include <QtCharts/QAreaSeries> |
|
33 | #include <QtCharts/QAreaSeries> | |
34 | #include <QtGui/QPen> |
|
34 | #include <QtGui/QPen> | |
35 |
|
35 | |||
36 | QT_CHARTS_BEGIN_NAMESPACE |
|
36 | QT_CHARTS_BEGIN_NAMESPACE | |
37 |
|
37 | |||
38 | class AreaChartItem; |
|
38 | class AreaChartItem; | |
39 |
|
39 | |||
40 | class AreaChartItem : public ChartItem |
|
40 | class AreaChartItem : public ChartItem | |
41 | { |
|
41 | { | |
42 | Q_OBJECT |
|
42 | Q_OBJECT | |
43 | public: |
|
43 | public: | |
44 | AreaChartItem(QAreaSeries *areaSeries, QGraphicsItem* item = 0); |
|
44 | AreaChartItem(QAreaSeries *areaSeries, QGraphicsItem* item = 0); | |
45 | ~AreaChartItem(); |
|
45 | ~AreaChartItem(); | |
46 |
|
46 | |||
47 | //from QGraphicsItem |
|
47 | //from QGraphicsItem | |
48 | QRectF boundingRect() const; |
|
48 | QRectF boundingRect() const; | |
49 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); |
|
49 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); | |
50 | QPainterPath shape() const; |
|
50 | QPainterPath shape() const; | |
51 |
|
51 | |||
52 | LineChartItem *upperLineItem() const { return m_upper; } |
|
52 | LineChartItem *upperLineItem() const { return m_upper; } | |
53 | LineChartItem *lowerLineItem() const { return m_lower; } |
|
53 | LineChartItem *lowerLineItem() const { return m_lower; } | |
54 |
|
54 | |||
55 | void updatePath(); |
|
55 | void updatePath(); | |
56 |
|
56 | |||
57 | void setPresenter(ChartPresenter *presenter); |
|
57 | void setPresenter(ChartPresenter *presenter); | |
58 | QAreaSeries *series() const { return m_series; } |
|
58 | QAreaSeries *series() const { return m_series; } | |
59 |
|
59 | |||
60 | protected: |
|
60 | protected: | |
61 | void mousePressEvent(QGraphicsSceneMouseEvent *event); |
|
61 | void mousePressEvent(QGraphicsSceneMouseEvent *event); | |
62 | void hoverEnterEvent(QGraphicsSceneHoverEvent *event); |
|
62 | void hoverEnterEvent(QGraphicsSceneHoverEvent *event); | |
63 | void hoverLeaveEvent(QGraphicsSceneHoverEvent *event); |
|
63 | void hoverLeaveEvent(QGraphicsSceneHoverEvent *event); | |
64 | void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); |
|
64 | void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); | |
65 | void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event); |
|
65 | void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event); | |
66 |
|
66 | |||
67 | Q_SIGNALS: |
|
67 | Q_SIGNALS: | |
68 | void clicked(const QPointF &point); |
|
68 | void clicked(const QPointF &point); | |
69 | void hovered(const QPointF &point, bool state); |
|
69 | void hovered(const QPointF &point, bool state); | |
70 | void pressed(const QPointF &point); |
|
70 | void pressed(const QPointF &point); | |
71 | void released(const QPointF &point); |
|
71 | void released(const QPointF &point); | |
72 | void doubleClicked(const QPointF &point); |
|
72 | void doubleClicked(const QPointF &point); | |
73 |
|
73 | |||
74 | public Q_SLOTS: |
|
74 | public Q_SLOTS: | |
75 | void handleUpdated(); |
|
75 | void handleUpdated(); | |
76 | void handleDomainUpdated(); |
|
76 | void handleDomainUpdated(); | |
77 |
|
77 | |||
78 | private: |
|
78 | private: | |
79 | QAreaSeries *m_series; |
|
79 | QAreaSeries *m_series; | |
80 | LineChartItem *m_upper; |
|
80 | LineChartItem *m_upper; | |
81 | LineChartItem *m_lower; |
|
81 | LineChartItem *m_lower; | |
82 | QPainterPath m_path; |
|
82 | QPainterPath m_path; | |
83 | QRectF m_rect; |
|
83 | QRectF m_rect; | |
84 | QPen m_linePen; |
|
84 | QPen m_linePen; | |
85 | QPen m_pointPen; |
|
85 | QPen m_pointPen; | |
86 | QBrush m_brush; |
|
86 | QBrush m_brush; | |
87 | bool m_pointsVisible; |
|
87 | bool m_pointsVisible; | |
88 |
|
88 | |||
89 | bool m_pointLabelsVisible; |
|
89 | bool m_pointLabelsVisible; | |
90 | QString m_pointLabelsFormat; |
|
90 | QString m_pointLabelsFormat; | |
91 | QFont m_pointLabelsFont; |
|
91 | QFont m_pointLabelsFont; | |
92 | QColor m_pointLabelsColor; |
|
92 | QColor m_pointLabelsColor; | |
|
93 | bool m_pointLabelsClipping; | |||
93 |
|
94 | |||
94 | QPointF m_lastMousePos; |
|
95 | QPointF m_lastMousePos; | |
95 | bool m_mousePressed; |
|
96 | bool m_mousePressed; | |
96 |
|
97 | |||
97 | }; |
|
98 | }; | |
98 |
|
99 | |||
99 | class AreaBoundItem : public LineChartItem |
|
100 | class AreaBoundItem : public LineChartItem | |
100 | { |
|
101 | { | |
101 | public: |
|
102 | public: | |
102 | AreaBoundItem(AreaChartItem *area, QLineSeries *lineSeries,QGraphicsItem* item = 0) |
|
103 | AreaBoundItem(AreaChartItem *area, QLineSeries *lineSeries,QGraphicsItem* item = 0) | |
103 | : LineChartItem(lineSeries, item), m_item(area) |
|
104 | : LineChartItem(lineSeries, item), m_item(area) | |
104 | { |
|
105 | { | |
105 | // We do not actually want to draw anything from LineChartItem. |
|
106 | // We do not actually want to draw anything from LineChartItem. | |
106 | // Drawing is done in AreaChartItem only. |
|
107 | // Drawing is done in AreaChartItem only. | |
107 | setVisible(false); |
|
108 | setVisible(false); | |
108 | } |
|
109 | } | |
109 | ~AreaBoundItem() {} |
|
110 | ~AreaBoundItem() {} | |
110 |
|
111 | |||
111 | void updateGeometry() |
|
112 | void updateGeometry() | |
112 | { |
|
113 | { | |
113 | // Make sure the series is in a chart before trying to update |
|
114 | // Make sure the series is in a chart before trying to update | |
114 | if (m_item->series()->chart()) { |
|
115 | if (m_item->series()->chart()) { | |
115 | // Turn off points drawing from component line chart item, as that |
|
116 | // Turn off points drawing from component line chart item, as that | |
116 | // messes up the fill for area series. |
|
117 | // messes up the fill for area series. | |
117 | suppressPoints(); |
|
118 | suppressPoints(); | |
118 | // Component lineseries are not necessarily themselves on the chart, |
|
119 | // Component lineseries are not necessarily themselves on the chart, | |
119 | // so get the chart type for them from area chart. |
|
120 | // so get the chart type for them from area chart. | |
120 | forceChartType(m_item->series()->chart()->chartType()); |
|
121 | forceChartType(m_item->series()->chart()->chartType()); | |
121 | LineChartItem::updateGeometry(); |
|
122 | LineChartItem::updateGeometry(); | |
122 | m_item->updatePath(); |
|
123 | m_item->updatePath(); | |
123 | } |
|
124 | } | |
124 | } |
|
125 | } | |
125 |
|
126 | |||
126 | private: |
|
127 | private: | |
127 | AreaChartItem *m_item; |
|
128 | AreaChartItem *m_item; | |
128 | }; |
|
129 | }; | |
129 |
|
130 | |||
130 | QT_CHARTS_END_NAMESPACE |
|
131 | QT_CHARTS_END_NAMESPACE | |
131 |
|
132 | |||
132 | #endif |
|
133 | #endif |
@@ -1,703 +1,742 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
3 | ** Copyright (C) 2015 The Qt Company Ltd | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Charts module. |
|
7 | ** This file is part of the Qt Charts module. | |
8 | ** |
|
8 | ** | |
9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
9 | ** Licensees holding valid commercial license for Qt may use this file in | |
10 | ** accordance with the Qt License Agreement provided with the Software |
|
10 | ** accordance with the Qt License Agreement provided with the Software | |
11 | ** or, alternatively, in accordance with the terms contained in a written |
|
11 | ** or, alternatively, in accordance with the terms contained in a written | |
12 | ** agreement between you and The Qt Company. |
|
12 | ** agreement between you and The Qt Company. | |
13 | ** |
|
13 | ** | |
14 | ** If you have questions regarding the use of this file, please use |
|
14 | ** If you have questions regarding the use of this file, please use | |
15 | ** contact form at http://qt.io |
|
15 | ** contact form at http://qt.io | |
16 | ** |
|
16 | ** | |
17 | ****************************************************************************/ |
|
17 | ****************************************************************************/ | |
18 |
|
18 | |||
19 | #include <QtCharts/QAreaSeries> |
|
19 | #include <QtCharts/QAreaSeries> | |
20 | #include <private/qareaseries_p.h> |
|
20 | #include <private/qareaseries_p.h> | |
21 | #include <QtCharts/QLineSeries> |
|
21 | #include <QtCharts/QLineSeries> | |
22 | #include <private/areachartitem_p.h> |
|
22 | #include <private/areachartitem_p.h> | |
23 | #include <private/abstractdomain_p.h> |
|
23 | #include <private/abstractdomain_p.h> | |
24 | #include <private/chartdataset_p.h> |
|
24 | #include <private/chartdataset_p.h> | |
25 | #include <private/charttheme_p.h> |
|
25 | #include <private/charttheme_p.h> | |
26 | #include <QtCharts/QValueAxis> |
|
26 | #include <QtCharts/QValueAxis> | |
27 | #include <QtCharts/QAreaLegendMarker> |
|
27 | #include <QtCharts/QAreaLegendMarker> | |
28 | #include <private/qchart_p.h> |
|
28 | #include <private/qchart_p.h> | |
29 |
|
29 | |||
30 | QT_CHARTS_BEGIN_NAMESPACE |
|
30 | QT_CHARTS_BEGIN_NAMESPACE | |
31 |
|
31 | |||
32 | /*! |
|
32 | /*! | |
33 | \class QAreaSeries |
|
33 | \class QAreaSeries | |
34 | \inmodule Qt Charts |
|
34 | \inmodule Qt Charts | |
35 | \brief The QAreaSeries class is used for making area charts. |
|
35 | \brief The QAreaSeries class is used for making area charts. | |
36 |
|
36 | |||
37 | An area series is used to show quantitative data. It is based on line series, in the way that |
|
37 | An area series is used to show quantitative data. It is based on line series, in the way that | |
38 | the area between the boundary lines is emphasized with color. Since the area series is based on |
|
38 | the area between the boundary lines is emphasized with color. Since the area series is based on | |
39 | line series, QAreaSeries constructor needs a QLineSeries instance, which defines "upper" |
|
39 | line series, QAreaSeries constructor needs a QLineSeries instance, which defines "upper" | |
40 | boundary of the area. The area chart is drawn using the bottom of the plot area as the "lower" |
|
40 | boundary of the area. The area chart is drawn using the bottom of the plot area as the "lower" | |
41 | boundary by default. Instead of the bottom of the plot area, the "lower" boundary can be |
|
41 | boundary by default. Instead of the bottom of the plot area, the "lower" boundary can be | |
42 | specified by another line. In that case QAreaSeries should be initialized with two QLineSeries |
|
42 | specified by another line. In that case QAreaSeries should be initialized with two QLineSeries | |
43 | instances. Please note that the terms "upper" and "lower" boundary can be misleading in cases |
|
43 | instances. Please note that the terms "upper" and "lower" boundary can be misleading in cases | |
44 | where the "lower" boundary has bigger values than the "upper" one. The main point is that the |
|
44 | where the "lower" boundary has bigger values than the "upper" one. The main point is that the | |
45 | area between these two boundary lines will be filled. |
|
45 | area between these two boundary lines will be filled. | |
46 |
|
46 | |||
47 | See the \l {AreaChart Example} {area chart example} to learn how to create a simple area chart. |
|
47 | See the \l {AreaChart Example} {area chart example} to learn how to create a simple area chart. | |
48 | \image examples_areachart.png |
|
48 | \image examples_areachart.png | |
49 | */ |
|
49 | */ | |
50 |
|
50 | |||
51 | /*! |
|
51 | /*! | |
52 | \qmltype AreaSeries |
|
52 | \qmltype AreaSeries | |
53 | \instantiates QAreaSeries |
|
53 | \instantiates QAreaSeries | |
54 | \inqmlmodule QtCharts |
|
54 | \inqmlmodule QtCharts | |
55 |
|
55 | |||
56 | \inherits AbstractSeries |
|
56 | \inherits AbstractSeries | |
57 |
|
57 | |||
58 | \brief The AreaSeries type is used for making area charts. |
|
58 | \brief The AreaSeries type is used for making area charts. | |
59 |
|
59 | |||
60 | The following QML shows how to create a simple area chart: |
|
60 | The following QML shows how to create a simple area chart: | |
61 | \snippet qmlchart/qml/qmlchart/View4.qml 1 |
|
61 | \snippet qmlchart/qml/qmlchart/View4.qml 1 | |
62 | \beginfloatleft |
|
62 | \beginfloatleft | |
63 | \image examples_qmlchart4.png |
|
63 | \image examples_qmlchart4.png | |
64 | \endfloat |
|
64 | \endfloat | |
65 | \clearfloat |
|
65 | \clearfloat | |
66 |
|
66 | |||
67 | \note Adding the same line series to chart and area series is not supported. The series used as |
|
67 | \note Adding the same line series to chart and area series is not supported. The series used as | |
68 | boundary lines should be defined only for the area series. |
|
68 | boundary lines should be defined only for the area series. | |
69 | */ |
|
69 | */ | |
70 |
|
70 | |||
71 | /*! |
|
71 | /*! | |
72 | \property QAreaSeries::upperSeries |
|
72 | \property QAreaSeries::upperSeries | |
73 | \brief The upper one of the two line series used to define area series boundaries. |
|
73 | \brief The upper one of the two line series used to define area series boundaries. | |
74 | */ |
|
74 | */ | |
75 | /*! |
|
75 | /*! | |
76 | \qmlproperty LineSeries AreaSeries::upperSeries |
|
76 | \qmlproperty LineSeries AreaSeries::upperSeries | |
77 | The upper one of the two line series used to define area series boundaries. |
|
77 | The upper one of the two line series used to define area series boundaries. | |
78 | */ |
|
78 | */ | |
79 |
|
79 | |||
80 | /*! |
|
80 | /*! | |
81 | \property QAreaSeries::lowerSeries |
|
81 | \property QAreaSeries::lowerSeries | |
82 | The lower one of the two line series used to define are series boundaries. Note if |
|
82 | The lower one of the two line series used to define are series boundaries. Note if | |
83 | QAreaSeries was constructed without a\ lowerSeries this is null. |
|
83 | QAreaSeries was constructed without a\ lowerSeries this is null. | |
84 | */ |
|
84 | */ | |
85 | /*! |
|
85 | /*! | |
86 | \qmlproperty LineSeries AreaSeries::lowerSeries |
|
86 | \qmlproperty LineSeries AreaSeries::lowerSeries | |
87 | The lower one of the two line series used to define are series boundaries. Note if |
|
87 | The lower one of the two line series used to define are series boundaries. Note if | |
88 | AreaSeries was constructed without a\ lowerSeries this is null. |
|
88 | AreaSeries was constructed without a\ lowerSeries this is null. | |
89 | */ |
|
89 | */ | |
90 |
|
90 | |||
91 | /*! |
|
91 | /*! | |
92 | \property QAreaSeries::color |
|
92 | \property QAreaSeries::color | |
93 | Fill (brush) color of the series. This is a convenience property for modifying the color of brush. |
|
93 | Fill (brush) color of the series. This is a convenience property for modifying the color of brush. | |
94 | \sa QAreaSeries::brush() |
|
94 | \sa QAreaSeries::brush() | |
95 | */ |
|
95 | */ | |
96 | /*! |
|
96 | /*! | |
97 | \qmlproperty color AreaSeries::color |
|
97 | \qmlproperty color AreaSeries::color | |
98 | Fill (brush) color of the series. |
|
98 | Fill (brush) color of the series. | |
99 | */ |
|
99 | */ | |
100 |
|
100 | |||
101 | /*! |
|
101 | /*! | |
102 | \property QAreaSeries::borderColor |
|
102 | \property QAreaSeries::borderColor | |
103 | Line (pen) color of the series. This is a convenience property for modifying the color of pen. |
|
103 | Line (pen) color of the series. This is a convenience property for modifying the color of pen. | |
104 | \sa QAreaSeries::pen() |
|
104 | \sa QAreaSeries::pen() | |
105 | */ |
|
105 | */ | |
106 | /*! |
|
106 | /*! | |
107 | \qmlproperty color AreaSeries::borderColor |
|
107 | \qmlproperty color AreaSeries::borderColor | |
108 | Line (pen) color of the series. |
|
108 | Line (pen) color of the series. | |
109 | */ |
|
109 | */ | |
110 |
|
110 | |||
111 | /*! |
|
111 | /*! | |
112 | \qmlproperty real AreaSeries::borderWidth |
|
112 | \qmlproperty real AreaSeries::borderWidth | |
113 | The width of the border line. By default the width is 2.0. |
|
113 | The width of the border line. By default the width is 2.0. | |
114 | */ |
|
114 | */ | |
115 |
|
115 | |||
116 | /*! |
|
116 | /*! | |
117 | \fn QPen QAreaSeries::pen() const |
|
117 | \fn QPen QAreaSeries::pen() const | |
118 | \brief Returns the pen used to draw line for this series. |
|
118 | \brief Returns the pen used to draw line for this series. | |
119 | \sa setPen() |
|
119 | \sa setPen() | |
120 | */ |
|
120 | */ | |
121 |
|
121 | |||
122 | /*! |
|
122 | /*! | |
123 | \fn QPen QAreaSeries::brush() const |
|
123 | \fn QPen QAreaSeries::brush() const | |
124 | \brief Returns the brush used to draw line for this series. |
|
124 | \brief Returns the brush used to draw line for this series. | |
125 | \sa setBrush() |
|
125 | \sa setBrush() | |
126 | */ |
|
126 | */ | |
127 |
|
127 | |||
128 | /*! |
|
128 | /*! | |
129 | \qmlproperty QString AreaSeries::brushFilename |
|
129 | \qmlproperty QString AreaSeries::brushFilename | |
130 | The name of the file used as a brush image for the series. |
|
130 | The name of the file used as a brush image for the series. | |
131 | */ |
|
131 | */ | |
132 |
|
132 | |||
133 | /*! |
|
133 | /*! | |
134 | \fn void QAreaSeries::colorChanged(QColor color) |
|
134 | \fn void QAreaSeries::colorChanged(QColor color) | |
135 | \brief Signal is emitted when the fill (brush) color has changed to \a color. |
|
135 | \brief Signal is emitted when the fill (brush) color has changed to \a color. | |
136 | */ |
|
136 | */ | |
137 | /*! |
|
137 | /*! | |
138 | \qmlsignal AreaSeries::onColorChanged(color color) |
|
138 | \qmlsignal AreaSeries::onColorChanged(color color) | |
139 | Signal is emitted when the fill (brush) color has changed to \a color. |
|
139 | Signal is emitted when the fill (brush) color has changed to \a color. | |
140 | */ |
|
140 | */ | |
141 |
|
141 | |||
142 | /*! |
|
142 | /*! | |
143 | \fn void QAreaSeries::borderColorChanged(QColor color) |
|
143 | \fn void QAreaSeries::borderColorChanged(QColor color) | |
144 | \brief Signal is emitted when the line (pen) color has changed to \a color. |
|
144 | \brief Signal is emitted when the line (pen) color has changed to \a color. | |
145 | */ |
|
145 | */ | |
146 | /*! |
|
146 | /*! | |
147 | \qmlsignal AreaSeries::onBorderColorChanged(color color) |
|
147 | \qmlsignal AreaSeries::onBorderColorChanged(color color) | |
148 | Signal is emitted when the line (pen) color has changed to \a color. |
|
148 | Signal is emitted when the line (pen) color has changed to \a color. | |
149 | */ |
|
149 | */ | |
150 |
|
150 | |||
151 | /*! |
|
151 | /*! | |
152 | \fn void QAreaSeries::clicked(const QPointF& point) |
|
152 | \fn void QAreaSeries::clicked(const QPointF& point) | |
153 | \brief Signal is emitted when user clicks the \a point on area chart. The \a point is the point |
|
153 | \brief Signal is emitted when user clicks the \a point on area chart. The \a point is the point | |
154 | where the press was triggered. |
|
154 | where the press was triggered. | |
155 | \sa pressed, released, doubleClicked |
|
155 | \sa pressed, released, doubleClicked | |
156 | */ |
|
156 | */ | |
157 | /*! |
|
157 | /*! | |
158 | \qmlsignal AreaSeries::onClicked(QPointF point) |
|
158 | \qmlsignal AreaSeries::onClicked(QPointF point) | |
159 | Signal is emitted when user clicks the \a point on area chart. The \a point is the point where |
|
159 | Signal is emitted when user clicks the \a point on area chart. The \a point is the point where | |
160 | the press was triggered. |
|
160 | the press was triggered. | |
161 | \sa onPressed, onReleased, onDoubleClicked |
|
161 | \sa onPressed, onReleased, onDoubleClicked | |
162 | */ |
|
162 | */ | |
163 |
|
163 | |||
164 | /*! |
|
164 | /*! | |
165 | \fn void QAreaSeries::hovered(const QPointF &point, bool state) |
|
165 | \fn void QAreaSeries::hovered(const QPointF &point, bool state) | |
166 | This signal is emitted when user has hovered over or away from the series. \a point shows the origin (coordinate) |
|
166 | This signal is emitted when user has hovered over or away from the series. \a point shows the origin (coordinate) | |
167 | of the hover event. \a state is true when user has hovered over the series and false when hover has moved away from |
|
167 | of the hover event. \a state is true when user has hovered over the series and false when hover has moved away from | |
168 | the series. |
|
168 | the series. | |
169 | */ |
|
169 | */ | |
170 | /*! |
|
170 | /*! | |
171 | \qmlsignal AreaSeries::onHovered(point point, bool state) |
|
171 | \qmlsignal AreaSeries::onHovered(point point, bool state) | |
172 | This signal is emitted when user has hovered over or away from the series. \a point shows the origin (coordinate) |
|
172 | This signal is emitted when user has hovered over or away from the series. \a point shows the origin (coordinate) | |
173 | of the hover event. \a state is true when user has hovered over the series and false when hover has moved away from |
|
173 | of the hover event. \a state is true when user has hovered over the series and false when hover has moved away from | |
174 | the series. |
|
174 | the series. | |
175 | */ |
|
175 | */ | |
176 |
|
176 | |||
177 | /*! |
|
177 | /*! | |
178 | \fn void QAreaSeries::pressed(const QPointF& point) |
|
178 | \fn void QAreaSeries::pressed(const QPointF& point) | |
179 | \brief Signal is emitted when user presses the \a point on area chart. |
|
179 | \brief Signal is emitted when user presses the \a point on area chart. | |
180 | \sa clicked, released, doubleClicked |
|
180 | \sa clicked, released, doubleClicked | |
181 | */ |
|
181 | */ | |
182 | /*! |
|
182 | /*! | |
183 | \qmlsignal AreaSeries::onPressed(QPointF point) |
|
183 | \qmlsignal AreaSeries::onPressed(QPointF point) | |
184 | Signal is emitted when user presses the \a point on area chart. |
|
184 | Signal is emitted when user presses the \a point on area chart. | |
185 | \sa onClicked, onReleased, onDoubleClicked |
|
185 | \sa onClicked, onReleased, onDoubleClicked | |
186 | */ |
|
186 | */ | |
187 |
|
187 | |||
188 | /*! |
|
188 | /*! | |
189 | \fn void QAreaSeries::released(const QPointF& point) |
|
189 | \fn void QAreaSeries::released(const QPointF& point) | |
190 | \brief Signal is emitted when user releases a press that was triggered on a \a point on area |
|
190 | \brief Signal is emitted when user releases a press that was triggered on a \a point on area | |
191 | chart. |
|
191 | chart. | |
192 | \sa pressed, clicked, doubleClicked |
|
192 | \sa pressed, clicked, doubleClicked | |
193 | */ |
|
193 | */ | |
194 | /*! |
|
194 | /*! | |
195 | \qmlsignal AreaSeries::onReleased(QPointF point) |
|
195 | \qmlsignal AreaSeries::onReleased(QPointF point) | |
196 | Signal is emitted when user releases a press that was triggered on a \a point on area chart. |
|
196 | Signal is emitted when user releases a press that was triggered on a \a point on area chart. | |
197 | \sa onPressed, onClicked, onDoubleClicked |
|
197 | \sa onPressed, onClicked, onDoubleClicked | |
198 | */ |
|
198 | */ | |
199 |
|
199 | |||
200 | /*! |
|
200 | /*! | |
201 | \fn void QAreaSeries::doubleClicked(const QPointF& point) |
|
201 | \fn void QAreaSeries::doubleClicked(const QPointF& point) | |
202 | \brief Signal is emitted when user doubleclicks the \a point on area chart. The \a point is the |
|
202 | \brief Signal is emitted when user doubleclicks the \a point on area chart. The \a point is the | |
203 | point where the first press was triggered. |
|
203 | point where the first press was triggered. | |
204 | \sa pressed, released, clicked |
|
204 | \sa pressed, released, clicked | |
205 | */ |
|
205 | */ | |
206 | /*! |
|
206 | /*! | |
207 | \qmlsignal AreaSeries::onDoubleClicked(QPointF point) |
|
207 | \qmlsignal AreaSeries::onDoubleClicked(QPointF point) | |
208 | Signal is emitted when user doubleclicks the \a point on area chart. The \a point is the point |
|
208 | Signal is emitted when user doubleclicks the \a point on area chart. The \a point is the point | |
209 | where the first press was triggered. |
|
209 | where the first press was triggered. | |
210 | \sa onPressed, onReleased, onClicked |
|
210 | \sa onPressed, onReleased, onClicked | |
211 | */ |
|
211 | */ | |
212 |
|
212 | |||
213 | /*! |
|
213 | /*! | |
214 | \fn void QAreaSeries::selected() |
|
214 | \fn void QAreaSeries::selected() | |
215 | The signal is emitted if the user selects/deselects the XY series. The logic for maintaining selections should be |
|
215 | The signal is emitted if the user selects/deselects the XY series. The logic for maintaining selections should be | |
216 | implemented by the user of QAreaSeries API. |
|
216 | implemented by the user of QAreaSeries API. | |
217 | */ |
|
217 | */ | |
218 | /*! |
|
218 | /*! | |
219 | \qmlsignal AreaSeries::onSelected() |
|
219 | \qmlsignal AreaSeries::onSelected() | |
220 | The signal is emitted if the user selects/deselects the XY series. The logic for maintaining selections should be |
|
220 | The signal is emitted if the user selects/deselects the XY series. The logic for maintaining selections should be | |
221 | implemented by the user of AreaSeries API. |
|
221 | implemented by the user of AreaSeries API. | |
222 | */ |
|
222 | */ | |
223 |
|
223 | |||
224 | /*! |
|
224 | /*! | |
225 | \fn void QAreaSeriesPrivate::updated() |
|
225 | \fn void QAreaSeriesPrivate::updated() | |
226 | \brief \internal |
|
226 | \brief \internal | |
227 | */ |
|
227 | */ | |
228 |
|
228 | |||
229 | /*! |
|
229 | /*! | |
230 | \property QAreaSeries::pointLabelsFormat |
|
230 | \property QAreaSeries::pointLabelsFormat | |
231 | The \a format used for showing labels with series points. |
|
231 | The \a format used for showing labels with series points. | |
232 |
|
232 | |||
233 | QAreaSeries supports the following format tags: |
|
233 | QAreaSeries supports the following format tags: | |
234 | \table |
|
234 | \table | |
235 | \row |
|
235 | \row | |
236 | \li @xPoint \li The x value of the data point |
|
236 | \li @xPoint \li The x value of the data point | |
237 | \row |
|
237 | \row | |
238 | \li @yPoint \li The y value of the data point |
|
238 | \li @yPoint \li The y value of the data point | |
239 | \endtable |
|
239 | \endtable | |
240 |
|
240 | |||
241 | For example, the following usage of the format tags would produce labels that have the data |
|
241 | For example, the following usage of the format tags would produce labels that have the data | |
242 | point (x, y) shown inside brackets separated by a comma: |
|
242 | point (x, y) shown inside brackets separated by a comma: | |
243 | \code |
|
243 | \code | |
244 | series->setPointLabelsFormat("(@xPoint, @yPoint)"); |
|
244 | series->setPointLabelsFormat("(@xPoint, @yPoint)"); | |
245 | \endcode |
|
245 | \endcode | |
246 |
|
246 | |||
247 | By default, the labels format is set to '@xPoint, @yPoint'. The labels are shown on the plot |
|
247 | By default, the labels format is set to '@xPoint, @yPoint'. The labels are shown on the plot | |
248 | area, labels on the edge of the plot area are cut. If the points are close to each other the |
|
248 | area, labels on the edge of the plot area are cut. If the points are close to each other the | |
249 | labels may overlap. |
|
249 | labels may overlap. | |
250 |
|
250 | |||
251 | \sa QAreaSeries::pointLabelsVisible, QAreaSeries::pointLabelsFont, QAreaSeries::pointLabelsColor |
|
251 | \sa QAreaSeries::pointLabelsVisible, QAreaSeries::pointLabelsFont, QAreaSeries::pointLabelsColor | |
252 | */ |
|
252 | */ | |
253 | /*! |
|
253 | /*! | |
254 | \qmlproperty string AreaSeries::pointLabelsFormat |
|
254 | \qmlproperty string AreaSeries::pointLabelsFormat | |
255 | The \a format used for showing labels with series points. |
|
255 | The \a format used for showing labels with series points. | |
256 |
|
256 | |||
257 | \sa QAreaSeries::pointLabelsFormat, pointLabelsVisible, pointLabelsFont, pointLabelsColor |
|
257 | \sa QAreaSeries::pointLabelsFormat, pointLabelsVisible, pointLabelsFont, pointLabelsColor | |
258 | */ |
|
258 | */ | |
259 | /*! |
|
259 | /*! | |
260 | \fn void QAreaSeries::pointLabelsFormatChanged(const QString &format) |
|
260 | \fn void QAreaSeries::pointLabelsFormatChanged(const QString &format) | |
261 | Signal is emitted when the \a format of data point labels is changed. |
|
261 | Signal is emitted when the \a format of data point labels is changed. | |
262 | */ |
|
262 | */ | |
263 | /*! |
|
263 | /*! | |
264 | \qmlsignal AreaSeries::onPointLabelsFormatChanged(string format) |
|
264 | \qmlsignal AreaSeries::onPointLabelsFormatChanged(string format) | |
265 | Signal is emitted when the \a format of data point labels is changed. |
|
265 | Signal is emitted when the \a format of data point labels is changed. | |
266 | */ |
|
266 | */ | |
267 |
|
267 | |||
268 | /*! |
|
268 | /*! | |
269 | \property QAreaSeries::pointLabelsVisible |
|
269 | \property QAreaSeries::pointLabelsVisible | |
270 | Defines the visibility for data point labels. False by default. |
|
270 | Defines the visibility for data point labels. False by default. | |
271 |
|
271 | |||
272 | \sa QAreaSeries::pointLabelsFormat |
|
272 | \sa QAreaSeries::pointLabelsFormat, QAreaSeries::pointLabelsClipping | |
273 | */ |
|
273 | */ | |
274 | /*! |
|
274 | /*! | |
275 | \qmlproperty bool AreaSeries::pointLabelsVisible |
|
275 | \qmlproperty bool AreaSeries::pointLabelsVisible | |
276 | Defines the visibility for data point labels. |
|
276 | Defines the visibility for data point labels. | |
277 |
|
277 | |||
278 | \sa pointLabelsFormat |
|
278 | \sa pointLabelsFormat, pointLabelsClipping | |
279 | */ |
|
279 | */ | |
280 | /*! |
|
280 | /*! | |
281 | \fn void QAreaSeries::pointLabelsVisibilityChanged(bool visible) |
|
281 | \fn void QAreaSeries::pointLabelsVisibilityChanged(bool visible) | |
282 | The visibility of the data point labels is changed to \a visible. |
|
282 | The visibility of the data point labels is changed to \a visible. | |
283 | */ |
|
283 | */ | |
284 | /*! |
|
284 | /*! | |
285 | \qmlsignal AreaSeries::onPointLabelsVisibilityChanged(bool visible) |
|
285 | \qmlsignal AreaSeries::onPointLabelsVisibilityChanged(bool visible) | |
286 | The visibility of the data point labels is changed to \a visible. |
|
286 | The visibility of the data point labels is changed to \a visible. | |
287 | */ |
|
287 | */ | |
288 |
|
288 | |||
289 | /*! |
|
289 | /*! | |
290 | \property QAreaSeries::pointLabelsFont |
|
290 | \property QAreaSeries::pointLabelsFont | |
291 | Defines the font used for data point labels. |
|
291 | Defines the font used for data point labels. | |
292 |
|
292 | |||
293 | \sa QAreaSeries::pointLabelsFormat |
|
293 | \sa QAreaSeries::pointLabelsFormat | |
294 | */ |
|
294 | */ | |
295 | /*! |
|
295 | /*! | |
296 | \qmlproperty font AreaSeries::pointLabelsFont |
|
296 | \qmlproperty font AreaSeries::pointLabelsFont | |
297 | Defines the font used for data point labels. |
|
297 | Defines the font used for data point labels. | |
298 |
|
298 | |||
299 | \sa pointLabelsFormat |
|
299 | \sa pointLabelsFormat | |
300 | */ |
|
300 | */ | |
301 | /*! |
|
301 | /*! | |
302 | \fn void QAreaSeries::pointLabelsFontChanged(const QFont &font); |
|
302 | \fn void QAreaSeries::pointLabelsFontChanged(const QFont &font); | |
303 | The font used for data point labels is changed to \a font. |
|
303 | The font used for data point labels is changed to \a font. | |
304 | */ |
|
304 | */ | |
305 | /*! |
|
305 | /*! | |
306 | \qmlsignal AreaSeries::onPointLabelsFontChanged(Font font) |
|
306 | \qmlsignal AreaSeries::onPointLabelsFontChanged(Font font) | |
307 | The font used for data point labels is changed to \a font. |
|
307 | The font used for data point labels is changed to \a font. | |
308 | */ |
|
308 | */ | |
309 |
|
309 | |||
310 | /*! |
|
310 | /*! | |
311 | \property QAreaSeries::pointLabelsColor |
|
311 | \property QAreaSeries::pointLabelsColor | |
312 | Defines the color used for data point labels. By default, the color is the color of the brush |
|
312 | Defines the color used for data point labels. By default, the color is the color of the brush | |
313 | defined in theme for labels. |
|
313 | defined in theme for labels. | |
314 |
|
314 | |||
315 | \sa QAreaSeries::pointLabelsFormat |
|
315 | \sa QAreaSeries::pointLabelsFormat | |
316 | */ |
|
316 | */ | |
317 | /*! |
|
317 | /*! | |
318 | \qmlproperty font AreaSeries::pointLabelsColor |
|
318 | \qmlproperty font AreaSeries::pointLabelsColor | |
319 | Defines the color used for data point labels. By default, the color is the color of the brush |
|
319 | Defines the color used for data point labels. By default, the color is the color of the brush | |
320 | defined in theme for labels. |
|
320 | defined in theme for labels. | |
321 |
|
321 | |||
322 | \sa pointLabelsFormat |
|
322 | \sa pointLabelsFormat | |
323 | */ |
|
323 | */ | |
324 | /*! |
|
324 | /*! | |
325 | \fn void QAreaSeries::pointLabelsColorChanged(const QColor &color); |
|
325 | \fn void QAreaSeries::pointLabelsColorChanged(const QColor &color); | |
326 | The color used for data point labels is changed to \a color. |
|
326 | The color used for data point labels is changed to \a color. | |
327 | */ |
|
327 | */ | |
328 | /*! |
|
328 | /*! | |
329 | \qmlsignal AreaSeries::onPointLabelsColorChanged(Color color) |
|
329 | \qmlsignal AreaSeries::onPointLabelsColorChanged(Color color) | |
330 | The color used for data point labels is changed to \a color. |
|
330 | The color used for data point labels is changed to \a color. | |
331 | */ |
|
331 | */ | |
332 |
|
332 | |||
333 | /*! |
|
333 | /*! | |
|
334 | \property QAreaSeries::pointLabelsClipping | |||
|
335 | Defines the clipping for data point labels. True by default. The labels on the edge of the plot | |||
|
336 | area are cut when clipping is enabled. | |||
|
337 | ||||
|
338 | \sa pointLabelsVisible | |||
|
339 | */ | |||
|
340 | /*! | |||
|
341 | \qmlproperty bool AreaSeries::pointLabelsClipping | |||
|
342 | Defines the clipping for data point labels. True by default. The labels on the edge of the plot | |||
|
343 | area are cut when clipping is enabled. | |||
|
344 | ||||
|
345 | \sa pointLabelsVisible | |||
|
346 | */ | |||
|
347 | /*! | |||
|
348 | \fn void QAreaSeries::pointLabelsClippintChanged(bool clipping) | |||
|
349 | The clipping of the data point labels is changed to \a clipping. | |||
|
350 | */ | |||
|
351 | /*! | |||
|
352 | \qmlsignal AreaSeries::onPointLabelsClippingChanged(bool clipping) | |||
|
353 | The clipping of the data point labels is changed to \a clipping. | |||
|
354 | */ | |||
|
355 | ||||
|
356 | /*! | |||
334 | Constructs area series object which is a child of \a upperSeries. Area will be spanned between \a |
|
357 | Constructs area series object which is a child of \a upperSeries. Area will be spanned between \a | |
335 | upperSeries line and \a lowerSeries line. If no \a lowerSeries is passed to constructor, area is specified by axis x (y=0) instead. |
|
358 | upperSeries line and \a lowerSeries line. If no \a lowerSeries is passed to constructor, area is specified by axis x (y=0) instead. | |
336 | When series object is added to QChartView or QChart instance ownerships is transferred. |
|
359 | When series object is added to QChartView or QChart instance ownerships is transferred. | |
337 | */ |
|
360 | */ | |
338 | QAreaSeries::QAreaSeries(QLineSeries *upperSeries, QLineSeries *lowerSeries) |
|
361 | QAreaSeries::QAreaSeries(QLineSeries *upperSeries, QLineSeries *lowerSeries) | |
339 | : QAbstractSeries(*new QAreaSeriesPrivate(upperSeries, lowerSeries, this), upperSeries) |
|
362 | : QAbstractSeries(*new QAreaSeriesPrivate(upperSeries, lowerSeries, this), upperSeries) | |
340 | { |
|
363 | { | |
341 | } |
|
364 | } | |
342 |
|
365 | |||
343 | /*! |
|
366 | /*! | |
344 | Constructs area series object without upper or lower series with \a parent object. |
|
367 | Constructs area series object without upper or lower series with \a parent object. | |
345 | */ |
|
368 | */ | |
346 | QAreaSeries::QAreaSeries(QObject *parent) |
|
369 | QAreaSeries::QAreaSeries(QObject *parent) | |
347 | : QAbstractSeries(*new QAreaSeriesPrivate(0, 0, this), parent) |
|
370 | : QAbstractSeries(*new QAreaSeriesPrivate(0, 0, this), parent) | |
348 | { |
|
371 | { | |
349 | } |
|
372 | } | |
350 |
|
373 | |||
351 | /*! |
|
374 | /*! | |
352 | Destroys the object. |
|
375 | Destroys the object. | |
353 | */ |
|
376 | */ | |
354 | QAreaSeries::~QAreaSeries() |
|
377 | QAreaSeries::~QAreaSeries() | |
355 | { |
|
378 | { | |
356 | Q_D(QAreaSeries); |
|
379 | Q_D(QAreaSeries); | |
357 | if (d->m_chart) |
|
380 | if (d->m_chart) | |
358 | d->m_chart->removeSeries(this); |
|
381 | d->m_chart->removeSeries(this); | |
359 | } |
|
382 | } | |
360 |
|
383 | |||
361 | /*! |
|
384 | /*! | |
362 | Returns QAbstractSeries::SeriesTypeArea. |
|
385 | Returns QAbstractSeries::SeriesTypeArea. | |
363 | */ |
|
386 | */ | |
364 | QAbstractSeries::SeriesType QAreaSeries::type() const |
|
387 | QAbstractSeries::SeriesType QAreaSeries::type() const | |
365 | { |
|
388 | { | |
366 | return QAbstractSeries::SeriesTypeArea; |
|
389 | return QAbstractSeries::SeriesTypeArea; | |
367 | } |
|
390 | } | |
368 |
|
391 | |||
369 | /*! |
|
392 | /*! | |
370 | Sets the \a series that is to be used as the area chart upper series. |
|
393 | Sets the \a series that is to be used as the area chart upper series. | |
371 | */ |
|
394 | */ | |
372 | void QAreaSeries::setUpperSeries(QLineSeries *series) |
|
395 | void QAreaSeries::setUpperSeries(QLineSeries *series) | |
373 | { |
|
396 | { | |
374 | Q_D(QAreaSeries); |
|
397 | Q_D(QAreaSeries); | |
375 | if (d->m_upperSeries != series) |
|
398 | if (d->m_upperSeries != series) | |
376 | d->m_upperSeries = series; |
|
399 | d->m_upperSeries = series; | |
377 | } |
|
400 | } | |
378 |
|
401 | |||
379 | QLineSeries *QAreaSeries::upperSeries() const |
|
402 | QLineSeries *QAreaSeries::upperSeries() const | |
380 | { |
|
403 | { | |
381 | Q_D(const QAreaSeries); |
|
404 | Q_D(const QAreaSeries); | |
382 | return d->m_upperSeries; |
|
405 | return d->m_upperSeries; | |
383 | } |
|
406 | } | |
384 |
|
407 | |||
385 | /*! |
|
408 | /*! | |
386 | Sets the \a series that is to be used as the area chart lower series. |
|
409 | Sets the \a series that is to be used as the area chart lower series. | |
387 | */ |
|
410 | */ | |
388 | void QAreaSeries::setLowerSeries(QLineSeries *series) |
|
411 | void QAreaSeries::setLowerSeries(QLineSeries *series) | |
389 | { |
|
412 | { | |
390 | Q_D(QAreaSeries); |
|
413 | Q_D(QAreaSeries); | |
391 | d->m_lowerSeries = series; |
|
414 | d->m_lowerSeries = series; | |
392 | } |
|
415 | } | |
393 |
|
416 | |||
394 | QLineSeries *QAreaSeries::lowerSeries() const |
|
417 | QLineSeries *QAreaSeries::lowerSeries() const | |
395 | { |
|
418 | { | |
396 | Q_D(const QAreaSeries); |
|
419 | Q_D(const QAreaSeries); | |
397 | return d->m_lowerSeries; |
|
420 | return d->m_lowerSeries; | |
398 | } |
|
421 | } | |
399 |
|
422 | |||
400 | /*! |
|
423 | /*! | |
401 | Sets \a pen used for drawing area outline. |
|
424 | Sets \a pen used for drawing area outline. | |
402 | */ |
|
425 | */ | |
403 | void QAreaSeries::setPen(const QPen &pen) |
|
426 | void QAreaSeries::setPen(const QPen &pen) | |
404 | { |
|
427 | { | |
405 | Q_D(QAreaSeries); |
|
428 | Q_D(QAreaSeries); | |
406 | if (d->m_pen != pen) { |
|
429 | if (d->m_pen != pen) { | |
407 | d->m_pen = pen; |
|
430 | d->m_pen = pen; | |
408 | emit d->updated(); |
|
431 | emit d->updated(); | |
409 | } |
|
432 | } | |
410 | } |
|
433 | } | |
411 |
|
434 | |||
412 | QPen QAreaSeries::pen() const |
|
435 | QPen QAreaSeries::pen() const | |
413 | { |
|
436 | { | |
414 | Q_D(const QAreaSeries); |
|
437 | Q_D(const QAreaSeries); | |
415 | if (d->m_pen == QChartPrivate::defaultPen()) |
|
438 | if (d->m_pen == QChartPrivate::defaultPen()) | |
416 | return QPen(); |
|
439 | return QPen(); | |
417 | else |
|
440 | else | |
418 | return d->m_pen; |
|
441 | return d->m_pen; | |
419 | } |
|
442 | } | |
420 |
|
443 | |||
421 | /*! |
|
444 | /*! | |
422 | Sets \a brush used for filling the area. |
|
445 | Sets \a brush used for filling the area. | |
423 | */ |
|
446 | */ | |
424 | void QAreaSeries::setBrush(const QBrush &brush) |
|
447 | void QAreaSeries::setBrush(const QBrush &brush) | |
425 | { |
|
448 | { | |
426 | Q_D(QAreaSeries); |
|
449 | Q_D(QAreaSeries); | |
427 | if (d->m_brush != brush) { |
|
450 | if (d->m_brush != brush) { | |
428 | bool emitColorChanged = brush.color() != d->m_brush.color(); |
|
451 | bool emitColorChanged = brush.color() != d->m_brush.color(); | |
429 | d->m_brush = brush; |
|
452 | d->m_brush = brush; | |
430 | emit d->updated(); |
|
453 | emit d->updated(); | |
431 | if (emitColorChanged) |
|
454 | if (emitColorChanged) | |
432 | emit colorChanged(brush.color()); |
|
455 | emit colorChanged(brush.color()); | |
433 | } |
|
456 | } | |
434 | } |
|
457 | } | |
435 |
|
458 | |||
436 | QBrush QAreaSeries::brush() const |
|
459 | QBrush QAreaSeries::brush() const | |
437 | { |
|
460 | { | |
438 | Q_D(const QAreaSeries); |
|
461 | Q_D(const QAreaSeries); | |
439 | if (d->m_brush == QChartPrivate::defaultBrush()) |
|
462 | if (d->m_brush == QChartPrivate::defaultBrush()) | |
440 | return QBrush(); |
|
463 | return QBrush(); | |
441 | else |
|
464 | else | |
442 | return d->m_brush; |
|
465 | return d->m_brush; | |
443 | } |
|
466 | } | |
444 |
|
467 | |||
445 | void QAreaSeries::setColor(const QColor &color) |
|
468 | void QAreaSeries::setColor(const QColor &color) | |
446 | { |
|
469 | { | |
447 | QBrush b = brush(); |
|
470 | QBrush b = brush(); | |
448 | if (b == QBrush()) |
|
471 | if (b == QBrush()) | |
449 | b.setStyle(Qt::SolidPattern); |
|
472 | b.setStyle(Qt::SolidPattern); | |
450 | b.setColor(color); |
|
473 | b.setColor(color); | |
451 | setBrush(b); |
|
474 | setBrush(b); | |
452 | } |
|
475 | } | |
453 |
|
476 | |||
454 | QColor QAreaSeries::color() const |
|
477 | QColor QAreaSeries::color() const | |
455 | { |
|
478 | { | |
456 | return brush().color(); |
|
479 | return brush().color(); | |
457 | } |
|
480 | } | |
458 |
|
481 | |||
459 | void QAreaSeries::setBorderColor(const QColor &color) |
|
482 | void QAreaSeries::setBorderColor(const QColor &color) | |
460 | { |
|
483 | { | |
461 | QPen p = pen(); |
|
484 | QPen p = pen(); | |
462 | if (p.color() != color) { |
|
485 | if (p.color() != color) { | |
463 | p.setColor(color); |
|
486 | p.setColor(color); | |
464 | setPen(p); |
|
487 | setPen(p); | |
465 | emit borderColorChanged(color); |
|
488 | emit borderColorChanged(color); | |
466 | } |
|
489 | } | |
467 | } |
|
490 | } | |
468 |
|
491 | |||
469 | QColor QAreaSeries::borderColor() const |
|
492 | QColor QAreaSeries::borderColor() const | |
470 | { |
|
493 | { | |
471 | return pen().color(); |
|
494 | return pen().color(); | |
472 | } |
|
495 | } | |
473 |
|
496 | |||
474 | /*! |
|
497 | /*! | |
475 | Sets if data points are \a visible and should be drawn on line. |
|
498 | Sets if data points are \a visible and should be drawn on line. | |
476 | */ |
|
499 | */ | |
477 | void QAreaSeries::setPointsVisible(bool visible) |
|
500 | void QAreaSeries::setPointsVisible(bool visible) | |
478 | { |
|
501 | { | |
479 | Q_D(QAreaSeries); |
|
502 | Q_D(QAreaSeries); | |
480 | if (d->m_pointsVisible != visible) { |
|
503 | if (d->m_pointsVisible != visible) { | |
481 | d->m_pointsVisible = visible; |
|
504 | d->m_pointsVisible = visible; | |
482 | emit d->updated(); |
|
505 | emit d->updated(); | |
483 | } |
|
506 | } | |
484 | } |
|
507 | } | |
485 |
|
508 | |||
486 | /*! |
|
509 | /*! | |
487 | Returns if the points are drawn for this series. |
|
510 | Returns if the points are drawn for this series. | |
488 | \sa setPointsVisible() |
|
511 | \sa setPointsVisible() | |
489 | */ |
|
512 | */ | |
490 | bool QAreaSeries::pointsVisible() const |
|
513 | bool QAreaSeries::pointsVisible() const | |
491 | { |
|
514 | { | |
492 | Q_D(const QAreaSeries); |
|
515 | Q_D(const QAreaSeries); | |
493 | return d->m_pointsVisible; |
|
516 | return d->m_pointsVisible; | |
494 | } |
|
517 | } | |
495 |
|
518 | |||
496 | void QAreaSeries::setPointLabelsFormat(const QString &format) |
|
519 | void QAreaSeries::setPointLabelsFormat(const QString &format) | |
497 | { |
|
520 | { | |
498 | Q_D(QAreaSeries); |
|
521 | Q_D(QAreaSeries); | |
499 | if (d->m_pointLabelsFormat != format) { |
|
522 | if (d->m_pointLabelsFormat != format) { | |
500 | d->m_pointLabelsFormat = format; |
|
523 | d->m_pointLabelsFormat = format; | |
501 | emit pointLabelsFormatChanged(format); |
|
524 | emit pointLabelsFormatChanged(format); | |
502 | } |
|
525 | } | |
503 | } |
|
526 | } | |
504 |
|
527 | |||
505 | QString QAreaSeries::pointLabelsFormat() const |
|
528 | QString QAreaSeries::pointLabelsFormat() const | |
506 | { |
|
529 | { | |
507 | Q_D(const QAreaSeries); |
|
530 | Q_D(const QAreaSeries); | |
508 | return d->m_pointLabelsFormat; |
|
531 | return d->m_pointLabelsFormat; | |
509 | } |
|
532 | } | |
510 |
|
533 | |||
511 | void QAreaSeries::setPointLabelsVisible(bool visible) |
|
534 | void QAreaSeries::setPointLabelsVisible(bool visible) | |
512 | { |
|
535 | { | |
513 | Q_D(QAreaSeries); |
|
536 | Q_D(QAreaSeries); | |
514 | if (d->m_pointLabelsVisible != visible) { |
|
537 | if (d->m_pointLabelsVisible != visible) { | |
515 | d->m_pointLabelsVisible = visible; |
|
538 | d->m_pointLabelsVisible = visible; | |
516 | emit pointLabelsVisibilityChanged(visible); |
|
539 | emit pointLabelsVisibilityChanged(visible); | |
517 | } |
|
540 | } | |
518 | } |
|
541 | } | |
519 |
|
542 | |||
520 | bool QAreaSeries::pointLabelsVisible() const |
|
543 | bool QAreaSeries::pointLabelsVisible() const | |
521 | { |
|
544 | { | |
522 | Q_D(const QAreaSeries); |
|
545 | Q_D(const QAreaSeries); | |
523 | return d->m_pointLabelsVisible; |
|
546 | return d->m_pointLabelsVisible; | |
524 | } |
|
547 | } | |
525 |
|
548 | |||
526 | void QAreaSeries::setPointLabelsFont(const QFont &font) |
|
549 | void QAreaSeries::setPointLabelsFont(const QFont &font) | |
527 | { |
|
550 | { | |
528 | Q_D(QAreaSeries); |
|
551 | Q_D(QAreaSeries); | |
529 | if (d->m_pointLabelsFont != font) { |
|
552 | if (d->m_pointLabelsFont != font) { | |
530 | d->m_pointLabelsFont = font; |
|
553 | d->m_pointLabelsFont = font; | |
531 | emit pointLabelsFontChanged(font); |
|
554 | emit pointLabelsFontChanged(font); | |
532 | } |
|
555 | } | |
533 | } |
|
556 | } | |
534 |
|
557 | |||
535 | QFont QAreaSeries::pointLabelsFont() const |
|
558 | QFont QAreaSeries::pointLabelsFont() const | |
536 | { |
|
559 | { | |
537 | Q_D(const QAreaSeries); |
|
560 | Q_D(const QAreaSeries); | |
538 | return d->m_pointLabelsFont; |
|
561 | return d->m_pointLabelsFont; | |
539 | } |
|
562 | } | |
540 |
|
563 | |||
541 | void QAreaSeries::setPointLabelsColor(const QColor &color) |
|
564 | void QAreaSeries::setPointLabelsColor(const QColor &color) | |
542 | { |
|
565 | { | |
543 | Q_D(QAreaSeries); |
|
566 | Q_D(QAreaSeries); | |
544 | if (d->m_pointLabelsColor != color) { |
|
567 | if (d->m_pointLabelsColor != color) { | |
545 | d->m_pointLabelsColor = color; |
|
568 | d->m_pointLabelsColor = color; | |
546 | emit pointLabelsColorChanged(color); |
|
569 | emit pointLabelsColorChanged(color); | |
547 | } |
|
570 | } | |
548 | } |
|
571 | } | |
549 |
|
572 | |||
550 | QColor QAreaSeries::pointLabelsColor() const |
|
573 | QColor QAreaSeries::pointLabelsColor() const | |
551 | { |
|
574 | { | |
552 | Q_D(const QAreaSeries); |
|
575 | Q_D(const QAreaSeries); | |
553 | if (d->m_pointLabelsColor == QChartPrivate::defaultPen().color()) |
|
576 | if (d->m_pointLabelsColor == QChartPrivate::defaultPen().color()) | |
554 | return QPen().color(); |
|
577 | return QPen().color(); | |
555 | else |
|
578 | else | |
556 | return d->m_pointLabelsColor; |
|
579 | return d->m_pointLabelsColor; | |
557 | } |
|
580 | } | |
558 |
|
581 | |||
|
582 | void QAreaSeries::setPointLabelsClipping(bool enabled) | |||
|
583 | { | |||
|
584 | Q_D(QAreaSeries); | |||
|
585 | if (d->m_pointLabelsClipping != enabled) { | |||
|
586 | d->m_pointLabelsClipping = enabled; | |||
|
587 | emit pointLabelsClippingChanged(enabled); | |||
|
588 | } | |||
|
589 | } | |||
|
590 | ||||
|
591 | bool QAreaSeries::pointLabelsClipping() const | |||
|
592 | { | |||
|
593 | Q_D(const QAreaSeries); | |||
|
594 | return d->m_pointLabelsClipping; | |||
|
595 | } | |||
|
596 | ||||
559 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
597 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
560 |
|
598 | |||
561 | QAreaSeriesPrivate::QAreaSeriesPrivate(QLineSeries *upperSeries, QLineSeries *lowerSeries, QAreaSeries *q) |
|
599 | QAreaSeriesPrivate::QAreaSeriesPrivate(QLineSeries *upperSeries, QLineSeries *lowerSeries, QAreaSeries *q) | |
562 | : QAbstractSeriesPrivate(q), |
|
600 | : QAbstractSeriesPrivate(q), | |
563 | m_brush(QChartPrivate::defaultBrush()), |
|
601 | m_brush(QChartPrivate::defaultBrush()), | |
564 | m_pen(QChartPrivate::defaultPen()), |
|
602 | m_pen(QChartPrivate::defaultPen()), | |
565 | m_upperSeries(upperSeries), |
|
603 | m_upperSeries(upperSeries), | |
566 | m_lowerSeries(lowerSeries), |
|
604 | m_lowerSeries(lowerSeries), | |
567 | m_pointsVisible(false), |
|
605 | m_pointsVisible(false), | |
568 | m_pointLabelsFormat(QLatin1String("@xPoint, @yPoint")), |
|
606 | m_pointLabelsFormat(QLatin1String("@xPoint, @yPoint")), | |
569 | m_pointLabelsVisible(false), |
|
607 | m_pointLabelsVisible(false), | |
570 | m_pointLabelsFont(QChartPrivate::defaultFont()), |
|
608 | m_pointLabelsFont(QChartPrivate::defaultFont()), | |
571 | m_pointLabelsColor(QChartPrivate::defaultPen().color()) |
|
609 | m_pointLabelsColor(QChartPrivate::defaultPen().color()), | |
|
610 | m_pointLabelsClipping(true) | |||
572 | { |
|
611 | { | |
573 | } |
|
612 | } | |
574 |
|
613 | |||
575 | void QAreaSeriesPrivate::initializeDomain() |
|
614 | void QAreaSeriesPrivate::initializeDomain() | |
576 | { |
|
615 | { | |
577 | Q_Q(QAreaSeries); |
|
616 | Q_Q(QAreaSeries); | |
578 |
|
617 | |||
579 | qreal minX(domain()->minX()); |
|
618 | qreal minX(domain()->minX()); | |
580 | qreal minY(domain()->minY()); |
|
619 | qreal minY(domain()->minY()); | |
581 | qreal maxX(domain()->maxX()); |
|
620 | qreal maxX(domain()->maxX()); | |
582 | qreal maxY(domain()->maxY()); |
|
621 | qreal maxY(domain()->maxY()); | |
583 |
|
622 | |||
584 | QLineSeries *upperSeries = q->upperSeries(); |
|
623 | QLineSeries *upperSeries = q->upperSeries(); | |
585 | QLineSeries *lowerSeries = q->lowerSeries(); |
|
624 | QLineSeries *lowerSeries = q->lowerSeries(); | |
586 |
|
625 | |||
587 | if (upperSeries) { |
|
626 | if (upperSeries) { | |
588 | const QList<QPointF>& points = upperSeries->points(); |
|
627 | const QList<QPointF>& points = upperSeries->points(); | |
589 |
|
628 | |||
590 | for (int i = 0; i < points.count(); i++) { |
|
629 | for (int i = 0; i < points.count(); i++) { | |
591 | qreal x = points[i].x(); |
|
630 | qreal x = points[i].x(); | |
592 | qreal y = points[i].y(); |
|
631 | qreal y = points[i].y(); | |
593 | minX = qMin(minX, x); |
|
632 | minX = qMin(minX, x); | |
594 | minY = qMin(minY, y); |
|
633 | minY = qMin(minY, y); | |
595 | maxX = qMax(maxX, x); |
|
634 | maxX = qMax(maxX, x); | |
596 | maxY = qMax(maxY, y); |
|
635 | maxY = qMax(maxY, y); | |
597 | } |
|
636 | } | |
598 | } |
|
637 | } | |
599 | if (lowerSeries) { |
|
638 | if (lowerSeries) { | |
600 |
|
639 | |||
601 | const QList<QPointF>& points = lowerSeries->points(); |
|
640 | const QList<QPointF>& points = lowerSeries->points(); | |
602 |
|
641 | |||
603 | for (int i = 0; i < points.count(); i++) { |
|
642 | for (int i = 0; i < points.count(); i++) { | |
604 | qreal x = points[i].x(); |
|
643 | qreal x = points[i].x(); | |
605 | qreal y = points[i].y(); |
|
644 | qreal y = points[i].y(); | |
606 | minX = qMin(minX, x); |
|
645 | minX = qMin(minX, x); | |
607 | minY = qMin(minY, y); |
|
646 | minY = qMin(minY, y); | |
608 | maxX = qMax(maxX, x); |
|
647 | maxX = qMax(maxX, x); | |
609 | maxY = qMax(maxY, y); |
|
648 | maxY = qMax(maxY, y); | |
610 | } |
|
649 | } | |
611 | } |
|
650 | } | |
612 |
|
651 | |||
613 | domain()->setRange(minX, maxX, minY, maxY); |
|
652 | domain()->setRange(minX, maxX, minY, maxY); | |
614 | } |
|
653 | } | |
615 |
|
654 | |||
616 | void QAreaSeriesPrivate::initializeGraphics(QGraphicsItem* parent) |
|
655 | void QAreaSeriesPrivate::initializeGraphics(QGraphicsItem* parent) | |
617 | { |
|
656 | { | |
618 | Q_Q(QAreaSeries); |
|
657 | Q_Q(QAreaSeries); | |
619 | AreaChartItem *area = new AreaChartItem(q,parent); |
|
658 | AreaChartItem *area = new AreaChartItem(q,parent); | |
620 | m_item.reset(area); |
|
659 | m_item.reset(area); | |
621 | QAbstractSeriesPrivate::initializeGraphics(parent); |
|
660 | QAbstractSeriesPrivate::initializeGraphics(parent); | |
622 | } |
|
661 | } | |
623 | void QAreaSeriesPrivate::initializeAnimations(QChart::AnimationOptions options, int duration, |
|
662 | void QAreaSeriesPrivate::initializeAnimations(QChart::AnimationOptions options, int duration, | |
624 | QEasingCurve &curve) |
|
663 | QEasingCurve &curve) | |
625 | { |
|
664 | { | |
626 | Q_Q(QAreaSeries); |
|
665 | Q_Q(QAreaSeries); | |
627 | AreaChartItem *area = static_cast<AreaChartItem *>(m_item.data()); |
|
666 | AreaChartItem *area = static_cast<AreaChartItem *>(m_item.data()); | |
628 |
|
667 | |||
629 | if (q->upperSeries() && area->upperLineItem()->animation()) |
|
668 | if (q->upperSeries() && area->upperLineItem()->animation()) | |
630 | area->upperLineItem()->animation()->stopAndDestroyLater(); |
|
669 | area->upperLineItem()->animation()->stopAndDestroyLater(); | |
631 | if (q->lowerSeries() && area->lowerLineItem()->animation()) |
|
670 | if (q->lowerSeries() && area->lowerLineItem()->animation()) | |
632 | area->lowerLineItem()->animation()->stopAndDestroyLater(); |
|
671 | area->lowerLineItem()->animation()->stopAndDestroyLater(); | |
633 |
|
672 | |||
634 | if (options.testFlag(QChart::SeriesAnimations)) { |
|
673 | if (options.testFlag(QChart::SeriesAnimations)) { | |
635 | area->upperLineItem()->setAnimation(new XYAnimation(area->upperLineItem(), duration, |
|
674 | area->upperLineItem()->setAnimation(new XYAnimation(area->upperLineItem(), duration, | |
636 | curve)); |
|
675 | curve)); | |
637 | if (q->lowerSeries()) |
|
676 | if (q->lowerSeries()) | |
638 | area->lowerLineItem()->setAnimation(new XYAnimation(area->lowerLineItem(), duration, |
|
677 | area->lowerLineItem()->setAnimation(new XYAnimation(area->lowerLineItem(), duration, | |
639 | curve)); |
|
678 | curve)); | |
640 | } else { |
|
679 | } else { | |
641 | if (q->upperSeries()) |
|
680 | if (q->upperSeries()) | |
642 | area->upperLineItem()->setAnimation(0); |
|
681 | area->upperLineItem()->setAnimation(0); | |
643 | if (q->lowerSeries()) |
|
682 | if (q->lowerSeries()) | |
644 | area->lowerLineItem()->setAnimation(0); |
|
683 | area->lowerLineItem()->setAnimation(0); | |
645 | } |
|
684 | } | |
646 | QAbstractSeriesPrivate::initializeAnimations(options, duration, curve); |
|
685 | QAbstractSeriesPrivate::initializeAnimations(options, duration, curve); | |
647 | } |
|
686 | } | |
648 |
|
687 | |||
649 | QList<QLegendMarker*> QAreaSeriesPrivate::createLegendMarkers(QLegend* legend) |
|
688 | QList<QLegendMarker*> QAreaSeriesPrivate::createLegendMarkers(QLegend* legend) | |
650 | { |
|
689 | { | |
651 | Q_Q(QAreaSeries); |
|
690 | Q_Q(QAreaSeries); | |
652 | QList<QLegendMarker*> list; |
|
691 | QList<QLegendMarker*> list; | |
653 | return list << new QAreaLegendMarker(q,legend); |
|
692 | return list << new QAreaLegendMarker(q,legend); | |
654 | } |
|
693 | } | |
655 |
|
694 | |||
656 |
|
695 | |||
657 | void QAreaSeriesPrivate::initializeAxes() |
|
696 | void QAreaSeriesPrivate::initializeAxes() | |
658 | { |
|
697 | { | |
659 |
|
698 | |||
660 | } |
|
699 | } | |
661 |
|
700 | |||
662 | QAbstractAxis::AxisType QAreaSeriesPrivate::defaultAxisType(Qt::Orientation orientation) const |
|
701 | QAbstractAxis::AxisType QAreaSeriesPrivate::defaultAxisType(Qt::Orientation orientation) const | |
663 | { |
|
702 | { | |
664 | Q_UNUSED(orientation); |
|
703 | Q_UNUSED(orientation); | |
665 | return QAbstractAxis::AxisTypeValue; |
|
704 | return QAbstractAxis::AxisTypeValue; | |
666 | } |
|
705 | } | |
667 |
|
706 | |||
668 | QAbstractAxis* QAreaSeriesPrivate::createDefaultAxis(Qt::Orientation orientation) const |
|
707 | QAbstractAxis* QAreaSeriesPrivate::createDefaultAxis(Qt::Orientation orientation) const | |
669 | { |
|
708 | { | |
670 | Q_UNUSED(orientation); |
|
709 | Q_UNUSED(orientation); | |
671 | return new QValueAxis; |
|
710 | return new QValueAxis; | |
672 | } |
|
711 | } | |
673 |
|
712 | |||
674 | void QAreaSeriesPrivate::initializeTheme(int index, ChartTheme* theme, bool forced) |
|
713 | void QAreaSeriesPrivate::initializeTheme(int index, ChartTheme* theme, bool forced) | |
675 | { |
|
714 | { | |
676 | Q_Q(QAreaSeries); |
|
715 | Q_Q(QAreaSeries); | |
677 |
|
716 | |||
678 | const QList<QGradient> gradients = theme->seriesGradients(); |
|
717 | const QList<QGradient> gradients = theme->seriesGradients(); | |
679 | const QList<QColor> colors = theme->seriesColors(); |
|
718 | const QList<QColor> colors = theme->seriesColors(); | |
680 |
|
719 | |||
681 | if (forced || QChartPrivate::defaultPen() == m_pen) { |
|
720 | if (forced || QChartPrivate::defaultPen() == m_pen) { | |
682 | QPen pen; |
|
721 | QPen pen; | |
683 | pen.setColor(ChartThemeManager::colorAt(gradients.at(index % gradients.size()), 0.0)); |
|
722 | pen.setColor(ChartThemeManager::colorAt(gradients.at(index % gradients.size()), 0.0)); | |
684 | pen.setWidthF(2); |
|
723 | pen.setWidthF(2); | |
685 | q->setPen(pen); |
|
724 | q->setPen(pen); | |
686 | } |
|
725 | } | |
687 |
|
726 | |||
688 | if (forced || QChartPrivate::defaultBrush() == m_brush) { |
|
727 | if (forced || QChartPrivate::defaultBrush() == m_brush) { | |
689 | QBrush brush(colors.at(index % colors.size())); |
|
728 | QBrush brush(colors.at(index % colors.size())); | |
690 | q->setBrush(brush); |
|
729 | q->setBrush(brush); | |
691 | } |
|
730 | } | |
692 |
|
731 | |||
693 | if (forced || QChartPrivate::defaultPen().color() == m_pointLabelsColor) { |
|
732 | if (forced || QChartPrivate::defaultPen().color() == m_pointLabelsColor) { | |
694 | QColor color = theme->labelBrush().color(); |
|
733 | QColor color = theme->labelBrush().color(); | |
695 | q->setPointLabelsColor(color); |
|
734 | q->setPointLabelsColor(color); | |
696 | } |
|
735 | } | |
697 | } |
|
736 | } | |
698 |
|
737 | |||
699 |
|
738 | |||
700 | #include "moc_qareaseries.cpp" |
|
739 | #include "moc_qareaseries.cpp" | |
701 | #include "moc_qareaseries_p.cpp" |
|
740 | #include "moc_qareaseries_p.cpp" | |
702 |
|
741 | |||
703 | QT_CHARTS_END_NAMESPACE |
|
742 | QT_CHARTS_END_NAMESPACE |
@@ -1,107 +1,112 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
3 | ** Copyright (C) 2015 The Qt Company Ltd | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Charts module. |
|
7 | ** This file is part of the Qt Charts module. | |
8 | ** |
|
8 | ** | |
9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
9 | ** Licensees holding valid commercial license for Qt may use this file in | |
10 | ** accordance with the Qt License Agreement provided with the Software |
|
10 | ** accordance with the Qt License Agreement provided with the Software | |
11 | ** or, alternatively, in accordance with the terms contained in a written |
|
11 | ** or, alternatively, in accordance with the terms contained in a written | |
12 | ** agreement between you and The Qt Company. |
|
12 | ** agreement between you and The Qt Company. | |
13 | ** |
|
13 | ** | |
14 | ** If you have questions regarding the use of this file, please use |
|
14 | ** If you have questions regarding the use of this file, please use | |
15 | ** contact form at http://qt.io |
|
15 | ** contact form at http://qt.io | |
16 | ** |
|
16 | ** | |
17 | ****************************************************************************/ |
|
17 | ****************************************************************************/ | |
18 |
|
18 | |||
19 | #ifndef QAREASERIES_H |
|
19 | #ifndef QAREASERIES_H | |
20 | #define QAREASERIES_H |
|
20 | #define QAREASERIES_H | |
21 |
|
21 | |||
22 | #include <QtCharts/QChartGlobal> |
|
22 | #include <QtCharts/QChartGlobal> | |
23 | #include <QtCharts/QAbstractSeries> |
|
23 | #include <QtCharts/QAbstractSeries> | |
24 | #include <QtGui/QPen> |
|
24 | #include <QtGui/QPen> | |
25 | #include <QtGui/QBrush> |
|
25 | #include <QtGui/QBrush> | |
26 |
|
26 | |||
27 | QT_CHARTS_BEGIN_NAMESPACE |
|
27 | QT_CHARTS_BEGIN_NAMESPACE | |
28 | class QLineSeries; |
|
28 | class QLineSeries; | |
29 | class QAreaSeriesPrivate; |
|
29 | class QAreaSeriesPrivate; | |
30 |
|
30 | |||
31 | class QT_CHARTS_EXPORT QAreaSeries : public QAbstractSeries |
|
31 | class QT_CHARTS_EXPORT QAreaSeries : public QAbstractSeries | |
32 | { |
|
32 | { | |
33 | Q_OBJECT |
|
33 | Q_OBJECT | |
34 | Q_PROPERTY(QLineSeries *upperSeries READ upperSeries) |
|
34 | Q_PROPERTY(QLineSeries *upperSeries READ upperSeries) | |
35 | Q_PROPERTY(QLineSeries *lowerSeries READ lowerSeries) |
|
35 | Q_PROPERTY(QLineSeries *lowerSeries READ lowerSeries) | |
36 | Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) |
|
36 | Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) | |
37 | Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor NOTIFY borderColorChanged) |
|
37 | Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor NOTIFY borderColorChanged) | |
38 | Q_PROPERTY(QString pointLabelsFormat READ pointLabelsFormat WRITE setPointLabelsFormat NOTIFY pointLabelsFormatChanged) |
|
38 | Q_PROPERTY(QString pointLabelsFormat READ pointLabelsFormat WRITE setPointLabelsFormat NOTIFY pointLabelsFormatChanged) | |
39 | Q_PROPERTY(bool pointLabelsVisible READ pointLabelsVisible WRITE setPointLabelsVisible NOTIFY pointLabelsVisibilityChanged) |
|
39 | Q_PROPERTY(bool pointLabelsVisible READ pointLabelsVisible WRITE setPointLabelsVisible NOTIFY pointLabelsVisibilityChanged) | |
40 | Q_PROPERTY(QFont pointLabelsFont READ pointLabelsFont WRITE setPointLabelsFont NOTIFY pointLabelsFontChanged) |
|
40 | Q_PROPERTY(QFont pointLabelsFont READ pointLabelsFont WRITE setPointLabelsFont NOTIFY pointLabelsFontChanged) | |
41 | Q_PROPERTY(QColor pointLabelsColor READ pointLabelsColor WRITE setPointLabelsColor NOTIFY pointLabelsColorChanged) |
|
41 | Q_PROPERTY(QColor pointLabelsColor READ pointLabelsColor WRITE setPointLabelsColor NOTIFY pointLabelsColorChanged) | |
|
42 | Q_PROPERTY(bool pointLabelsClipping READ pointLabelsClipping WRITE setPointLabelsClipping NOTIFY pointLabelsClippingChanged) | |||
42 |
|
43 | |||
43 | public: |
|
44 | public: | |
44 | explicit QAreaSeries(QObject *parent = 0); |
|
45 | explicit QAreaSeries(QObject *parent = 0); | |
45 | explicit QAreaSeries(QLineSeries *upperSeries, QLineSeries *lowerSeries = 0); |
|
46 | explicit QAreaSeries(QLineSeries *upperSeries, QLineSeries *lowerSeries = 0); | |
46 | ~QAreaSeries(); |
|
47 | ~QAreaSeries(); | |
47 |
|
48 | |||
48 | public: |
|
49 | public: | |
49 | QAbstractSeries::SeriesType type() const; |
|
50 | QAbstractSeries::SeriesType type() const; | |
50 |
|
51 | |||
51 | void setUpperSeries(QLineSeries *series); |
|
52 | void setUpperSeries(QLineSeries *series); | |
52 | QLineSeries *upperSeries() const; |
|
53 | QLineSeries *upperSeries() const; | |
53 | void setLowerSeries(QLineSeries *series); |
|
54 | void setLowerSeries(QLineSeries *series); | |
54 | QLineSeries *lowerSeries() const; |
|
55 | QLineSeries *lowerSeries() const; | |
55 |
|
56 | |||
56 | void setPen(const QPen &pen); |
|
57 | void setPen(const QPen &pen); | |
57 | QPen pen() const; |
|
58 | QPen pen() const; | |
58 |
|
59 | |||
59 | void setBrush(const QBrush &brush); |
|
60 | void setBrush(const QBrush &brush); | |
60 | QBrush brush() const; |
|
61 | QBrush brush() const; | |
61 |
|
62 | |||
62 | void setColor(const QColor &color); |
|
63 | void setColor(const QColor &color); | |
63 | QColor color() const; |
|
64 | QColor color() const; | |
64 |
|
65 | |||
65 | void setBorderColor(const QColor &color); |
|
66 | void setBorderColor(const QColor &color); | |
66 | QColor borderColor() const; |
|
67 | QColor borderColor() const; | |
67 |
|
68 | |||
68 | void setPointsVisible(bool visible = true); |
|
69 | void setPointsVisible(bool visible = true); | |
69 | bool pointsVisible() const; |
|
70 | bool pointsVisible() const; | |
70 |
|
71 | |||
71 | void setPointLabelsFormat(const QString &format); |
|
72 | void setPointLabelsFormat(const QString &format); | |
72 | QString pointLabelsFormat() const; |
|
73 | QString pointLabelsFormat() const; | |
73 |
|
74 | |||
74 | void setPointLabelsVisible(bool visible = true); |
|
75 | void setPointLabelsVisible(bool visible = true); | |
75 | bool pointLabelsVisible() const; |
|
76 | bool pointLabelsVisible() const; | |
76 |
|
77 | |||
77 | void setPointLabelsFont(const QFont &font); |
|
78 | void setPointLabelsFont(const QFont &font); | |
78 | QFont pointLabelsFont() const; |
|
79 | QFont pointLabelsFont() const; | |
79 |
|
80 | |||
80 | void setPointLabelsColor(const QColor &color); |
|
81 | void setPointLabelsColor(const QColor &color); | |
81 | QColor pointLabelsColor() const; |
|
82 | QColor pointLabelsColor() const; | |
82 |
|
83 | |||
|
84 | void setPointLabelsClipping(bool enabled = true); | |||
|
85 | bool pointLabelsClipping() const; | |||
|
86 | ||||
83 | Q_SIGNALS: |
|
87 | Q_SIGNALS: | |
84 | void clicked(const QPointF &point); |
|
88 | void clicked(const QPointF &point); | |
85 | void hovered(const QPointF &point, bool state); |
|
89 | void hovered(const QPointF &point, bool state); | |
86 | void pressed(const QPointF &point); |
|
90 | void pressed(const QPointF &point); | |
87 | void released(const QPointF &point); |
|
91 | void released(const QPointF &point); | |
88 | void doubleClicked(const QPointF &point); |
|
92 | void doubleClicked(const QPointF &point); | |
89 | void selected(); |
|
93 | void selected(); | |
90 | void colorChanged(QColor color); |
|
94 | void colorChanged(QColor color); | |
91 | void borderColorChanged(QColor color); |
|
95 | void borderColorChanged(QColor color); | |
92 | void pointLabelsFormatChanged(const QString &format); |
|
96 | void pointLabelsFormatChanged(const QString &format); | |
93 | void pointLabelsVisibilityChanged(bool visible); |
|
97 | void pointLabelsVisibilityChanged(bool visible); | |
94 | void pointLabelsFontChanged(const QFont &font); |
|
98 | void pointLabelsFontChanged(const QFont &font); | |
95 | void pointLabelsColorChanged(const QColor &color); |
|
99 | void pointLabelsColorChanged(const QColor &color); | |
|
100 | void pointLabelsClippingChanged(bool clipping); | |||
96 |
|
101 | |||
97 | private: |
|
102 | private: | |
98 | Q_DECLARE_PRIVATE(QAreaSeries) |
|
103 | Q_DECLARE_PRIVATE(QAreaSeries) | |
99 | Q_DISABLE_COPY(QAreaSeries) |
|
104 | Q_DISABLE_COPY(QAreaSeries) | |
100 | friend class AreaLegendMarker; |
|
105 | friend class AreaLegendMarker; | |
101 | friend class AreaChartItem; |
|
106 | friend class AreaChartItem; | |
102 | friend class QAreaLegendMarkerPrivate; |
|
107 | friend class QAreaLegendMarkerPrivate; | |
103 | }; |
|
108 | }; | |
104 |
|
109 | |||
105 | QT_CHARTS_END_NAMESPACE |
|
110 | QT_CHARTS_END_NAMESPACE | |
106 |
|
111 | |||
107 | #endif // QAREASERIES_H |
|
112 | #endif // QAREASERIES_H |
@@ -1,76 +1,78 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
3 | ** Copyright (C) 2015 The Qt Company Ltd | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Charts module. |
|
7 | ** This file is part of the Qt Charts module. | |
8 | ** |
|
8 | ** | |
9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
9 | ** Licensees holding valid commercial license for Qt may use this file in | |
10 | ** accordance with the Qt License Agreement provided with the Software |
|
10 | ** accordance with the Qt License Agreement provided with the Software | |
11 | ** or, alternatively, in accordance with the terms contained in a written |
|
11 | ** or, alternatively, in accordance with the terms contained in a written | |
12 | ** agreement between you and The Qt Company. |
|
12 | ** agreement between you and The Qt Company. | |
13 | ** |
|
13 | ** | |
14 | ** If you have questions regarding the use of this file, please use |
|
14 | ** If you have questions regarding the use of this file, please use | |
15 | ** contact form at http://qt.io |
|
15 | ** contact form at http://qt.io | |
16 | ** |
|
16 | ** | |
17 | ****************************************************************************/ |
|
17 | ****************************************************************************/ | |
18 |
|
18 | |||
19 | // W A R N I N G |
|
19 | // W A R N I N G | |
20 | // ------------- |
|
20 | // ------------- | |
21 | // |
|
21 | // | |
22 | // This file is not part of the Qt Chart API. It exists purely as an |
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
23 | // implementation detail. This header file may change from version to |
|
23 | // implementation detail. This header file may change from version to | |
24 | // version without notice, or even be removed. |
|
24 | // version without notice, or even be removed. | |
25 | // |
|
25 | // | |
26 | // We mean it. |
|
26 | // We mean it. | |
27 |
|
27 | |||
28 | #ifndef QAREASERIES_P_H |
|
28 | #ifndef QAREASERIES_P_H | |
29 | #define QAREASERIES_P_H |
|
29 | #define QAREASERIES_P_H | |
30 |
|
30 | |||
31 | #include <private/qabstractseries_p.h> |
|
31 | #include <private/qabstractseries_p.h> | |
32 |
|
32 | |||
33 | QT_CHARTS_BEGIN_NAMESPACE |
|
33 | QT_CHARTS_BEGIN_NAMESPACE | |
34 |
|
34 | |||
35 | class QAreaSeries; |
|
35 | class QAreaSeries; | |
36 | class QLineSeries; |
|
36 | class QLineSeries; | |
37 |
|
37 | |||
38 | class QAreaSeriesPrivate: public QAbstractSeriesPrivate |
|
38 | class QAreaSeriesPrivate: public QAbstractSeriesPrivate | |
39 | { |
|
39 | { | |
40 | Q_OBJECT |
|
40 | Q_OBJECT | |
41 |
|
41 | |||
42 | public: |
|
42 | public: | |
43 | QAreaSeriesPrivate(QLineSeries *upperSeries, QLineSeries *lowerSeries, QAreaSeries *q); |
|
43 | QAreaSeriesPrivate(QLineSeries *upperSeries, QLineSeries *lowerSeries, QAreaSeries *q); | |
44 |
|
44 | |||
45 | void initializeDomain(); |
|
45 | void initializeDomain(); | |
46 | void initializeAxes(); |
|
46 | void initializeAxes(); | |
47 | void initializeGraphics(QGraphicsItem* parent); |
|
47 | void initializeGraphics(QGraphicsItem* parent); | |
48 | void initializeTheme(int index, ChartTheme* theme, bool forced = false); |
|
48 | void initializeTheme(int index, ChartTheme* theme, bool forced = false); | |
49 | void initializeAnimations(QChart::AnimationOptions options, int duration, |
|
49 | void initializeAnimations(QChart::AnimationOptions options, int duration, | |
50 | QEasingCurve &curve); |
|
50 | QEasingCurve &curve); | |
51 |
|
51 | |||
52 | QList<QLegendMarker *> createLegendMarkers(QLegend *legend); |
|
52 | QList<QLegendMarker *> createLegendMarkers(QLegend *legend); | |
53 |
|
53 | |||
54 | QAbstractAxis::AxisType defaultAxisType(Qt::Orientation orientation) const; |
|
54 | QAbstractAxis::AxisType defaultAxisType(Qt::Orientation orientation) const; | |
55 | QAbstractAxis* createDefaultAxis(Qt::Orientation) const; |
|
55 | QAbstractAxis* createDefaultAxis(Qt::Orientation) const; | |
56 |
|
56 | |||
57 | Q_SIGNALS: |
|
57 | Q_SIGNALS: | |
58 | void updated(); |
|
58 | void updated(); | |
59 |
|
59 | |||
60 | protected: |
|
60 | protected: | |
61 | QBrush m_brush; |
|
61 | QBrush m_brush; | |
62 | QPen m_pen; |
|
62 | QPen m_pen; | |
63 | QLineSeries *m_upperSeries; |
|
63 | QLineSeries *m_upperSeries; | |
64 | QLineSeries *m_lowerSeries; |
|
64 | QLineSeries *m_lowerSeries; | |
65 | bool m_pointsVisible; |
|
65 | bool m_pointsVisible; | |
66 | QString m_pointLabelsFormat; |
|
66 | QString m_pointLabelsFormat; | |
67 | bool m_pointLabelsVisible; |
|
67 | bool m_pointLabelsVisible; | |
68 | QFont m_pointLabelsFont; |
|
68 | QFont m_pointLabelsFont; | |
69 | QColor m_pointLabelsColor; |
|
69 | QColor m_pointLabelsColor; | |
|
70 | bool m_pointLabelsClipping; | |||
|
71 | ||||
70 | private: |
|
72 | private: | |
71 | Q_DECLARE_PUBLIC(QAreaSeries); |
|
73 | Q_DECLARE_PUBLIC(QAreaSeries); | |
72 | }; |
|
74 | }; | |
73 |
|
75 | |||
74 | QT_CHARTS_END_NAMESPACE |
|
76 | QT_CHARTS_END_NAMESPACE | |
75 |
|
77 | |||
76 | #endif |
|
78 | #endif |
@@ -1,431 +1,439 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
3 | ** Copyright (C) 2015 The Qt Company Ltd | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Charts module. |
|
7 | ** This file is part of the Qt Charts module. | |
8 | ** |
|
8 | ** | |
9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
9 | ** Licensees holding valid commercial license for Qt may use this file in | |
10 | ** accordance with the Qt License Agreement provided with the Software |
|
10 | ** accordance with the Qt License Agreement provided with the Software | |
11 | ** or, alternatively, in accordance with the terms contained in a written |
|
11 | ** or, alternatively, in accordance with the terms contained in a written | |
12 | ** agreement between you and The Qt Company. |
|
12 | ** agreement between you and The Qt Company. | |
13 | ** |
|
13 | ** | |
14 | ** If you have questions regarding the use of this file, please use |
|
14 | ** If you have questions regarding the use of this file, please use | |
15 | ** contact form at http://qt.io |
|
15 | ** contact form at http://qt.io | |
16 | ** |
|
16 | ** | |
17 | ****************************************************************************/ |
|
17 | ****************************************************************************/ | |
18 |
|
18 | |||
19 | #include <private/linechartitem_p.h> |
|
19 | #include <private/linechartitem_p.h> | |
20 | #include <QtCharts/QLineSeries> |
|
20 | #include <QtCharts/QLineSeries> | |
21 | #include <private/qlineseries_p.h> |
|
21 | #include <private/qlineseries_p.h> | |
22 | #include <private/chartpresenter_p.h> |
|
22 | #include <private/chartpresenter_p.h> | |
23 | #include <private/polardomain_p.h> |
|
23 | #include <private/polardomain_p.h> | |
24 | #include <private/chartthememanager_p.h> |
|
24 | #include <private/chartthememanager_p.h> | |
25 | #include <private/charttheme_p.h> |
|
25 | #include <private/charttheme_p.h> | |
26 | #include <QtGui/QPainter> |
|
26 | #include <QtGui/QPainter> | |
27 | #include <QtWidgets/QGraphicsSceneMouseEvent> |
|
27 | #include <QtWidgets/QGraphicsSceneMouseEvent> | |
28 |
|
28 | |||
29 | QT_CHARTS_BEGIN_NAMESPACE |
|
29 | QT_CHARTS_BEGIN_NAMESPACE | |
30 |
|
30 | |||
31 | const qreal mouseEventMinWidth(12); |
|
31 | const qreal mouseEventMinWidth(12); | |
32 |
|
32 | |||
33 | LineChartItem::LineChartItem(QLineSeries *series, QGraphicsItem *item) |
|
33 | LineChartItem::LineChartItem(QLineSeries *series, QGraphicsItem *item) | |
34 | : XYChart(series,item), |
|
34 | : XYChart(series,item), | |
35 | m_series(series), |
|
35 | m_series(series), | |
36 | m_pointsVisible(false), |
|
36 | m_pointsVisible(false), | |
37 | m_chartType(QChart::ChartTypeUndefined), |
|
37 | m_chartType(QChart::ChartTypeUndefined), | |
38 | m_pointLabelsVisible(false), |
|
38 | m_pointLabelsVisible(false), | |
39 | m_pointLabelsFormat(series->pointLabelsFormat()), |
|
39 | m_pointLabelsFormat(series->pointLabelsFormat()), | |
40 | m_pointLabelsFont(series->pointLabelsFont()), |
|
40 | m_pointLabelsFont(series->pointLabelsFont()), | |
41 | m_pointLabelsColor(series->pointLabelsColor()), |
|
41 | m_pointLabelsColor(series->pointLabelsColor()), | |
|
42 | m_pointLabelsClipping(true), | |||
42 | m_mousePressed(false) |
|
43 | m_mousePressed(false) | |
43 | { |
|
44 | { | |
44 | setAcceptHoverEvents(true); |
|
45 | setAcceptHoverEvents(true); | |
45 | setFlag(QGraphicsItem::ItemIsSelectable); |
|
46 | setFlag(QGraphicsItem::ItemIsSelectable); | |
46 | setZValue(ChartPresenter::LineChartZValue); |
|
47 | setZValue(ChartPresenter::LineChartZValue); | |
47 | QObject::connect(series->d_func(), SIGNAL(updated()), this, SLOT(handleUpdated())); |
|
48 | QObject::connect(series->d_func(), SIGNAL(updated()), this, SLOT(handleUpdated())); | |
48 | QObject::connect(series, SIGNAL(visibleChanged()), this, SLOT(handleUpdated())); |
|
49 | QObject::connect(series, SIGNAL(visibleChanged()), this, SLOT(handleUpdated())); | |
49 | QObject::connect(series, SIGNAL(opacityChanged()), this, SLOT(handleUpdated())); |
|
50 | QObject::connect(series, SIGNAL(opacityChanged()), this, SLOT(handleUpdated())); | |
50 | QObject::connect(series, SIGNAL(pointLabelsFormatChanged(QString)), |
|
51 | QObject::connect(series, SIGNAL(pointLabelsFormatChanged(QString)), | |
51 | this, SLOT(handleUpdated())); |
|
52 | this, SLOT(handleUpdated())); | |
52 | QObject::connect(series, SIGNAL(pointLabelsVisibilityChanged(bool)), |
|
53 | QObject::connect(series, SIGNAL(pointLabelsVisibilityChanged(bool)), | |
53 | this, SLOT(handleUpdated())); |
|
54 | this, SLOT(handleUpdated())); | |
54 | QObject::connect(series, SIGNAL(pointLabelsFontChanged(QFont)), this, SLOT(handleUpdated())); |
|
55 | QObject::connect(series, SIGNAL(pointLabelsFontChanged(QFont)), this, SLOT(handleUpdated())); | |
55 | QObject::connect(series, SIGNAL(pointLabelsColorChanged(QColor)), this, SLOT(handleUpdated())); |
|
56 | QObject::connect(series, SIGNAL(pointLabelsColorChanged(QColor)), this, SLOT(handleUpdated())); | |
|
57 | QObject::connect(series, SIGNAL(pointLabelsClippingChanged(bool)), this, SLOT(handleUpdated())); | |||
56 | handleUpdated(); |
|
58 | handleUpdated(); | |
57 | } |
|
59 | } | |
58 |
|
60 | |||
59 | QRectF LineChartItem::boundingRect() const |
|
61 | QRectF LineChartItem::boundingRect() const | |
60 | { |
|
62 | { | |
61 | return m_rect; |
|
63 | return m_rect; | |
62 | } |
|
64 | } | |
63 |
|
65 | |||
64 | QPainterPath LineChartItem::shape() const |
|
66 | QPainterPath LineChartItem::shape() const | |
65 | { |
|
67 | { | |
66 | return m_shapePath; |
|
68 | return m_shapePath; | |
67 | } |
|
69 | } | |
68 |
|
70 | |||
69 | void LineChartItem::updateGeometry() |
|
71 | void LineChartItem::updateGeometry() | |
70 | { |
|
72 | { | |
71 | m_points = geometryPoints(); |
|
73 | m_points = geometryPoints(); | |
72 | const QVector<QPointF> &points = m_points; |
|
74 | const QVector<QPointF> &points = m_points; | |
73 |
|
75 | |||
74 | if (points.size() == 0) { |
|
76 | if (points.size() == 0) { | |
75 | prepareGeometryChange(); |
|
77 | prepareGeometryChange(); | |
76 | m_fullPath = QPainterPath(); |
|
78 | m_fullPath = QPainterPath(); | |
77 | m_linePath = QPainterPath(); |
|
79 | m_linePath = QPainterPath(); | |
78 | m_rect = QRect(); |
|
80 | m_rect = QRect(); | |
79 | return; |
|
81 | return; | |
80 | } |
|
82 | } | |
81 |
|
83 | |||
82 | QPainterPath linePath; |
|
84 | QPainterPath linePath; | |
83 | QPainterPath fullPath; |
|
85 | QPainterPath fullPath; | |
84 | // Use worst case scenario to determine required margin. |
|
86 | // Use worst case scenario to determine required margin. | |
85 | qreal margin = m_linePen.width() * 1.42; |
|
87 | qreal margin = m_linePen.width() * 1.42; | |
86 |
|
88 | |||
87 | // Area series use component line series that aren't necessarily added to the chart themselves, |
|
89 | // Area series use component line series that aren't necessarily added to the chart themselves, | |
88 | // so check if chart type is forced before trying to obtain it from the chart. |
|
90 | // so check if chart type is forced before trying to obtain it from the chart. | |
89 | QChart::ChartType chartType = m_chartType; |
|
91 | QChart::ChartType chartType = m_chartType; | |
90 | if (chartType == QChart::ChartTypeUndefined) |
|
92 | if (chartType == QChart::ChartTypeUndefined) | |
91 | chartType = m_series->chart()->chartType(); |
|
93 | chartType = m_series->chart()->chartType(); | |
92 |
|
94 | |||
93 | // For polar charts, we need special handling for angular (horizontal) |
|
95 | // For polar charts, we need special handling for angular (horizontal) | |
94 | // points that are off-grid. |
|
96 | // points that are off-grid. | |
95 | if (chartType == QChart::ChartTypePolar) { |
|
97 | if (chartType == QChart::ChartTypePolar) { | |
96 | QPainterPath linePathLeft; |
|
98 | QPainterPath linePathLeft; | |
97 | QPainterPath linePathRight; |
|
99 | QPainterPath linePathRight; | |
98 | QPainterPath *currentSegmentPath = 0; |
|
100 | QPainterPath *currentSegmentPath = 0; | |
99 | QPainterPath *previousSegmentPath = 0; |
|
101 | QPainterPath *previousSegmentPath = 0; | |
100 | qreal minX = domain()->minX(); |
|
102 | qreal minX = domain()->minX(); | |
101 | qreal maxX = domain()->maxX(); |
|
103 | qreal maxX = domain()->maxX(); | |
102 | qreal minY = domain()->minY(); |
|
104 | qreal minY = domain()->minY(); | |
103 | QPointF currentSeriesPoint = m_series->at(0); |
|
105 | QPointF currentSeriesPoint = m_series->at(0); | |
104 | QPointF currentGeometryPoint = points.at(0); |
|
106 | QPointF currentGeometryPoint = points.at(0); | |
105 | QPointF previousGeometryPoint = points.at(0); |
|
107 | QPointF previousGeometryPoint = points.at(0); | |
106 | int size = m_linePen.width(); |
|
108 | int size = m_linePen.width(); | |
107 | bool pointOffGrid = false; |
|
109 | bool pointOffGrid = false; | |
108 | bool previousPointWasOffGrid = (currentSeriesPoint.x() < minX || currentSeriesPoint.x() > maxX); |
|
110 | bool previousPointWasOffGrid = (currentSeriesPoint.x() < minX || currentSeriesPoint.x() > maxX); | |
109 |
|
111 | |||
110 | qreal domainRadius = domain()->size().height() / 2.0; |
|
112 | qreal domainRadius = domain()->size().height() / 2.0; | |
111 | const QPointF centerPoint(domainRadius, domainRadius); |
|
113 | const QPointF centerPoint(domainRadius, domainRadius); | |
112 |
|
114 | |||
113 | if (!previousPointWasOffGrid) { |
|
115 | if (!previousPointWasOffGrid) { | |
114 | fullPath.moveTo(points.at(0)); |
|
116 | fullPath.moveTo(points.at(0)); | |
115 | if (m_pointsVisible && currentSeriesPoint.y() >= minY) { |
|
117 | if (m_pointsVisible && currentSeriesPoint.y() >= minY) { | |
116 | // Do not draw ellipses for points below minimum Y. |
|
118 | // Do not draw ellipses for points below minimum Y. | |
117 | linePath.addEllipse(points.at(0), size, size); |
|
119 | linePath.addEllipse(points.at(0), size, size); | |
118 | fullPath.addEllipse(points.at(0), size, size); |
|
120 | fullPath.addEllipse(points.at(0), size, size); | |
119 | linePath.moveTo(points.at(0)); |
|
121 | linePath.moveTo(points.at(0)); | |
120 | fullPath.moveTo(points.at(0)); |
|
122 | fullPath.moveTo(points.at(0)); | |
121 | } |
|
123 | } | |
122 | } |
|
124 | } | |
123 |
|
125 | |||
124 | qreal leftMarginLine = centerPoint.x() - margin; |
|
126 | qreal leftMarginLine = centerPoint.x() - margin; | |
125 | qreal rightMarginLine = centerPoint.x() + margin; |
|
127 | qreal rightMarginLine = centerPoint.x() + margin; | |
126 | qreal horizontal = centerPoint.y(); |
|
128 | qreal horizontal = centerPoint.y(); | |
127 |
|
129 | |||
128 | // See ScatterChartItem::updateGeometry() for explanation why seriesLastIndex is needed |
|
130 | // See ScatterChartItem::updateGeometry() for explanation why seriesLastIndex is needed | |
129 | const int seriesLastIndex = m_series->count() - 1; |
|
131 | const int seriesLastIndex = m_series->count() - 1; | |
130 |
|
132 | |||
131 | for (int i = 1; i < points.size(); i++) { |
|
133 | for (int i = 1; i < points.size(); i++) { | |
132 | // Interpolating line fragments would be ugly when thick pen is used, |
|
134 | // Interpolating line fragments would be ugly when thick pen is used, | |
133 | // so we work around it by utilizing three separate |
|
135 | // so we work around it by utilizing three separate | |
134 | // paths for line segments and clip those with custom regions at paint time. |
|
136 | // paths for line segments and clip those with custom regions at paint time. | |
135 | // "Right" path contains segments that cross the axis line with visible point on the |
|
137 | // "Right" path contains segments that cross the axis line with visible point on the | |
136 | // right side of the axis line, as well as segments that have one point within the margin |
|
138 | // right side of the axis line, as well as segments that have one point within the margin | |
137 | // on the right side of the axis line and another point on the right side of the chart. |
|
139 | // on the right side of the axis line and another point on the right side of the chart. | |
138 | // "Left" path contains points with similarly on the left side. |
|
140 | // "Left" path contains points with similarly on the left side. | |
139 | // "Full" path contains rest of the points. |
|
141 | // "Full" path contains rest of the points. | |
140 | // This doesn't yield perfect results always. E.g. when segment covers more than 90 |
|
142 | // This doesn't yield perfect results always. E.g. when segment covers more than 90 | |
141 | // degrees and both of the points are within the margin, one in the top half and one in the |
|
143 | // degrees and both of the points are within the margin, one in the top half and one in the | |
142 | // bottom half of the chart, the bottom one gets clipped incorrectly. |
|
144 | // bottom half of the chart, the bottom one gets clipped incorrectly. | |
143 | // However, this should be rare occurrence in any sensible chart. |
|
145 | // However, this should be rare occurrence in any sensible chart. | |
144 | currentSeriesPoint = m_series->at(qMin(seriesLastIndex, i)); |
|
146 | currentSeriesPoint = m_series->at(qMin(seriesLastIndex, i)); | |
145 | currentGeometryPoint = points.at(i); |
|
147 | currentGeometryPoint = points.at(i); | |
146 | pointOffGrid = (currentSeriesPoint.x() < minX || currentSeriesPoint.x() > maxX); |
|
148 | pointOffGrid = (currentSeriesPoint.x() < minX || currentSeriesPoint.x() > maxX); | |
147 |
|
149 | |||
148 | // Draw something unless both off-grid |
|
150 | // Draw something unless both off-grid | |
149 | if (!pointOffGrid || !previousPointWasOffGrid) { |
|
151 | if (!pointOffGrid || !previousPointWasOffGrid) { | |
150 | QPointF intersectionPoint; |
|
152 | QPointF intersectionPoint; | |
151 | qreal y; |
|
153 | qreal y; | |
152 | if (pointOffGrid != previousPointWasOffGrid) { |
|
154 | if (pointOffGrid != previousPointWasOffGrid) { | |
153 | if (currentGeometryPoint.x() == previousGeometryPoint.x()) { |
|
155 | if (currentGeometryPoint.x() == previousGeometryPoint.x()) { | |
154 | y = currentGeometryPoint.y() + (currentGeometryPoint.y() - previousGeometryPoint.y()) / 2.0; |
|
156 | y = currentGeometryPoint.y() + (currentGeometryPoint.y() - previousGeometryPoint.y()) / 2.0; | |
155 | } else { |
|
157 | } else { | |
156 | qreal ratio = (centerPoint.x() - currentGeometryPoint.x()) / (currentGeometryPoint.x() - previousGeometryPoint.x()); |
|
158 | qreal ratio = (centerPoint.x() - currentGeometryPoint.x()) / (currentGeometryPoint.x() - previousGeometryPoint.x()); | |
157 | y = currentGeometryPoint.y() + (currentGeometryPoint.y() - previousGeometryPoint.y()) * ratio; |
|
159 | y = currentGeometryPoint.y() + (currentGeometryPoint.y() - previousGeometryPoint.y()) * ratio; | |
158 | } |
|
160 | } | |
159 | intersectionPoint = QPointF(centerPoint.x(), y); |
|
161 | intersectionPoint = QPointF(centerPoint.x(), y); | |
160 | } |
|
162 | } | |
161 |
|
163 | |||
162 | bool dummyOk; // We know points are ok, but this is needed |
|
164 | bool dummyOk; // We know points are ok, but this is needed | |
163 | qreal currentAngle = 0; |
|
165 | qreal currentAngle = 0; | |
164 | qreal previousAngle = 0; |
|
166 | qreal previousAngle = 0; | |
165 | if (const PolarDomain *pd = qobject_cast<const PolarDomain *>(domain())) { |
|
167 | if (const PolarDomain *pd = qobject_cast<const PolarDomain *>(domain())) { | |
166 | currentAngle = pd->toAngularCoordinate(currentSeriesPoint.x(), dummyOk); |
|
168 | currentAngle = pd->toAngularCoordinate(currentSeriesPoint.x(), dummyOk); | |
167 | previousAngle = pd->toAngularCoordinate(m_series->at(i - 1).x(), dummyOk); |
|
169 | previousAngle = pd->toAngularCoordinate(m_series->at(i - 1).x(), dummyOk); | |
168 | } else { |
|
170 | } else { | |
169 | qWarning() << Q_FUNC_INFO << "Unexpected domain: " << domain(); |
|
171 | qWarning() << Q_FUNC_INFO << "Unexpected domain: " << domain(); | |
170 | } |
|
172 | } | |
171 | if ((qAbs(currentAngle - previousAngle) > 180.0)) { |
|
173 | if ((qAbs(currentAngle - previousAngle) > 180.0)) { | |
172 | // If the angle between two points is over 180 degrees (half X range), |
|
174 | // If the angle between two points is over 180 degrees (half X range), | |
173 | // any direct segment between them becomes meaningless. |
|
175 | // any direct segment between them becomes meaningless. | |
174 | // In this case two line segments are drawn instead, from previous |
|
176 | // In this case two line segments are drawn instead, from previous | |
175 | // point to the center and from center to current point. |
|
177 | // point to the center and from center to current point. | |
176 | if ((previousAngle < 0.0 || (previousAngle <= 180.0 && previousGeometryPoint.x() < rightMarginLine)) |
|
178 | if ((previousAngle < 0.0 || (previousAngle <= 180.0 && previousGeometryPoint.x() < rightMarginLine)) | |
177 | && previousGeometryPoint.y() < horizontal) { |
|
179 | && previousGeometryPoint.y() < horizontal) { | |
178 | currentSegmentPath = &linePathRight; |
|
180 | currentSegmentPath = &linePathRight; | |
179 | } else if ((previousAngle > 360.0 || (previousAngle > 180.0 && previousGeometryPoint.x() > leftMarginLine)) |
|
181 | } else if ((previousAngle > 360.0 || (previousAngle > 180.0 && previousGeometryPoint.x() > leftMarginLine)) | |
180 | && previousGeometryPoint.y() < horizontal) { |
|
182 | && previousGeometryPoint.y() < horizontal) { | |
181 | currentSegmentPath = &linePathLeft; |
|
183 | currentSegmentPath = &linePathLeft; | |
182 | } else if (previousAngle > 0.0 && previousAngle < 360.0) { |
|
184 | } else if (previousAngle > 0.0 && previousAngle < 360.0) { | |
183 | currentSegmentPath = &linePath; |
|
185 | currentSegmentPath = &linePath; | |
184 | } else { |
|
186 | } else { | |
185 | currentSegmentPath = 0; |
|
187 | currentSegmentPath = 0; | |
186 | } |
|
188 | } | |
187 |
|
189 | |||
188 | if (currentSegmentPath) { |
|
190 | if (currentSegmentPath) { | |
189 | if (previousSegmentPath != currentSegmentPath) |
|
191 | if (previousSegmentPath != currentSegmentPath) | |
190 | currentSegmentPath->moveTo(previousGeometryPoint); |
|
192 | currentSegmentPath->moveTo(previousGeometryPoint); | |
191 | if (previousPointWasOffGrid) |
|
193 | if (previousPointWasOffGrid) | |
192 | fullPath.moveTo(intersectionPoint); |
|
194 | fullPath.moveTo(intersectionPoint); | |
193 |
|
195 | |||
194 | currentSegmentPath->lineTo(centerPoint); |
|
196 | currentSegmentPath->lineTo(centerPoint); | |
195 | fullPath.lineTo(centerPoint); |
|
197 | fullPath.lineTo(centerPoint); | |
196 | } |
|
198 | } | |
197 |
|
199 | |||
198 | previousSegmentPath = currentSegmentPath; |
|
200 | previousSegmentPath = currentSegmentPath; | |
199 |
|
201 | |||
200 | if ((currentAngle < 0.0 || (currentAngle <= 180.0 && currentGeometryPoint.x() < rightMarginLine)) |
|
202 | if ((currentAngle < 0.0 || (currentAngle <= 180.0 && currentGeometryPoint.x() < rightMarginLine)) | |
201 | && currentGeometryPoint.y() < horizontal) { |
|
203 | && currentGeometryPoint.y() < horizontal) { | |
202 | currentSegmentPath = &linePathRight; |
|
204 | currentSegmentPath = &linePathRight; | |
203 | } else if ((currentAngle > 360.0 || (currentAngle > 180.0 &¤tGeometryPoint.x() > leftMarginLine)) |
|
205 | } else if ((currentAngle > 360.0 || (currentAngle > 180.0 &¤tGeometryPoint.x() > leftMarginLine)) | |
204 | && currentGeometryPoint.y() < horizontal) { |
|
206 | && currentGeometryPoint.y() < horizontal) { | |
205 | currentSegmentPath = &linePathLeft; |
|
207 | currentSegmentPath = &linePathLeft; | |
206 | } else if (currentAngle > 0.0 && currentAngle < 360.0) { |
|
208 | } else if (currentAngle > 0.0 && currentAngle < 360.0) { | |
207 | currentSegmentPath = &linePath; |
|
209 | currentSegmentPath = &linePath; | |
208 | } else { |
|
210 | } else { | |
209 | currentSegmentPath = 0; |
|
211 | currentSegmentPath = 0; | |
210 | } |
|
212 | } | |
211 |
|
213 | |||
212 | if (currentSegmentPath) { |
|
214 | if (currentSegmentPath) { | |
213 | if (previousSegmentPath != currentSegmentPath) |
|
215 | if (previousSegmentPath != currentSegmentPath) | |
214 | currentSegmentPath->moveTo(centerPoint); |
|
216 | currentSegmentPath->moveTo(centerPoint); | |
215 | if (!previousSegmentPath) |
|
217 | if (!previousSegmentPath) | |
216 | fullPath.moveTo(centerPoint); |
|
218 | fullPath.moveTo(centerPoint); | |
217 |
|
219 | |||
218 | currentSegmentPath->lineTo(currentGeometryPoint); |
|
220 | currentSegmentPath->lineTo(currentGeometryPoint); | |
219 | if (pointOffGrid) |
|
221 | if (pointOffGrid) | |
220 | fullPath.lineTo(intersectionPoint); |
|
222 | fullPath.lineTo(intersectionPoint); | |
221 | else |
|
223 | else | |
222 | fullPath.lineTo(currentGeometryPoint); |
|
224 | fullPath.lineTo(currentGeometryPoint); | |
223 | } |
|
225 | } | |
224 | } else { |
|
226 | } else { | |
225 | if (previousAngle < 0.0 || currentAngle < 0.0 |
|
227 | if (previousAngle < 0.0 || currentAngle < 0.0 | |
226 | || ((previousAngle <= 180.0 && currentAngle <= 180.0) |
|
228 | || ((previousAngle <= 180.0 && currentAngle <= 180.0) | |
227 | && ((previousGeometryPoint.x() < rightMarginLine && previousGeometryPoint.y() < horizontal) |
|
229 | && ((previousGeometryPoint.x() < rightMarginLine && previousGeometryPoint.y() < horizontal) | |
228 | || (currentGeometryPoint.x() < rightMarginLine && currentGeometryPoint.y() < horizontal)))) { |
|
230 | || (currentGeometryPoint.x() < rightMarginLine && currentGeometryPoint.y() < horizontal)))) { | |
229 | currentSegmentPath = &linePathRight; |
|
231 | currentSegmentPath = &linePathRight; | |
230 | } else if (previousAngle > 360.0 || currentAngle > 360.0 |
|
232 | } else if (previousAngle > 360.0 || currentAngle > 360.0 | |
231 | || ((previousAngle > 180.0 && currentAngle > 180.0) |
|
233 | || ((previousAngle > 180.0 && currentAngle > 180.0) | |
232 | && ((previousGeometryPoint.x() > leftMarginLine && previousGeometryPoint.y() < horizontal) |
|
234 | && ((previousGeometryPoint.x() > leftMarginLine && previousGeometryPoint.y() < horizontal) | |
233 | || (currentGeometryPoint.x() > leftMarginLine && currentGeometryPoint.y() < horizontal)))) { |
|
235 | || (currentGeometryPoint.x() > leftMarginLine && currentGeometryPoint.y() < horizontal)))) { | |
234 | currentSegmentPath = &linePathLeft; |
|
236 | currentSegmentPath = &linePathLeft; | |
235 | } else { |
|
237 | } else { | |
236 | currentSegmentPath = &linePath; |
|
238 | currentSegmentPath = &linePath; | |
237 | } |
|
239 | } | |
238 |
|
240 | |||
239 | if (currentSegmentPath != previousSegmentPath) |
|
241 | if (currentSegmentPath != previousSegmentPath) | |
240 | currentSegmentPath->moveTo(previousGeometryPoint); |
|
242 | currentSegmentPath->moveTo(previousGeometryPoint); | |
241 | if (previousPointWasOffGrid) |
|
243 | if (previousPointWasOffGrid) | |
242 | fullPath.moveTo(intersectionPoint); |
|
244 | fullPath.moveTo(intersectionPoint); | |
243 |
|
245 | |||
244 | if (pointOffGrid) |
|
246 | if (pointOffGrid) | |
245 | fullPath.lineTo(intersectionPoint); |
|
247 | fullPath.lineTo(intersectionPoint); | |
246 | else |
|
248 | else | |
247 | fullPath.lineTo(currentGeometryPoint); |
|
249 | fullPath.lineTo(currentGeometryPoint); | |
248 | currentSegmentPath->lineTo(currentGeometryPoint); |
|
250 | currentSegmentPath->lineTo(currentGeometryPoint); | |
249 | } |
|
251 | } | |
250 | } else { |
|
252 | } else { | |
251 | currentSegmentPath = 0; |
|
253 | currentSegmentPath = 0; | |
252 | } |
|
254 | } | |
253 |
|
255 | |||
254 | previousPointWasOffGrid = pointOffGrid; |
|
256 | previousPointWasOffGrid = pointOffGrid; | |
255 | if (m_pointsVisible && !pointOffGrid && currentSeriesPoint.y() >= minY) { |
|
257 | if (m_pointsVisible && !pointOffGrid && currentSeriesPoint.y() >= minY) { | |
256 | linePath.addEllipse(points.at(i), size, size); |
|
258 | linePath.addEllipse(points.at(i), size, size); | |
257 | fullPath.addEllipse(points.at(i), size, size); |
|
259 | fullPath.addEllipse(points.at(i), size, size); | |
258 | linePath.moveTo(points.at(i)); |
|
260 | linePath.moveTo(points.at(i)); | |
259 | fullPath.moveTo(points.at(i)); |
|
261 | fullPath.moveTo(points.at(i)); | |
260 | } |
|
262 | } | |
261 | previousSegmentPath = currentSegmentPath; |
|
263 | previousSegmentPath = currentSegmentPath; | |
262 | previousGeometryPoint = currentGeometryPoint; |
|
264 | previousGeometryPoint = currentGeometryPoint; | |
263 | } |
|
265 | } | |
264 | m_linePathPolarRight = linePathRight; |
|
266 | m_linePathPolarRight = linePathRight; | |
265 | m_linePathPolarLeft = linePathLeft; |
|
267 | m_linePathPolarLeft = linePathLeft; | |
266 | // Note: This construction of m_fullpath is not perfect. The partial segments that are |
|
268 | // Note: This construction of m_fullpath is not perfect. The partial segments that are | |
267 | // outside left/right clip regions at axis boundary still generate hover/click events, |
|
269 | // outside left/right clip regions at axis boundary still generate hover/click events, | |
268 | // because shape doesn't get clipped. It doesn't seem possible to do sensibly. |
|
270 | // because shape doesn't get clipped. It doesn't seem possible to do sensibly. | |
269 | } else { // not polar |
|
271 | } else { // not polar | |
270 | linePath.moveTo(points.at(0)); |
|
272 | linePath.moveTo(points.at(0)); | |
271 | if (m_pointsVisible) { |
|
273 | if (m_pointsVisible) { | |
272 | int size = m_linePen.width(); |
|
274 | int size = m_linePen.width(); | |
273 | linePath.addEllipse(points.at(0), size, size); |
|
275 | linePath.addEllipse(points.at(0), size, size); | |
274 | linePath.moveTo(points.at(0)); |
|
276 | linePath.moveTo(points.at(0)); | |
275 | for (int i = 1; i < points.size(); i++) { |
|
277 | for (int i = 1; i < points.size(); i++) { | |
276 | linePath.lineTo(points.at(i)); |
|
278 | linePath.lineTo(points.at(i)); | |
277 | linePath.addEllipse(points.at(i), size, size); |
|
279 | linePath.addEllipse(points.at(i), size, size); | |
278 | linePath.moveTo(points.at(i)); |
|
280 | linePath.moveTo(points.at(i)); | |
279 | } |
|
281 | } | |
280 | } else { |
|
282 | } else { | |
281 | for (int i = 1; i < points.size(); i++) |
|
283 | for (int i = 1; i < points.size(); i++) | |
282 | linePath.lineTo(points.at(i)); |
|
284 | linePath.lineTo(points.at(i)); | |
283 | } |
|
285 | } | |
284 | fullPath = linePath; |
|
286 | fullPath = linePath; | |
285 | } |
|
287 | } | |
286 |
|
288 | |||
287 | QPainterPathStroker stroker; |
|
289 | QPainterPathStroker stroker; | |
288 | // QPainter::drawLine does not respect join styles, for example BevelJoin becomes MiterJoin. |
|
290 | // QPainter::drawLine does not respect join styles, for example BevelJoin becomes MiterJoin. | |
289 | // This is why we are prepared for the "worst case" scenario, i.e. use always MiterJoin and |
|
291 | // This is why we are prepared for the "worst case" scenario, i.e. use always MiterJoin and | |
290 | // multiply line width with square root of two when defining shape and bounding rectangle. |
|
292 | // multiply line width with square root of two when defining shape and bounding rectangle. | |
291 | stroker.setWidth(margin); |
|
293 | stroker.setWidth(margin); | |
292 | stroker.setJoinStyle(Qt::MiterJoin); |
|
294 | stroker.setJoinStyle(Qt::MiterJoin); | |
293 | stroker.setCapStyle(Qt::SquareCap); |
|
295 | stroker.setCapStyle(Qt::SquareCap); | |
294 | stroker.setMiterLimit(m_linePen.miterLimit()); |
|
296 | stroker.setMiterLimit(m_linePen.miterLimit()); | |
295 |
|
297 | |||
296 | QPainterPath checkShapePath = stroker.createStroke(fullPath); |
|
298 | QPainterPath checkShapePath = stroker.createStroke(fullPath); | |
297 |
|
299 | |||
298 | // Only zoom in if the bounding rects of the paths fit inside int limits. QWidget::update() uses |
|
300 | // Only zoom in if the bounding rects of the paths fit inside int limits. QWidget::update() uses | |
299 | // a region that has to be compatible with QRect. |
|
301 | // a region that has to be compatible with QRect. | |
300 | if (checkShapePath.boundingRect().height() <= INT_MAX |
|
302 | if (checkShapePath.boundingRect().height() <= INT_MAX | |
301 | && checkShapePath.boundingRect().width() <= INT_MAX |
|
303 | && checkShapePath.boundingRect().width() <= INT_MAX | |
302 | && linePath.boundingRect().height() <= INT_MAX |
|
304 | && linePath.boundingRect().height() <= INT_MAX | |
303 | && linePath.boundingRect().width() <= INT_MAX |
|
305 | && linePath.boundingRect().width() <= INT_MAX | |
304 | && fullPath.boundingRect().height() <= INT_MAX |
|
306 | && fullPath.boundingRect().height() <= INT_MAX | |
305 | && fullPath.boundingRect().width() <= INT_MAX) { |
|
307 | && fullPath.boundingRect().width() <= INT_MAX) { | |
306 | prepareGeometryChange(); |
|
308 | prepareGeometryChange(); | |
307 |
|
309 | |||
308 | m_linePath = linePath; |
|
310 | m_linePath = linePath; | |
309 | m_fullPath = fullPath; |
|
311 | m_fullPath = fullPath; | |
310 | m_shapePath = checkShapePath; |
|
312 | m_shapePath = checkShapePath; | |
311 |
|
313 | |||
312 | m_rect = m_shapePath.boundingRect(); |
|
314 | m_rect = m_shapePath.boundingRect(); | |
313 | } else { |
|
315 | } else { | |
314 | update(); |
|
316 | update(); | |
315 | } |
|
317 | } | |
316 | } |
|
318 | } | |
317 |
|
319 | |||
318 | void LineChartItem::handleUpdated() |
|
320 | void LineChartItem::handleUpdated() | |
319 | { |
|
321 | { | |
320 | // If points visibility has changed, a geometry update is needed. |
|
322 | // If points visibility has changed, a geometry update is needed. | |
321 | // Also, if pen changes when points are visible, geometry update is needed. |
|
323 | // Also, if pen changes when points are visible, geometry update is needed. | |
322 | bool doGeometryUpdate = |
|
324 | bool doGeometryUpdate = | |
323 | (m_pointsVisible != m_series->pointsVisible()) |
|
325 | (m_pointsVisible != m_series->pointsVisible()) | |
324 | || (m_series->pointsVisible() && (m_linePen != m_series->pen())); |
|
326 | || (m_series->pointsVisible() && (m_linePen != m_series->pen())); | |
325 | setVisible(m_series->isVisible()); |
|
327 | setVisible(m_series->isVisible()); | |
326 | setOpacity(m_series->opacity()); |
|
328 | setOpacity(m_series->opacity()); | |
327 | m_pointsVisible = m_series->pointsVisible(); |
|
329 | m_pointsVisible = m_series->pointsVisible(); | |
328 | m_linePen = m_series->pen(); |
|
330 | m_linePen = m_series->pen(); | |
329 | m_pointLabelsFormat = m_series->pointLabelsFormat(); |
|
331 | m_pointLabelsFormat = m_series->pointLabelsFormat(); | |
330 | m_pointLabelsVisible = m_series->pointLabelsVisible(); |
|
332 | m_pointLabelsVisible = m_series->pointLabelsVisible(); | |
331 | m_pointLabelsFont = m_series->pointLabelsFont(); |
|
333 | m_pointLabelsFont = m_series->pointLabelsFont(); | |
332 | m_pointLabelsColor = m_series->pointLabelsColor(); |
|
334 | m_pointLabelsColor = m_series->pointLabelsColor(); | |
|
335 | m_pointLabelsClipping = m_series->pointLabelsClipping(); | |||
333 | if (doGeometryUpdate) |
|
336 | if (doGeometryUpdate) | |
334 | updateGeometry(); |
|
337 | updateGeometry(); | |
335 | update(); |
|
338 | update(); | |
336 | } |
|
339 | } | |
337 |
|
340 | |||
338 | void LineChartItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) |
|
341 | void LineChartItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) | |
339 | { |
|
342 | { | |
340 | Q_UNUSED(widget) |
|
343 | Q_UNUSED(widget) | |
341 | Q_UNUSED(option) |
|
344 | Q_UNUSED(option) | |
342 |
|
345 | |||
343 | QRectF clipRect = QRectF(QPointF(0, 0), domain()->size()); |
|
346 | QRectF clipRect = QRectF(QPointF(0, 0), domain()->size()); | |
344 |
|
347 | |||
345 | painter->save(); |
|
348 | painter->save(); | |
346 | painter->setPen(m_linePen); |
|
349 | painter->setPen(m_linePen); | |
347 | bool alwaysUsePath = false; |
|
350 | bool alwaysUsePath = false; | |
348 |
|
351 | |||
349 | if (m_series->chart()->chartType() == QChart::ChartTypePolar) { |
|
352 | if (m_series->chart()->chartType() == QChart::ChartTypePolar) { | |
350 | qreal halfWidth = domain()->size().width() / 2.0; |
|
353 | qreal halfWidth = domain()->size().width() / 2.0; | |
351 | QRectF clipRectLeft = QRectF(0, 0, halfWidth, domain()->size().height()); |
|
354 | QRectF clipRectLeft = QRectF(0, 0, halfWidth, domain()->size().height()); | |
352 | QRectF clipRectRight = QRectF(halfWidth, 0, halfWidth, domain()->size().height()); |
|
355 | QRectF clipRectRight = QRectF(halfWidth, 0, halfWidth, domain()->size().height()); | |
353 | QRegion fullPolarClipRegion(clipRect.toRect(), QRegion::Ellipse); |
|
356 | QRegion fullPolarClipRegion(clipRect.toRect(), QRegion::Ellipse); | |
354 | QRegion clipRegionLeft(fullPolarClipRegion.intersected(clipRectLeft.toRect())); |
|
357 | QRegion clipRegionLeft(fullPolarClipRegion.intersected(clipRectLeft.toRect())); | |
355 | QRegion clipRegionRight(fullPolarClipRegion.intersected(clipRectRight.toRect())); |
|
358 | QRegion clipRegionRight(fullPolarClipRegion.intersected(clipRectRight.toRect())); | |
356 | painter->setClipRegion(clipRegionLeft); |
|
359 | painter->setClipRegion(clipRegionLeft); | |
357 | painter->drawPath(m_linePathPolarLeft); |
|
360 | painter->drawPath(m_linePathPolarLeft); | |
358 | painter->setClipRegion(clipRegionRight); |
|
361 | painter->setClipRegion(clipRegionRight); | |
359 | painter->drawPath(m_linePathPolarRight); |
|
362 | painter->drawPath(m_linePathPolarRight); | |
360 | painter->setClipRegion(fullPolarClipRegion); |
|
363 | painter->setClipRegion(fullPolarClipRegion); | |
361 | alwaysUsePath = true; // required for proper clipping |
|
364 | alwaysUsePath = true; // required for proper clipping | |
362 | } else { |
|
365 | } else { | |
363 | painter->setClipRect(clipRect); |
|
366 | painter->setClipRect(clipRect); | |
364 | } |
|
367 | } | |
365 |
|
368 | |||
366 | reversePainter(painter, clipRect); |
|
369 | reversePainter(painter, clipRect); | |
367 |
|
370 | |||
368 | if (m_pointsVisible) { |
|
371 | if (m_pointsVisible) { | |
369 | painter->setBrush(m_linePen.color()); |
|
372 | painter->setBrush(m_linePen.color()); | |
370 | painter->drawPath(m_linePath); |
|
373 | painter->drawPath(m_linePath); | |
371 | } else { |
|
374 | } else { | |
372 | painter->setBrush(QBrush(Qt::NoBrush)); |
|
375 | painter->setBrush(QBrush(Qt::NoBrush)); | |
373 | if (m_linePen.style() != Qt::SolidLine || alwaysUsePath) { |
|
376 | if (m_linePen.style() != Qt::SolidLine || alwaysUsePath) { | |
374 | // If pen style is not solid line, always fall back to path painting |
|
377 | // If pen style is not solid line, always fall back to path painting | |
375 | // to ensure proper continuity of the pattern |
|
378 | // to ensure proper continuity of the pattern | |
376 | painter->drawPath(m_linePath); |
|
379 | painter->drawPath(m_linePath); | |
377 | } else { |
|
380 | } else { | |
378 | for (int i(1); i < m_points.size(); i++) |
|
381 | for (int i(1); i < m_points.size(); i++) | |
379 | painter->drawLine(m_points.at(i - 1), m_points.at(i)); |
|
382 | painter->drawLine(m_points.at(i - 1), m_points.at(i)); | |
380 | } |
|
383 | } | |
381 | } |
|
384 | } | |
382 |
|
385 | |||
383 | reversePainter(painter, clipRect); |
|
386 | reversePainter(painter, clipRect); | |
384 |
|
387 | |||
385 | if (m_pointLabelsVisible) |
|
388 | if (m_pointLabelsVisible) { | |
|
389 | if (m_pointLabelsClipping) | |||
|
390 | painter->setClipping(true); | |||
|
391 | else | |||
|
392 | painter->setClipping(false); | |||
386 | m_series->d_func()->drawSeriesPointLabels(painter, m_points, m_linePen.width() / 2); |
|
393 | m_series->d_func()->drawSeriesPointLabels(painter, m_points, m_linePen.width() / 2); | |
|
394 | } | |||
387 |
|
395 | |||
388 | painter->restore(); |
|
396 | painter->restore(); | |
389 |
|
397 | |||
390 | } |
|
398 | } | |
391 |
|
399 | |||
392 | void LineChartItem::mousePressEvent(QGraphicsSceneMouseEvent *event) |
|
400 | void LineChartItem::mousePressEvent(QGraphicsSceneMouseEvent *event) | |
393 | { |
|
401 | { | |
394 | emit XYChart::pressed(domain()->calculateDomainPoint(event->pos())); |
|
402 | emit XYChart::pressed(domain()->calculateDomainPoint(event->pos())); | |
395 | m_lastMousePos = event->pos(); |
|
403 | m_lastMousePos = event->pos(); | |
396 | m_mousePressed = true; |
|
404 | m_mousePressed = true; | |
397 | QGraphicsItem::mousePressEvent(event); |
|
405 | QGraphicsItem::mousePressEvent(event); | |
398 | } |
|
406 | } | |
399 |
|
407 | |||
400 | void LineChartItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event) |
|
408 | void LineChartItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event) | |
401 | { |
|
409 | { | |
402 | emit XYChart::hovered(domain()->calculateDomainPoint(event->pos()), true); |
|
410 | emit XYChart::hovered(domain()->calculateDomainPoint(event->pos()), true); | |
403 | // event->accept(); |
|
411 | // event->accept(); | |
404 | QGraphicsItem::hoverEnterEvent(event); |
|
412 | QGraphicsItem::hoverEnterEvent(event); | |
405 | } |
|
413 | } | |
406 |
|
414 | |||
407 | void LineChartItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) |
|
415 | void LineChartItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) | |
408 | { |
|
416 | { | |
409 | emit XYChart::hovered(domain()->calculateDomainPoint(event->pos()), false); |
|
417 | emit XYChart::hovered(domain()->calculateDomainPoint(event->pos()), false); | |
410 | // event->accept(); |
|
418 | // event->accept(); | |
411 | QGraphicsItem::hoverEnterEvent(event); |
|
419 | QGraphicsItem::hoverEnterEvent(event); | |
412 | } |
|
420 | } | |
413 |
|
421 | |||
414 | void LineChartItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) |
|
422 | void LineChartItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) | |
415 | { |
|
423 | { | |
416 | emit XYChart::released(domain()->calculateDomainPoint(m_lastMousePos)); |
|
424 | emit XYChart::released(domain()->calculateDomainPoint(m_lastMousePos)); | |
417 | if (m_mousePressed) |
|
425 | if (m_mousePressed) | |
418 | emit XYChart::clicked(domain()->calculateDomainPoint(m_lastMousePos)); |
|
426 | emit XYChart::clicked(domain()->calculateDomainPoint(m_lastMousePos)); | |
419 | m_mousePressed = false; |
|
427 | m_mousePressed = false; | |
420 | QGraphicsItem::mouseReleaseEvent(event); |
|
428 | QGraphicsItem::mouseReleaseEvent(event); | |
421 | } |
|
429 | } | |
422 |
|
430 | |||
423 | void LineChartItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) |
|
431 | void LineChartItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) | |
424 | { |
|
432 | { | |
425 | emit XYChart::doubleClicked(domain()->calculateDomainPoint(m_lastMousePos)); |
|
433 | emit XYChart::doubleClicked(domain()->calculateDomainPoint(m_lastMousePos)); | |
426 | QGraphicsItem::mouseDoubleClickEvent(event); |
|
434 | QGraphicsItem::mouseDoubleClickEvent(event); | |
427 | } |
|
435 | } | |
428 |
|
436 | |||
429 | #include "moc_linechartitem_p.cpp" |
|
437 | #include "moc_linechartitem_p.cpp" | |
430 |
|
438 | |||
431 | QT_CHARTS_END_NAMESPACE |
|
439 | QT_CHARTS_END_NAMESPACE |
@@ -1,94 +1,95 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
3 | ** Copyright (C) 2015 The Qt Company Ltd | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Charts module. |
|
7 | ** This file is part of the Qt Charts module. | |
8 | ** |
|
8 | ** | |
9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
9 | ** Licensees holding valid commercial license for Qt may use this file in | |
10 | ** accordance with the Qt License Agreement provided with the Software |
|
10 | ** accordance with the Qt License Agreement provided with the Software | |
11 | ** or, alternatively, in accordance with the terms contained in a written |
|
11 | ** or, alternatively, in accordance with the terms contained in a written | |
12 | ** agreement between you and The Qt Company. |
|
12 | ** agreement between you and The Qt Company. | |
13 | ** |
|
13 | ** | |
14 | ** If you have questions regarding the use of this file, please use |
|
14 | ** If you have questions regarding the use of this file, please use | |
15 | ** contact form at http://qt.io |
|
15 | ** contact form at http://qt.io | |
16 | ** |
|
16 | ** | |
17 | ****************************************************************************/ |
|
17 | ****************************************************************************/ | |
18 |
|
18 | |||
19 | // W A R N I N G |
|
19 | // W A R N I N G | |
20 | // ------------- |
|
20 | // ------------- | |
21 | // |
|
21 | // | |
22 | // This file is not part of the Qt Chart API. It exists purely as an |
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
23 | // implementation detail. This header file may change from version to |
|
23 | // implementation detail. This header file may change from version to | |
24 | // version without notice, or even be removed. |
|
24 | // version without notice, or even be removed. | |
25 | // |
|
25 | // | |
26 | // We mean it. |
|
26 | // We mean it. | |
27 |
|
27 | |||
28 | #ifndef LINECHARTITEM_H |
|
28 | #ifndef LINECHARTITEM_H | |
29 | #define LINECHARTITEM_H |
|
29 | #define LINECHARTITEM_H | |
30 |
|
30 | |||
31 | #include <QtCharts/QChartGlobal> |
|
31 | #include <QtCharts/QChartGlobal> | |
32 | #include <private/xychart_p.h> |
|
32 | #include <private/xychart_p.h> | |
33 | #include <QtCharts/QChart> |
|
33 | #include <QtCharts/QChart> | |
34 | #include <QtGui/QPen> |
|
34 | #include <QtGui/QPen> | |
35 |
|
35 | |||
36 | QT_CHARTS_BEGIN_NAMESPACE |
|
36 | QT_CHARTS_BEGIN_NAMESPACE | |
37 |
|
37 | |||
38 | class QLineSeries; |
|
38 | class QLineSeries; | |
39 | class ChartPresenter; |
|
39 | class ChartPresenter; | |
40 |
|
40 | |||
41 | class LineChartItem : public XYChart |
|
41 | class LineChartItem : public XYChart | |
42 | { |
|
42 | { | |
43 | Q_OBJECT |
|
43 | Q_OBJECT | |
44 | Q_INTERFACES(QGraphicsItem) |
|
44 | Q_INTERFACES(QGraphicsItem) | |
45 | public: |
|
45 | public: | |
46 | explicit LineChartItem(QLineSeries *series, QGraphicsItem *item = 0); |
|
46 | explicit LineChartItem(QLineSeries *series, QGraphicsItem *item = 0); | |
47 | ~LineChartItem() {} |
|
47 | ~LineChartItem() {} | |
48 |
|
48 | |||
49 | //from QGraphicsItem |
|
49 | //from QGraphicsItem | |
50 | QRectF boundingRect() const; |
|
50 | QRectF boundingRect() const; | |
51 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); |
|
51 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); | |
52 | QPainterPath shape() const; |
|
52 | QPainterPath shape() const; | |
53 |
|
53 | |||
54 | QPainterPath path() const { return m_fullPath; } |
|
54 | QPainterPath path() const { return m_fullPath; } | |
55 |
|
55 | |||
56 | public Q_SLOTS: |
|
56 | public Q_SLOTS: | |
57 | void handleUpdated(); |
|
57 | void handleUpdated(); | |
58 |
|
58 | |||
59 | protected: |
|
59 | protected: | |
60 | void updateGeometry(); |
|
60 | void updateGeometry(); | |
61 | void mousePressEvent(QGraphicsSceneMouseEvent *event); |
|
61 | void mousePressEvent(QGraphicsSceneMouseEvent *event); | |
62 | void hoverEnterEvent(QGraphicsSceneHoverEvent *event); |
|
62 | void hoverEnterEvent(QGraphicsSceneHoverEvent *event); | |
63 | void hoverLeaveEvent(QGraphicsSceneHoverEvent *event); |
|
63 | void hoverLeaveEvent(QGraphicsSceneHoverEvent *event); | |
64 | void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); |
|
64 | void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); | |
65 | void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event); |
|
65 | void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event); | |
66 | void suppressPoints() { m_pointsVisible = false; } |
|
66 | void suppressPoints() { m_pointsVisible = false; } | |
67 | void forceChartType(QChart::ChartType chartType) { m_chartType = chartType; } |
|
67 | void forceChartType(QChart::ChartType chartType) { m_chartType = chartType; } | |
68 |
|
68 | |||
69 | private: |
|
69 | private: | |
70 | QLineSeries *m_series; |
|
70 | QLineSeries *m_series; | |
71 | QPainterPath m_linePath; |
|
71 | QPainterPath m_linePath; | |
72 | QPainterPath m_linePathPolarRight; |
|
72 | QPainterPath m_linePathPolarRight; | |
73 | QPainterPath m_linePathPolarLeft; |
|
73 | QPainterPath m_linePathPolarLeft; | |
74 | QPainterPath m_fullPath; |
|
74 | QPainterPath m_fullPath; | |
75 | QPainterPath m_shapePath; |
|
75 | QPainterPath m_shapePath; | |
76 |
|
76 | |||
77 | QVector<QPointF> m_points; |
|
77 | QVector<QPointF> m_points; | |
78 | QRectF m_rect; |
|
78 | QRectF m_rect; | |
79 | QPen m_linePen; |
|
79 | QPen m_linePen; | |
80 | bool m_pointsVisible; |
|
80 | bool m_pointsVisible; | |
81 | QChart::ChartType m_chartType; |
|
81 | QChart::ChartType m_chartType; | |
82 |
|
82 | |||
83 | bool m_pointLabelsVisible; |
|
83 | bool m_pointLabelsVisible; | |
84 | QString m_pointLabelsFormat; |
|
84 | QString m_pointLabelsFormat; | |
85 | QFont m_pointLabelsFont; |
|
85 | QFont m_pointLabelsFont; | |
86 | QColor m_pointLabelsColor; |
|
86 | QColor m_pointLabelsColor; | |
|
87 | bool m_pointLabelsClipping; | |||
87 |
|
88 | |||
88 | QPointF m_lastMousePos; |
|
89 | QPointF m_lastMousePos; | |
89 | bool m_mousePressed; |
|
90 | bool m_mousePressed; | |
90 | }; |
|
91 | }; | |
91 |
|
92 | |||
92 | QT_CHARTS_END_NAMESPACE |
|
93 | QT_CHARTS_END_NAMESPACE | |
93 |
|
94 | |||
94 | #endif |
|
95 | #endif |
@@ -1,261 +1,268 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
3 | ** Copyright (C) 2015 The Qt Company Ltd | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Charts module. |
|
7 | ** This file is part of the Qt Charts module. | |
8 | ** |
|
8 | ** | |
9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
9 | ** Licensees holding valid commercial license for Qt may use this file in | |
10 | ** accordance with the Qt License Agreement provided with the Software |
|
10 | ** accordance with the Qt License Agreement provided with the Software | |
11 | ** or, alternatively, in accordance with the terms contained in a written |
|
11 | ** or, alternatively, in accordance with the terms contained in a written | |
12 | ** agreement between you and The Qt Company. |
|
12 | ** agreement between you and The Qt Company. | |
13 | ** |
|
13 | ** | |
14 | ** If you have questions regarding the use of this file, please use |
|
14 | ** If you have questions regarding the use of this file, please use | |
15 | ** contact form at http://qt.io |
|
15 | ** contact form at http://qt.io | |
16 | ** |
|
16 | ** | |
17 | ****************************************************************************/ |
|
17 | ****************************************************************************/ | |
18 |
|
18 | |||
19 | #include <private/scatterchartitem_p.h> |
|
19 | #include <private/scatterchartitem_p.h> | |
20 | #include <QtCharts/QScatterSeries> |
|
20 | #include <QtCharts/QScatterSeries> | |
21 | #include <private/qscatterseries_p.h> |
|
21 | #include <private/qscatterseries_p.h> | |
22 | #include <private/chartpresenter_p.h> |
|
22 | #include <private/chartpresenter_p.h> | |
23 | #include <private/abstractdomain_p.h> |
|
23 | #include <private/abstractdomain_p.h> | |
24 | #include <QtCharts/QChart> |
|
24 | #include <QtCharts/QChart> | |
25 | #include <QtGui/QPainter> |
|
25 | #include <QtGui/QPainter> | |
26 | #include <QtWidgets/QGraphicsScene> |
|
26 | #include <QtWidgets/QGraphicsScene> | |
27 | #include <QtCore/QDebug> |
|
27 | #include <QtCore/QDebug> | |
28 | #include <QtWidgets/QGraphicsSceneMouseEvent> |
|
28 | #include <QtWidgets/QGraphicsSceneMouseEvent> | |
29 |
|
29 | |||
30 | QT_CHARTS_BEGIN_NAMESPACE |
|
30 | QT_CHARTS_BEGIN_NAMESPACE | |
31 |
|
31 | |||
32 | ScatterChartItem::ScatterChartItem(QScatterSeries *series, QGraphicsItem *item) |
|
32 | ScatterChartItem::ScatterChartItem(QScatterSeries *series, QGraphicsItem *item) | |
33 | : XYChart(series,item), |
|
33 | : XYChart(series,item), | |
34 | m_series(series), |
|
34 | m_series(series), | |
35 | m_items(this), |
|
35 | m_items(this), | |
36 | m_visible(true), |
|
36 | m_visible(true), | |
37 | m_shape(QScatterSeries::MarkerShapeRectangle), |
|
37 | m_shape(QScatterSeries::MarkerShapeRectangle), | |
38 | m_size(15), |
|
38 | m_size(15), | |
39 | m_pointLabelsVisible(false), |
|
39 | m_pointLabelsVisible(false), | |
40 | m_pointLabelsFormat(series->pointLabelsFormat()), |
|
40 | m_pointLabelsFormat(series->pointLabelsFormat()), | |
41 | m_pointLabelsFont(series->pointLabelsFont()), |
|
41 | m_pointLabelsFont(series->pointLabelsFont()), | |
42 | m_pointLabelsColor(series->pointLabelsColor()), |
|
42 | m_pointLabelsColor(series->pointLabelsColor()), | |
|
43 | m_pointLabelsClipping(true), | |||
43 | m_mousePressed(false) |
|
44 | m_mousePressed(false) | |
44 | { |
|
45 | { | |
45 | QObject::connect(m_series->d_func(), SIGNAL(updated()), this, SLOT(handleUpdated())); |
|
46 | QObject::connect(m_series->d_func(), SIGNAL(updated()), this, SLOT(handleUpdated())); | |
46 | QObject::connect(m_series, SIGNAL(visibleChanged()), this, SLOT(handleUpdated())); |
|
47 | QObject::connect(m_series, SIGNAL(visibleChanged()), this, SLOT(handleUpdated())); | |
47 | QObject::connect(m_series, SIGNAL(opacityChanged()), this, SLOT(handleUpdated())); |
|
48 | QObject::connect(m_series, SIGNAL(opacityChanged()), this, SLOT(handleUpdated())); | |
48 | QObject::connect(series, SIGNAL(pointLabelsFormatChanged(QString)), |
|
49 | QObject::connect(series, SIGNAL(pointLabelsFormatChanged(QString)), | |
49 | this, SLOT(handleUpdated())); |
|
50 | this, SLOT(handleUpdated())); | |
50 | QObject::connect(series, SIGNAL(pointLabelsVisibilityChanged(bool)), |
|
51 | QObject::connect(series, SIGNAL(pointLabelsVisibilityChanged(bool)), | |
51 | this, SLOT(handleUpdated())); |
|
52 | this, SLOT(handleUpdated())); | |
52 | QObject::connect(series, SIGNAL(pointLabelsFontChanged(QFont)), this, SLOT(handleUpdated())); |
|
53 | QObject::connect(series, SIGNAL(pointLabelsFontChanged(QFont)), this, SLOT(handleUpdated())); | |
53 | QObject::connect(series, SIGNAL(pointLabelsColorChanged(QColor)), this, SLOT(handleUpdated())); |
|
54 | QObject::connect(series, SIGNAL(pointLabelsColorChanged(QColor)), this, SLOT(handleUpdated())); | |
|
55 | QObject::connect(series, SIGNAL(pointLabelsClippingChanged(bool)), this, SLOT(handleUpdated())); | |||
54 |
|
56 | |||
55 | setZValue(ChartPresenter::ScatterSeriesZValue); |
|
57 | setZValue(ChartPresenter::ScatterSeriesZValue); | |
56 | setFlags(QGraphicsItem::ItemClipsChildrenToShape); |
|
58 | setFlags(QGraphicsItem::ItemClipsChildrenToShape); | |
57 |
|
59 | |||
58 | handleUpdated(); |
|
60 | handleUpdated(); | |
59 |
|
61 | |||
60 | m_items.setHandlesChildEvents(false); |
|
62 | m_items.setHandlesChildEvents(false); | |
61 | } |
|
63 | } | |
62 |
|
64 | |||
63 | QRectF ScatterChartItem::boundingRect() const |
|
65 | QRectF ScatterChartItem::boundingRect() const | |
64 | { |
|
66 | { | |
65 | return m_rect; |
|
67 | return m_rect; | |
66 | } |
|
68 | } | |
67 |
|
69 | |||
68 | void ScatterChartItem::createPoints(int count) |
|
70 | void ScatterChartItem::createPoints(int count) | |
69 | { |
|
71 | { | |
70 | for (int i = 0; i < count; ++i) { |
|
72 | for (int i = 0; i < count; ++i) { | |
71 |
|
73 | |||
72 | QGraphicsItem *item = 0; |
|
74 | QGraphicsItem *item = 0; | |
73 |
|
75 | |||
74 | switch (m_shape) { |
|
76 | switch (m_shape) { | |
75 | case QScatterSeries::MarkerShapeCircle: { |
|
77 | case QScatterSeries::MarkerShapeCircle: { | |
76 | item = new CircleMarker(0, 0, m_size, m_size, this); |
|
78 | item = new CircleMarker(0, 0, m_size, m_size, this); | |
77 | const QRectF &rect = item->boundingRect(); |
|
79 | const QRectF &rect = item->boundingRect(); | |
78 | item->setPos(-rect.width() / 2, -rect.height() / 2); |
|
80 | item->setPos(-rect.width() / 2, -rect.height() / 2); | |
79 | break; |
|
81 | break; | |
80 | } |
|
82 | } | |
81 | case QScatterSeries::MarkerShapeRectangle: |
|
83 | case QScatterSeries::MarkerShapeRectangle: | |
82 | item = new RectangleMarker(0, 0, m_size, m_size, this); |
|
84 | item = new RectangleMarker(0, 0, m_size, m_size, this); | |
83 | item->setPos(-m_size / 2, -m_size / 2); |
|
85 | item->setPos(-m_size / 2, -m_size / 2); | |
84 | break; |
|
86 | break; | |
85 | default: |
|
87 | default: | |
86 | qWarning() << "Unsupported marker type"; |
|
88 | qWarning() << "Unsupported marker type"; | |
87 | break; |
|
89 | break; | |
88 | } |
|
90 | } | |
89 | m_items.addToGroup(item); |
|
91 | m_items.addToGroup(item); | |
90 | } |
|
92 | } | |
91 | } |
|
93 | } | |
92 |
|
94 | |||
93 | void ScatterChartItem::deletePoints(int count) |
|
95 | void ScatterChartItem::deletePoints(int count) | |
94 | { |
|
96 | { | |
95 | QList<QGraphicsItem *> items = m_items.childItems(); |
|
97 | QList<QGraphicsItem *> items = m_items.childItems(); | |
96 |
|
98 | |||
97 | for (int i = 0; i < count; ++i) { |
|
99 | for (int i = 0; i < count; ++i) { | |
98 | QGraphicsItem *item = items.takeLast(); |
|
100 | QGraphicsItem *item = items.takeLast(); | |
99 | m_markerMap.remove(item); |
|
101 | m_markerMap.remove(item); | |
100 | delete(item); |
|
102 | delete(item); | |
101 | } |
|
103 | } | |
102 | } |
|
104 | } | |
103 |
|
105 | |||
104 | void ScatterChartItem::markerSelected(QGraphicsItem *marker) |
|
106 | void ScatterChartItem::markerSelected(QGraphicsItem *marker) | |
105 | { |
|
107 | { | |
106 | emit XYChart::clicked(m_markerMap[marker]); |
|
108 | emit XYChart::clicked(m_markerMap[marker]); | |
107 | } |
|
109 | } | |
108 |
|
110 | |||
109 | void ScatterChartItem::markerHovered(QGraphicsItem *marker, bool state) |
|
111 | void ScatterChartItem::markerHovered(QGraphicsItem *marker, bool state) | |
110 | { |
|
112 | { | |
111 | emit XYChart::hovered(m_markerMap[marker], state); |
|
113 | emit XYChart::hovered(m_markerMap[marker], state); | |
112 | } |
|
114 | } | |
113 |
|
115 | |||
114 | void ScatterChartItem::markerPressed(QGraphicsItem *marker) |
|
116 | void ScatterChartItem::markerPressed(QGraphicsItem *marker) | |
115 | { |
|
117 | { | |
116 | emit XYChart::pressed(m_markerMap[marker]); |
|
118 | emit XYChart::pressed(m_markerMap[marker]); | |
117 | } |
|
119 | } | |
118 |
|
120 | |||
119 | void ScatterChartItem::markerReleased(QGraphicsItem *marker) |
|
121 | void ScatterChartItem::markerReleased(QGraphicsItem *marker) | |
120 | { |
|
122 | { | |
121 | emit XYChart::released(m_markerMap[marker]); |
|
123 | emit XYChart::released(m_markerMap[marker]); | |
122 | } |
|
124 | } | |
123 |
|
125 | |||
124 | void ScatterChartItem::markerDoubleClicked(QGraphicsItem *marker) |
|
126 | void ScatterChartItem::markerDoubleClicked(QGraphicsItem *marker) | |
125 | { |
|
127 | { | |
126 | emit XYChart::doubleClicked(m_markerMap[marker]); |
|
128 | emit XYChart::doubleClicked(m_markerMap[marker]); | |
127 | } |
|
129 | } | |
128 |
|
130 | |||
129 | void ScatterChartItem::updateGeometry() |
|
131 | void ScatterChartItem::updateGeometry() | |
130 | { |
|
132 | { | |
131 |
|
133 | |||
132 | const QVector<QPointF>& points = geometryPoints(); |
|
134 | const QVector<QPointF>& points = geometryPoints(); | |
133 |
|
135 | |||
134 | if (points.size() == 0) { |
|
136 | if (points.size() == 0) { | |
135 | deletePoints(m_items.childItems().count()); |
|
137 | deletePoints(m_items.childItems().count()); | |
136 | return; |
|
138 | return; | |
137 | } |
|
139 | } | |
138 |
|
140 | |||
139 | int diff = m_items.childItems().size() - points.size(); |
|
141 | int diff = m_items.childItems().size() - points.size(); | |
140 |
|
142 | |||
141 | if (diff > 0) |
|
143 | if (diff > 0) | |
142 | deletePoints(diff); |
|
144 | deletePoints(diff); | |
143 | else if (diff < 0) |
|
145 | else if (diff < 0) | |
144 | createPoints(-diff); |
|
146 | createPoints(-diff); | |
145 |
|
147 | |||
146 | if (diff != 0) |
|
148 | if (diff != 0) | |
147 | handleUpdated(); |
|
149 | handleUpdated(); | |
148 |
|
150 | |||
149 | QList<QGraphicsItem *> items = m_items.childItems(); |
|
151 | QList<QGraphicsItem *> items = m_items.childItems(); | |
150 |
|
152 | |||
151 | QRectF clipRect(QPointF(0,0),domain()->size()); |
|
153 | QRectF clipRect(QPointF(0,0),domain()->size()); | |
152 |
|
154 | |||
153 | // Only zoom in if the clipRect fits inside int limits. QWidget::update() uses |
|
155 | // Only zoom in if the clipRect fits inside int limits. QWidget::update() uses | |
154 | // a region that has to be compatible with QRect. |
|
156 | // a region that has to be compatible with QRect. | |
155 | if (clipRect.height() <= INT_MAX |
|
157 | if (clipRect.height() <= INT_MAX | |
156 | && clipRect.width() <= INT_MAX) { |
|
158 | && clipRect.width() <= INT_MAX) { | |
157 | QVector<bool> offGridStatus = offGridStatusVector(); |
|
159 | QVector<bool> offGridStatus = offGridStatusVector(); | |
158 | const int seriesLastIndex = m_series->count() - 1; |
|
160 | const int seriesLastIndex = m_series->count() - 1; | |
159 |
|
161 | |||
160 | for (int i = 0; i < points.size(); i++) { |
|
162 | for (int i = 0; i < points.size(); i++) { | |
161 | QGraphicsItem *item = items.at(i); |
|
163 | QGraphicsItem *item = items.at(i); | |
162 | const QPointF &point = points.at(i); |
|
164 | const QPointF &point = points.at(i); | |
163 | const QRectF &rect = item->boundingRect(); |
|
165 | const QRectF &rect = item->boundingRect(); | |
164 | // During remove animation series may have different number of points, |
|
166 | // During remove animation series may have different number of points, | |
165 | // so ensure we don't go over the index. Animation handling itself ensures that |
|
167 | // so ensure we don't go over the index. Animation handling itself ensures that | |
166 | // if there is actually no points in the series, then it won't generate a fake point, |
|
168 | // if there is actually no points in the series, then it won't generate a fake point, | |
167 | // so we can be assured there is always at least one point in m_series here. |
|
169 | // so we can be assured there is always at least one point in m_series here. | |
168 | // Note that marker map values can be technically incorrect during the animation, |
|
170 | // Note that marker map values can be technically incorrect during the animation, | |
169 | // if it was caused by an insert, but this shouldn't be a problem as the points are |
|
171 | // if it was caused by an insert, but this shouldn't be a problem as the points are | |
170 | // fake anyway. After remove animation stops, geometry is updated to correct one. |
|
172 | // fake anyway. After remove animation stops, geometry is updated to correct one. | |
171 | m_markerMap[item] = m_series->at(qMin(seriesLastIndex, i)); |
|
173 | m_markerMap[item] = m_series->at(qMin(seriesLastIndex, i)); | |
172 | QPointF position; |
|
174 | QPointF position; | |
173 | if (seriesPrivate()->reverseXAxis()) |
|
175 | if (seriesPrivate()->reverseXAxis()) | |
174 | position.setX(domain()->size().width() - point.x() - rect.width() / 2); |
|
176 | position.setX(domain()->size().width() - point.x() - rect.width() / 2); | |
175 | else |
|
177 | else | |
176 | position.setX(point.x() - rect.width() / 2); |
|
178 | position.setX(point.x() - rect.width() / 2); | |
177 | if (seriesPrivate()->reverseYAxis()) |
|
179 | if (seriesPrivate()->reverseYAxis()) | |
178 | position.setY(domain()->size().height() - point.y() - rect.height() / 2); |
|
180 | position.setY(domain()->size().height() - point.y() - rect.height() / 2); | |
179 | else |
|
181 | else | |
180 | position.setY(point.y() - rect.height() / 2); |
|
182 | position.setY(point.y() - rect.height() / 2); | |
181 | item->setPos(position); |
|
183 | item->setPos(position); | |
182 |
|
184 | |||
183 |
|
185 | |||
184 | if (!m_visible || offGridStatus.at(i)) |
|
186 | if (!m_visible || offGridStatus.at(i)) | |
185 | item->setVisible(false); |
|
187 | item->setVisible(false); | |
186 | else |
|
188 | else | |
187 | item->setVisible(true); |
|
189 | item->setVisible(true); | |
188 | } |
|
190 | } | |
189 |
|
191 | |||
190 | prepareGeometryChange(); |
|
192 | prepareGeometryChange(); | |
191 | m_rect = clipRect; |
|
193 | m_rect = clipRect; | |
192 | } |
|
194 | } | |
193 | } |
|
195 | } | |
194 |
|
196 | |||
195 | void ScatterChartItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) |
|
197 | void ScatterChartItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) | |
196 | { |
|
198 | { | |
197 | Q_UNUSED(option) |
|
199 | Q_UNUSED(option) | |
198 | Q_UNUSED(widget) |
|
200 | Q_UNUSED(widget) | |
199 |
|
201 | |||
200 | QRectF clipRect = QRectF(QPointF(0, 0), domain()->size()); |
|
202 | QRectF clipRect = QRectF(QPointF(0, 0), domain()->size()); | |
201 |
|
203 | |||
202 | painter->save(); |
|
204 | painter->save(); | |
203 | painter->setClipRect(clipRect); |
|
205 | painter->setClipRect(clipRect); | |
204 |
|
206 | |||
205 | if (m_pointLabelsVisible) { |
|
207 | if (m_pointLabelsVisible) { | |
|
208 | if (m_pointLabelsClipping) | |||
|
209 | painter->setClipping(true); | |||
|
210 | else | |||
|
211 | painter->setClipping(false); | |||
206 | m_series->d_func()->drawSeriesPointLabels(painter, m_points, |
|
212 | m_series->d_func()->drawSeriesPointLabels(painter, m_points, | |
207 | m_series->markerSize() / 2 |
|
213 | m_series->markerSize() / 2 | |
208 | + m_series->pen().width()); |
|
214 | + m_series->pen().width()); | |
209 | } |
|
215 | } | |
210 |
|
216 | |||
211 | painter->restore(); |
|
217 | painter->restore(); | |
212 | } |
|
218 | } | |
213 |
|
219 | |||
214 | void ScatterChartItem::setPen(const QPen &pen) |
|
220 | void ScatterChartItem::setPen(const QPen &pen) | |
215 | { |
|
221 | { | |
216 | foreach (QGraphicsItem *item , m_items.childItems()) |
|
222 | foreach (QGraphicsItem *item , m_items.childItems()) | |
217 | static_cast<QAbstractGraphicsShapeItem*>(item)->setPen(pen); |
|
223 | static_cast<QAbstractGraphicsShapeItem*>(item)->setPen(pen); | |
218 | } |
|
224 | } | |
219 |
|
225 | |||
220 | void ScatterChartItem::setBrush(const QBrush &brush) |
|
226 | void ScatterChartItem::setBrush(const QBrush &brush) | |
221 | { |
|
227 | { | |
222 | foreach (QGraphicsItem *item , m_items.childItems()) |
|
228 | foreach (QGraphicsItem *item , m_items.childItems()) | |
223 | static_cast<QAbstractGraphicsShapeItem*>(item)->setBrush(brush); |
|
229 | static_cast<QAbstractGraphicsShapeItem*>(item)->setBrush(brush); | |
224 | } |
|
230 | } | |
225 |
|
231 | |||
226 | void ScatterChartItem::handleUpdated() |
|
232 | void ScatterChartItem::handleUpdated() | |
227 | { |
|
233 | { | |
228 | int count = m_items.childItems().count(); |
|
234 | int count = m_items.childItems().count(); | |
229 |
|
235 | |||
230 | if (count == 0) |
|
236 | if (count == 0) | |
231 | return; |
|
237 | return; | |
232 |
|
238 | |||
233 | bool recreate = m_visible != m_series->isVisible() |
|
239 | bool recreate = m_visible != m_series->isVisible() | |
234 | || m_size != m_series->markerSize() |
|
240 | || m_size != m_series->markerSize() | |
235 | || m_shape != m_series->markerShape(); |
|
241 | || m_shape != m_series->markerShape(); | |
236 |
|
242 | |||
237 | m_visible = m_series->isVisible(); |
|
243 | m_visible = m_series->isVisible(); | |
238 | m_size = m_series->markerSize(); |
|
244 | m_size = m_series->markerSize(); | |
239 | m_shape = m_series->markerShape(); |
|
245 | m_shape = m_series->markerShape(); | |
240 | setOpacity(m_series->opacity()); |
|
246 | setOpacity(m_series->opacity()); | |
241 | m_pointLabelsFormat = m_series->pointLabelsFormat(); |
|
247 | m_pointLabelsFormat = m_series->pointLabelsFormat(); | |
242 | m_pointLabelsVisible = m_series->pointLabelsVisible(); |
|
248 | m_pointLabelsVisible = m_series->pointLabelsVisible(); | |
243 | m_pointLabelsFont = m_series->pointLabelsFont(); |
|
249 | m_pointLabelsFont = m_series->pointLabelsFont(); | |
244 | m_pointLabelsColor = m_series->pointLabelsColor(); |
|
250 | m_pointLabelsColor = m_series->pointLabelsColor(); | |
|
251 | m_pointLabelsClipping = m_series->pointLabelsClipping(); | |||
245 |
|
252 | |||
246 | if (recreate) { |
|
253 | if (recreate) { | |
247 | deletePoints(count); |
|
254 | deletePoints(count); | |
248 | createPoints(count); |
|
255 | createPoints(count); | |
249 |
|
256 | |||
250 | // Updating geometry is now safe, because it won't call handleUpdated unless it creates/deletes points |
|
257 | // Updating geometry is now safe, because it won't call handleUpdated unless it creates/deletes points | |
251 | updateGeometry(); |
|
258 | updateGeometry(); | |
252 | } |
|
259 | } | |
253 |
|
260 | |||
254 | setPen(m_series->pen()); |
|
261 | setPen(m_series->pen()); | |
255 | setBrush(m_series->brush()); |
|
262 | setBrush(m_series->brush()); | |
256 | update(); |
|
263 | update(); | |
257 | } |
|
264 | } | |
258 |
|
265 | |||
259 | #include "moc_scatterchartitem_p.cpp" |
|
266 | #include "moc_scatterchartitem_p.cpp" | |
260 |
|
267 | |||
261 | QT_CHARTS_END_NAMESPACE |
|
268 | QT_CHARTS_END_NAMESPACE |
@@ -1,189 +1,190 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
3 | ** Copyright (C) 2015 The Qt Company Ltd | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Charts module. |
|
7 | ** This file is part of the Qt Charts module. | |
8 | ** |
|
8 | ** | |
9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
9 | ** Licensees holding valid commercial license for Qt may use this file in | |
10 | ** accordance with the Qt License Agreement provided with the Software |
|
10 | ** accordance with the Qt License Agreement provided with the Software | |
11 | ** or, alternatively, in accordance with the terms contained in a written |
|
11 | ** or, alternatively, in accordance with the terms contained in a written | |
12 | ** agreement between you and The Qt Company. |
|
12 | ** agreement between you and The Qt Company. | |
13 | ** |
|
13 | ** | |
14 | ** If you have questions regarding the use of this file, please use |
|
14 | ** If you have questions regarding the use of this file, please use | |
15 | ** contact form at http://qt.io |
|
15 | ** contact form at http://qt.io | |
16 | ** |
|
16 | ** | |
17 | ****************************************************************************/ |
|
17 | ****************************************************************************/ | |
18 |
|
18 | |||
19 | // W A R N I N G |
|
19 | // W A R N I N G | |
20 | // ------------- |
|
20 | // ------------- | |
21 | // |
|
21 | // | |
22 | // This file is not part of the Qt Chart API. It exists purely as an |
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
23 | // implementation detail. This header file may change from version to |
|
23 | // implementation detail. This header file may change from version to | |
24 | // version without notice, or even be removed. |
|
24 | // version without notice, or even be removed. | |
25 | // |
|
25 | // | |
26 | // We mean it. |
|
26 | // We mean it. | |
27 |
|
27 | |||
28 | #ifndef SCATTERCHARTITEM_H |
|
28 | #ifndef SCATTERCHARTITEM_H | |
29 | #define SCATTERCHARTITEM_H |
|
29 | #define SCATTERCHARTITEM_H | |
30 |
|
30 | |||
31 | #include <QtCharts/QChartGlobal> |
|
31 | #include <QtCharts/QChartGlobal> | |
32 | #include <private/xychart_p.h> |
|
32 | #include <private/xychart_p.h> | |
33 | #include <QtWidgets/QGraphicsEllipseItem> |
|
33 | #include <QtWidgets/QGraphicsEllipseItem> | |
34 | #include <QtGui/QPen> |
|
34 | #include <QtGui/QPen> | |
35 | #include <QtWidgets/QGraphicsSceneMouseEvent> |
|
35 | #include <QtWidgets/QGraphicsSceneMouseEvent> | |
36 |
|
36 | |||
37 | QT_CHARTS_BEGIN_NAMESPACE |
|
37 | QT_CHARTS_BEGIN_NAMESPACE | |
38 |
|
38 | |||
39 | class QScatterSeries; |
|
39 | class QScatterSeries; | |
40 |
|
40 | |||
41 | class ScatterChartItem : public XYChart |
|
41 | class ScatterChartItem : public XYChart | |
42 | { |
|
42 | { | |
43 | Q_OBJECT |
|
43 | Q_OBJECT | |
44 | Q_INTERFACES(QGraphicsItem) |
|
44 | Q_INTERFACES(QGraphicsItem) | |
45 | public: |
|
45 | public: | |
46 | explicit ScatterChartItem(QScatterSeries *series, QGraphicsItem *item = 0); |
|
46 | explicit ScatterChartItem(QScatterSeries *series, QGraphicsItem *item = 0); | |
47 |
|
47 | |||
48 | public: |
|
48 | public: | |
49 | //from QGraphicsItem |
|
49 | //from QGraphicsItem | |
50 | QRectF boundingRect() const; |
|
50 | QRectF boundingRect() const; | |
51 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); |
|
51 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); | |
52 |
|
52 | |||
53 | void setPen(const QPen &pen); |
|
53 | void setPen(const QPen &pen); | |
54 | void setBrush(const QBrush &brush); |
|
54 | void setBrush(const QBrush &brush); | |
55 |
|
55 | |||
56 | void markerSelected(QGraphicsItem *item); |
|
56 | void markerSelected(QGraphicsItem *item); | |
57 | void markerHovered(QGraphicsItem *item, bool state); |
|
57 | void markerHovered(QGraphicsItem *item, bool state); | |
58 | void markerPressed(QGraphicsItem *item); |
|
58 | void markerPressed(QGraphicsItem *item); | |
59 | void markerReleased(QGraphicsItem *item); |
|
59 | void markerReleased(QGraphicsItem *item); | |
60 | void markerDoubleClicked(QGraphicsItem *item); |
|
60 | void markerDoubleClicked(QGraphicsItem *item); | |
61 |
|
61 | |||
62 | void setMousePressed(bool pressed = true) {m_mousePressed = pressed;} |
|
62 | void setMousePressed(bool pressed = true) {m_mousePressed = pressed;} | |
63 | bool mousePressed() {return m_mousePressed;} |
|
63 | bool mousePressed() {return m_mousePressed;} | |
64 |
|
64 | |||
65 |
|
65 | |||
66 | public Q_SLOTS: |
|
66 | public Q_SLOTS: | |
67 | void handleUpdated(); |
|
67 | void handleUpdated(); | |
68 |
|
68 | |||
69 | private: |
|
69 | private: | |
70 | void createPoints(int count); |
|
70 | void createPoints(int count); | |
71 | void deletePoints(int count); |
|
71 | void deletePoints(int count); | |
72 |
|
72 | |||
73 | protected: |
|
73 | protected: | |
74 | void updateGeometry(); |
|
74 | void updateGeometry(); | |
75 |
|
75 | |||
76 | private: |
|
76 | private: | |
77 | QScatterSeries *m_series; |
|
77 | QScatterSeries *m_series; | |
78 | QGraphicsItemGroup m_items; |
|
78 | QGraphicsItemGroup m_items; | |
79 | bool m_visible; |
|
79 | bool m_visible; | |
80 | int m_shape; |
|
80 | int m_shape; | |
81 | int m_size; |
|
81 | int m_size; | |
82 | QRectF m_rect; |
|
82 | QRectF m_rect; | |
83 | QMap<QGraphicsItem *, QPointF> m_markerMap; |
|
83 | QMap<QGraphicsItem *, QPointF> m_markerMap; | |
84 |
|
84 | |||
85 | bool m_pointLabelsVisible; |
|
85 | bool m_pointLabelsVisible; | |
86 | QString m_pointLabelsFormat; |
|
86 | QString m_pointLabelsFormat; | |
87 | QFont m_pointLabelsFont; |
|
87 | QFont m_pointLabelsFont; | |
88 | QColor m_pointLabelsColor; |
|
88 | QColor m_pointLabelsColor; | |
|
89 | bool m_pointLabelsClipping; | |||
89 |
|
90 | |||
90 | bool m_mousePressed; |
|
91 | bool m_mousePressed; | |
91 | }; |
|
92 | }; | |
92 |
|
93 | |||
93 | class CircleMarker: public QGraphicsEllipseItem |
|
94 | class CircleMarker: public QGraphicsEllipseItem | |
94 | { |
|
95 | { | |
95 |
|
96 | |||
96 | public: |
|
97 | public: | |
97 | CircleMarker(qreal x, qreal y, qreal w, qreal h, ScatterChartItem *parent) |
|
98 | CircleMarker(qreal x, qreal y, qreal w, qreal h, ScatterChartItem *parent) | |
98 | : QGraphicsEllipseItem(x, y, w, h, parent), |
|
99 | : QGraphicsEllipseItem(x, y, w, h, parent), | |
99 | m_parent(parent) |
|
100 | m_parent(parent) | |
100 | { |
|
101 | { | |
101 | setAcceptHoverEvents(true); |
|
102 | setAcceptHoverEvents(true); | |
102 | setFlag(QGraphicsItem::ItemIsSelectable); |
|
103 | setFlag(QGraphicsItem::ItemIsSelectable); | |
103 | } |
|
104 | } | |
104 |
|
105 | |||
105 | protected: |
|
106 | protected: | |
106 | void mousePressEvent(QGraphicsSceneMouseEvent *event) |
|
107 | void mousePressEvent(QGraphicsSceneMouseEvent *event) | |
107 | { |
|
108 | { | |
108 | QGraphicsEllipseItem::mousePressEvent(event); |
|
109 | QGraphicsEllipseItem::mousePressEvent(event); | |
109 | m_parent->markerPressed(this); |
|
110 | m_parent->markerPressed(this); | |
110 | m_parent->setMousePressed(); |
|
111 | m_parent->setMousePressed(); | |
111 | } |
|
112 | } | |
112 | void hoverEnterEvent(QGraphicsSceneHoverEvent *event) |
|
113 | void hoverEnterEvent(QGraphicsSceneHoverEvent *event) | |
113 | { |
|
114 | { | |
114 | QGraphicsEllipseItem::hoverEnterEvent(event); |
|
115 | QGraphicsEllipseItem::hoverEnterEvent(event); | |
115 | m_parent->markerHovered(this, true); |
|
116 | m_parent->markerHovered(this, true); | |
116 | } |
|
117 | } | |
117 | void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) |
|
118 | void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) | |
118 | { |
|
119 | { | |
119 | QGraphicsEllipseItem::hoverLeaveEvent(event); |
|
120 | QGraphicsEllipseItem::hoverLeaveEvent(event); | |
120 | m_parent->markerHovered(this, false); |
|
121 | m_parent->markerHovered(this, false); | |
121 | } |
|
122 | } | |
122 | void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) |
|
123 | void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) | |
123 | { |
|
124 | { | |
124 | QGraphicsEllipseItem::mouseReleaseEvent(event); |
|
125 | QGraphicsEllipseItem::mouseReleaseEvent(event); | |
125 | m_parent->markerReleased(this); |
|
126 | m_parent->markerReleased(this); | |
126 | if (m_parent->mousePressed()) |
|
127 | if (m_parent->mousePressed()) | |
127 | m_parent->markerSelected(this); |
|
128 | m_parent->markerSelected(this); | |
128 | m_parent->setMousePressed(false); |
|
129 | m_parent->setMousePressed(false); | |
129 | } |
|
130 | } | |
130 | void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) |
|
131 | void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) | |
131 | { |
|
132 | { | |
132 | QGraphicsEllipseItem::mouseDoubleClickEvent(event); |
|
133 | QGraphicsEllipseItem::mouseDoubleClickEvent(event); | |
133 | m_parent->markerDoubleClicked(this); |
|
134 | m_parent->markerDoubleClicked(this); | |
134 | } |
|
135 | } | |
135 |
|
136 | |||
136 | private: |
|
137 | private: | |
137 | ScatterChartItem *m_parent; |
|
138 | ScatterChartItem *m_parent; | |
138 | }; |
|
139 | }; | |
139 |
|
140 | |||
140 | class RectangleMarker: public QGraphicsRectItem |
|
141 | class RectangleMarker: public QGraphicsRectItem | |
141 | { |
|
142 | { | |
142 |
|
143 | |||
143 | public: |
|
144 | public: | |
144 | RectangleMarker(qreal x, qreal y, qreal w, qreal h, ScatterChartItem *parent) |
|
145 | RectangleMarker(qreal x, qreal y, qreal w, qreal h, ScatterChartItem *parent) | |
145 | : QGraphicsRectItem(x, y, w, h, parent), |
|
146 | : QGraphicsRectItem(x, y, w, h, parent), | |
146 | m_parent(parent) |
|
147 | m_parent(parent) | |
147 | { |
|
148 | { | |
148 | setAcceptHoverEvents(true); |
|
149 | setAcceptHoverEvents(true); | |
149 | setFlag(QGraphicsItem::ItemIsSelectable); |
|
150 | setFlag(QGraphicsItem::ItemIsSelectable); | |
150 | } |
|
151 | } | |
151 |
|
152 | |||
152 | protected: |
|
153 | protected: | |
153 | void mousePressEvent(QGraphicsSceneMouseEvent *event) |
|
154 | void mousePressEvent(QGraphicsSceneMouseEvent *event) | |
154 | { |
|
155 | { | |
155 | QGraphicsRectItem::mousePressEvent(event); |
|
156 | QGraphicsRectItem::mousePressEvent(event); | |
156 | m_parent->markerPressed(this); |
|
157 | m_parent->markerPressed(this); | |
157 | m_parent->setMousePressed(); |
|
158 | m_parent->setMousePressed(); | |
158 | } |
|
159 | } | |
159 | void hoverEnterEvent(QGraphicsSceneHoverEvent *event) |
|
160 | void hoverEnterEvent(QGraphicsSceneHoverEvent *event) | |
160 | { |
|
161 | { | |
161 | QGraphicsRectItem::hoverEnterEvent(event); |
|
162 | QGraphicsRectItem::hoverEnterEvent(event); | |
162 | m_parent->markerHovered(this, true); |
|
163 | m_parent->markerHovered(this, true); | |
163 | } |
|
164 | } | |
164 | void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) |
|
165 | void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) | |
165 | { |
|
166 | { | |
166 | QGraphicsRectItem::hoverLeaveEvent(event); |
|
167 | QGraphicsRectItem::hoverLeaveEvent(event); | |
167 | m_parent->markerHovered(this, false); |
|
168 | m_parent->markerHovered(this, false); | |
168 | } |
|
169 | } | |
169 | void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) |
|
170 | void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) | |
170 | { |
|
171 | { | |
171 | QGraphicsRectItem::mouseReleaseEvent(event); |
|
172 | QGraphicsRectItem::mouseReleaseEvent(event); | |
172 | m_parent->markerReleased(this); |
|
173 | m_parent->markerReleased(this); | |
173 | if (m_parent->mousePressed()) |
|
174 | if (m_parent->mousePressed()) | |
174 | m_parent->markerSelected(this); |
|
175 | m_parent->markerSelected(this); | |
175 | m_parent->setMousePressed(false); |
|
176 | m_parent->setMousePressed(false); | |
176 | } |
|
177 | } | |
177 | void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) |
|
178 | void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) | |
178 | { |
|
179 | { | |
179 | QGraphicsRectItem::mouseDoubleClickEvent(event); |
|
180 | QGraphicsRectItem::mouseDoubleClickEvent(event); | |
180 | m_parent->markerDoubleClicked(this); |
|
181 | m_parent->markerDoubleClicked(this); | |
181 | } |
|
182 | } | |
182 |
|
183 | |||
183 | private: |
|
184 | private: | |
184 | ScatterChartItem *m_parent; |
|
185 | ScatterChartItem *m_parent; | |
185 | }; |
|
186 | }; | |
186 |
|
187 | |||
187 | QT_CHARTS_END_NAMESPACE |
|
188 | QT_CHARTS_END_NAMESPACE | |
188 |
|
189 | |||
189 | #endif // SCATTERPRESENTER_H |
|
190 | #endif // SCATTERPRESENTER_H |
@@ -1,506 +1,514 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
3 | ** Copyright (C) 2015 The Qt Company Ltd | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Charts module. |
|
7 | ** This file is part of the Qt Charts module. | |
8 | ** |
|
8 | ** | |
9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
9 | ** Licensees holding valid commercial license for Qt may use this file in | |
10 | ** accordance with the Qt License Agreement provided with the Software |
|
10 | ** accordance with the Qt License Agreement provided with the Software | |
11 | ** or, alternatively, in accordance with the terms contained in a written |
|
11 | ** or, alternatively, in accordance with the terms contained in a written | |
12 | ** agreement between you and The Qt Company. |
|
12 | ** agreement between you and The Qt Company. | |
13 | ** |
|
13 | ** | |
14 | ** If you have questions regarding the use of this file, please use |
|
14 | ** If you have questions regarding the use of this file, please use | |
15 | ** contact form at http://qt.io |
|
15 | ** contact form at http://qt.io | |
16 | ** |
|
16 | ** | |
17 | ****************************************************************************/ |
|
17 | ****************************************************************************/ | |
18 |
|
18 | |||
19 | #include <private/splinechartitem_p.h> |
|
19 | #include <private/splinechartitem_p.h> | |
20 | #include <private/qsplineseries_p.h> |
|
20 | #include <private/qsplineseries_p.h> | |
21 | #include <private/chartpresenter_p.h> |
|
21 | #include <private/chartpresenter_p.h> | |
22 | #include <private/splineanimation_p.h> |
|
22 | #include <private/splineanimation_p.h> | |
23 | #include <private/polardomain_p.h> |
|
23 | #include <private/polardomain_p.h> | |
24 | #include <QtGui/QPainter> |
|
24 | #include <QtGui/QPainter> | |
25 | #include <QtWidgets/QGraphicsSceneMouseEvent> |
|
25 | #include <QtWidgets/QGraphicsSceneMouseEvent> | |
26 |
|
26 | |||
27 | QT_CHARTS_BEGIN_NAMESPACE |
|
27 | QT_CHARTS_BEGIN_NAMESPACE | |
28 |
|
28 | |||
29 | SplineChartItem::SplineChartItem(QSplineSeries *series, QGraphicsItem *item) |
|
29 | SplineChartItem::SplineChartItem(QSplineSeries *series, QGraphicsItem *item) | |
30 | : XYChart(series,item), |
|
30 | : XYChart(series,item), | |
31 | m_series(series), |
|
31 | m_series(series), | |
32 | m_pointsVisible(false), |
|
32 | m_pointsVisible(false), | |
33 | m_animation(0), |
|
33 | m_animation(0), | |
34 | m_pointLabelsVisible(false), |
|
34 | m_pointLabelsVisible(false), | |
35 | m_pointLabelsFormat(series->pointLabelsFormat()), |
|
35 | m_pointLabelsFormat(series->pointLabelsFormat()), | |
36 | m_pointLabelsFont(series->pointLabelsFont()), |
|
36 | m_pointLabelsFont(series->pointLabelsFont()), | |
37 | m_pointLabelsColor(series->pointLabelsColor()), |
|
37 | m_pointLabelsColor(series->pointLabelsColor()), | |
|
38 | m_pointLabelsClipping(true), | |||
38 | m_mousePressed(false) |
|
39 | m_mousePressed(false) | |
39 | { |
|
40 | { | |
40 | setAcceptHoverEvents(true); |
|
41 | setAcceptHoverEvents(true); | |
41 | setFlag(QGraphicsItem::ItemIsSelectable); |
|
42 | setFlag(QGraphicsItem::ItemIsSelectable); | |
42 | setZValue(ChartPresenter::SplineChartZValue); |
|
43 | setZValue(ChartPresenter::SplineChartZValue); | |
43 | QObject::connect(m_series->d_func(), SIGNAL(updated()), this, SLOT(handleUpdated())); |
|
44 | QObject::connect(m_series->d_func(), SIGNAL(updated()), this, SLOT(handleUpdated())); | |
44 | QObject::connect(series, SIGNAL(visibleChanged()), this, SLOT(handleUpdated())); |
|
45 | QObject::connect(series, SIGNAL(visibleChanged()), this, SLOT(handleUpdated())); | |
45 | QObject::connect(series, SIGNAL(opacityChanged()), this, SLOT(handleUpdated())); |
|
46 | QObject::connect(series, SIGNAL(opacityChanged()), this, SLOT(handleUpdated())); | |
46 | QObject::connect(series, SIGNAL(pointLabelsFormatChanged(QString)), |
|
47 | QObject::connect(series, SIGNAL(pointLabelsFormatChanged(QString)), | |
47 | this, SLOT(handleUpdated())); |
|
48 | this, SLOT(handleUpdated())); | |
48 | QObject::connect(series, SIGNAL(pointLabelsVisibilityChanged(bool)), |
|
49 | QObject::connect(series, SIGNAL(pointLabelsVisibilityChanged(bool)), | |
49 | this, SLOT(handleUpdated())); |
|
50 | this, SLOT(handleUpdated())); | |
50 | QObject::connect(series, SIGNAL(pointLabelsFontChanged(QFont)), this, SLOT(handleUpdated())); |
|
51 | QObject::connect(series, SIGNAL(pointLabelsFontChanged(QFont)), this, SLOT(handleUpdated())); | |
51 | QObject::connect(series, SIGNAL(pointLabelsColorChanged(QColor)), this, SLOT(handleUpdated())); |
|
52 | QObject::connect(series, SIGNAL(pointLabelsColorChanged(QColor)), this, SLOT(handleUpdated())); | |
|
53 | QObject::connect(series, SIGNAL(pointLabelsClippingChanged(bool)), this, SLOT(handleUpdated())); | |||
52 | handleUpdated(); |
|
54 | handleUpdated(); | |
53 | } |
|
55 | } | |
54 |
|
56 | |||
55 | QRectF SplineChartItem::boundingRect() const |
|
57 | QRectF SplineChartItem::boundingRect() const | |
56 | { |
|
58 | { | |
57 | return m_rect; |
|
59 | return m_rect; | |
58 | } |
|
60 | } | |
59 |
|
61 | |||
60 | QPainterPath SplineChartItem::shape() const |
|
62 | QPainterPath SplineChartItem::shape() const | |
61 | { |
|
63 | { | |
62 | return m_fullPath; |
|
64 | return m_fullPath; | |
63 | } |
|
65 | } | |
64 |
|
66 | |||
65 | void SplineChartItem::setAnimation(SplineAnimation *animation) |
|
67 | void SplineChartItem::setAnimation(SplineAnimation *animation) | |
66 | { |
|
68 | { | |
67 | m_animation = animation; |
|
69 | m_animation = animation; | |
68 | XYChart::setAnimation(animation); |
|
70 | XYChart::setAnimation(animation); | |
69 | } |
|
71 | } | |
70 |
|
72 | |||
71 | ChartAnimation *SplineChartItem::animation() const |
|
73 | ChartAnimation *SplineChartItem::animation() const | |
72 | { |
|
74 | { | |
73 | return m_animation; |
|
75 | return m_animation; | |
74 | } |
|
76 | } | |
75 |
|
77 | |||
76 | void SplineChartItem::setControlGeometryPoints(QVector<QPointF>& points) |
|
78 | void SplineChartItem::setControlGeometryPoints(QVector<QPointF>& points) | |
77 | { |
|
79 | { | |
78 | m_controlPoints = points; |
|
80 | m_controlPoints = points; | |
79 | } |
|
81 | } | |
80 |
|
82 | |||
81 | QVector<QPointF> SplineChartItem::controlGeometryPoints() const |
|
83 | QVector<QPointF> SplineChartItem::controlGeometryPoints() const | |
82 | { |
|
84 | { | |
83 | return m_controlPoints; |
|
85 | return m_controlPoints; | |
84 | } |
|
86 | } | |
85 |
|
87 | |||
86 | void SplineChartItem::updateChart(QVector<QPointF> &oldPoints, QVector<QPointF> &newPoints, int index) |
|
88 | void SplineChartItem::updateChart(QVector<QPointF> &oldPoints, QVector<QPointF> &newPoints, int index) | |
87 | { |
|
89 | { | |
88 | QVector<QPointF> controlPoints; |
|
90 | QVector<QPointF> controlPoints; | |
89 | if (newPoints.count() >= 2) |
|
91 | if (newPoints.count() >= 2) | |
90 | controlPoints = calculateControlPoints(newPoints); |
|
92 | controlPoints = calculateControlPoints(newPoints); | |
91 |
|
93 | |||
92 | if (m_animation) |
|
94 | if (m_animation) | |
93 | m_animation->setup(oldPoints, newPoints, m_controlPoints, controlPoints, index); |
|
95 | m_animation->setup(oldPoints, newPoints, m_controlPoints, controlPoints, index); | |
94 |
|
96 | |||
95 | m_points = newPoints; |
|
97 | m_points = newPoints; | |
96 | m_controlPoints = controlPoints; |
|
98 | m_controlPoints = controlPoints; | |
97 | setDirty(false); |
|
99 | setDirty(false); | |
98 |
|
100 | |||
99 | if (m_animation) |
|
101 | if (m_animation) | |
100 | presenter()->startAnimation(m_animation); |
|
102 | presenter()->startAnimation(m_animation); | |
101 | else |
|
103 | else | |
102 | updateGeometry(); |
|
104 | updateGeometry(); | |
103 | } |
|
105 | } | |
104 |
|
106 | |||
105 | void SplineChartItem::updateGeometry() |
|
107 | void SplineChartItem::updateGeometry() | |
106 | { |
|
108 | { | |
107 | const QVector<QPointF> &points = m_points; |
|
109 | const QVector<QPointF> &points = m_points; | |
108 | const QVector<QPointF> &controlPoints = m_controlPoints; |
|
110 | const QVector<QPointF> &controlPoints = m_controlPoints; | |
109 |
|
111 | |||
110 | if ((points.size() < 2) || (controlPoints.size() < 2)) { |
|
112 | if ((points.size() < 2) || (controlPoints.size() < 2)) { | |
111 | prepareGeometryChange(); |
|
113 | prepareGeometryChange(); | |
112 | m_path = QPainterPath(); |
|
114 | m_path = QPainterPath(); | |
113 | m_rect = QRect(); |
|
115 | m_rect = QRect(); | |
114 | return; |
|
116 | return; | |
115 | } |
|
117 | } | |
116 |
|
118 | |||
117 | Q_ASSERT(points.count() * 2 - 2 == controlPoints.count()); |
|
119 | Q_ASSERT(points.count() * 2 - 2 == controlPoints.count()); | |
118 |
|
120 | |||
119 | QPainterPath splinePath; |
|
121 | QPainterPath splinePath; | |
120 | QPainterPath fullPath; |
|
122 | QPainterPath fullPath; | |
121 | // Use worst case scenario to determine required margin. |
|
123 | // Use worst case scenario to determine required margin. | |
122 | qreal margin = m_linePen.width() * 1.42; |
|
124 | qreal margin = m_linePen.width() * 1.42; | |
123 |
|
125 | |||
124 | if (m_series->chart()->chartType() == QChart::ChartTypePolar) { |
|
126 | if (m_series->chart()->chartType() == QChart::ChartTypePolar) { | |
125 | QPainterPath splinePathLeft; |
|
127 | QPainterPath splinePathLeft; | |
126 | QPainterPath splinePathRight; |
|
128 | QPainterPath splinePathRight; | |
127 | QPainterPath *currentSegmentPath = 0; |
|
129 | QPainterPath *currentSegmentPath = 0; | |
128 | QPainterPath *previousSegmentPath = 0; |
|
130 | QPainterPath *previousSegmentPath = 0; | |
129 | qreal minX = domain()->minX(); |
|
131 | qreal minX = domain()->minX(); | |
130 | qreal maxX = domain()->maxX(); |
|
132 | qreal maxX = domain()->maxX(); | |
131 | qreal minY = domain()->minY(); |
|
133 | qreal minY = domain()->minY(); | |
132 | QPointF currentSeriesPoint = m_series->at(0); |
|
134 | QPointF currentSeriesPoint = m_series->at(0); | |
133 | QPointF currentGeometryPoint = points.at(0); |
|
135 | QPointF currentGeometryPoint = points.at(0); | |
134 | QPointF previousGeometryPoint = points.at(0); |
|
136 | QPointF previousGeometryPoint = points.at(0); | |
135 | bool pointOffGrid = false; |
|
137 | bool pointOffGrid = false; | |
136 | bool previousPointWasOffGrid = (currentSeriesPoint.x() < minX || currentSeriesPoint.x() > maxX); |
|
138 | bool previousPointWasOffGrid = (currentSeriesPoint.x() < minX || currentSeriesPoint.x() > maxX); | |
137 | m_visiblePoints.clear(); |
|
139 | m_visiblePoints.clear(); | |
138 | m_visiblePoints.reserve(points.size()); |
|
140 | m_visiblePoints.reserve(points.size()); | |
139 |
|
141 | |||
140 | qreal domainRadius = domain()->size().height() / 2.0; |
|
142 | qreal domainRadius = domain()->size().height() / 2.0; | |
141 | const QPointF centerPoint(domainRadius, domainRadius); |
|
143 | const QPointF centerPoint(domainRadius, domainRadius); | |
142 |
|
144 | |||
143 | if (!previousPointWasOffGrid) { |
|
145 | if (!previousPointWasOffGrid) { | |
144 | fullPath.moveTo(points.at(0)); |
|
146 | fullPath.moveTo(points.at(0)); | |
145 | // Do not draw points for points below minimum Y. |
|
147 | // Do not draw points for points below minimum Y. | |
146 | if (m_pointsVisible && currentSeriesPoint.y() >= minY) |
|
148 | if (m_pointsVisible && currentSeriesPoint.y() >= minY) | |
147 | m_visiblePoints.append(currentGeometryPoint); |
|
149 | m_visiblePoints.append(currentGeometryPoint); | |
148 | } |
|
150 | } | |
149 |
|
151 | |||
150 | qreal leftMarginLine = centerPoint.x() - margin; |
|
152 | qreal leftMarginLine = centerPoint.x() - margin; | |
151 | qreal rightMarginLine = centerPoint.x() + margin; |
|
153 | qreal rightMarginLine = centerPoint.x() + margin; | |
152 | qreal horizontal = centerPoint.y(); |
|
154 | qreal horizontal = centerPoint.y(); | |
153 |
|
155 | |||
154 | // See ScatterChartItem::updateGeometry() for explanation why seriesLastIndex is needed |
|
156 | // See ScatterChartItem::updateGeometry() for explanation why seriesLastIndex is needed | |
155 | const int seriesLastIndex = m_series->count() - 1; |
|
157 | const int seriesLastIndex = m_series->count() - 1; | |
156 |
|
158 | |||
157 | for (int i = 1; i < points.size(); i++) { |
|
159 | for (int i = 1; i < points.size(); i++) { | |
158 | // Interpolating spline fragments accurately is not trivial, and would anyway be ugly |
|
160 | // Interpolating spline fragments accurately is not trivial, and would anyway be ugly | |
159 | // when thick pen is used, so we work around it by utilizing three separate |
|
161 | // when thick pen is used, so we work around it by utilizing three separate | |
160 | // paths for spline segments and clip those with custom regions at paint time. |
|
162 | // paths for spline segments and clip those with custom regions at paint time. | |
161 | // "Right" path contains segments that cross the axis line with visible point on the |
|
163 | // "Right" path contains segments that cross the axis line with visible point on the | |
162 | // right side of the axis line, as well as segments that have one point within the margin |
|
164 | // right side of the axis line, as well as segments that have one point within the margin | |
163 | // on the right side of the axis line and another point on the right side of the chart. |
|
165 | // on the right side of the axis line and another point on the right side of the chart. | |
164 | // "Left" path contains points with similarly on the left side. |
|
166 | // "Left" path contains points with similarly on the left side. | |
165 | // "Full" path contains rest of the points. |
|
167 | // "Full" path contains rest of the points. | |
166 | // This doesn't yield perfect results always. E.g. when segment covers more than 90 |
|
168 | // This doesn't yield perfect results always. E.g. when segment covers more than 90 | |
167 | // degrees and both of the points are within the margin, one in the top half and one in the |
|
169 | // degrees and both of the points are within the margin, one in the top half and one in the | |
168 | // bottom half of the chart, the bottom one gets clipped incorrectly. |
|
170 | // bottom half of the chart, the bottom one gets clipped incorrectly. | |
169 | // However, this should be rare occurrence in any sensible chart. |
|
171 | // However, this should be rare occurrence in any sensible chart. | |
170 | currentSeriesPoint = m_series->at(qMin(seriesLastIndex, i)); |
|
172 | currentSeriesPoint = m_series->at(qMin(seriesLastIndex, i)); | |
171 | currentGeometryPoint = points.at(i); |
|
173 | currentGeometryPoint = points.at(i); | |
172 | pointOffGrid = (currentSeriesPoint.x() < minX || currentSeriesPoint.x() > maxX); |
|
174 | pointOffGrid = (currentSeriesPoint.x() < minX || currentSeriesPoint.x() > maxX); | |
173 |
|
175 | |||
174 | // Draw something unless both off-grid |
|
176 | // Draw something unless both off-grid | |
175 | if (!pointOffGrid || !previousPointWasOffGrid) { |
|
177 | if (!pointOffGrid || !previousPointWasOffGrid) { | |
176 | bool dummyOk; // We know points are ok, but this is needed |
|
178 | bool dummyOk; // We know points are ok, but this is needed | |
177 | qreal currentAngle = static_cast<PolarDomain *>(domain())->toAngularCoordinate(currentSeriesPoint.x(), dummyOk); |
|
179 | qreal currentAngle = static_cast<PolarDomain *>(domain())->toAngularCoordinate(currentSeriesPoint.x(), dummyOk); | |
178 | qreal previousAngle = static_cast<PolarDomain *>(domain())->toAngularCoordinate(m_series->at(i - 1).x(), dummyOk); |
|
180 | qreal previousAngle = static_cast<PolarDomain *>(domain())->toAngularCoordinate(m_series->at(i - 1).x(), dummyOk); | |
179 |
|
181 | |||
180 | if ((qAbs(currentAngle - previousAngle) > 180.0)) { |
|
182 | if ((qAbs(currentAngle - previousAngle) > 180.0)) { | |
181 | // If the angle between two points is over 180 degrees (half X range), |
|
183 | // If the angle between two points is over 180 degrees (half X range), | |
182 | // any direct segment between them becomes meaningless. |
|
184 | // any direct segment between them becomes meaningless. | |
183 | // In this case two line segments are drawn instead, from previous |
|
185 | // In this case two line segments are drawn instead, from previous | |
184 | // point to the center and from center to current point. |
|
186 | // point to the center and from center to current point. | |
185 | if ((previousAngle < 0.0 || (previousAngle <= 180.0 && previousGeometryPoint.x() < rightMarginLine)) |
|
187 | if ((previousAngle < 0.0 || (previousAngle <= 180.0 && previousGeometryPoint.x() < rightMarginLine)) | |
186 | && previousGeometryPoint.y() < horizontal) { |
|
188 | && previousGeometryPoint.y() < horizontal) { | |
187 | currentSegmentPath = &splinePathRight; |
|
189 | currentSegmentPath = &splinePathRight; | |
188 | } else if ((previousAngle > 360.0 || (previousAngle > 180.0 && previousGeometryPoint.x() > leftMarginLine)) |
|
190 | } else if ((previousAngle > 360.0 || (previousAngle > 180.0 && previousGeometryPoint.x() > leftMarginLine)) | |
189 | && previousGeometryPoint.y() < horizontal) { |
|
191 | && previousGeometryPoint.y() < horizontal) { | |
190 | currentSegmentPath = &splinePathLeft; |
|
192 | currentSegmentPath = &splinePathLeft; | |
191 | } else if (previousAngle > 0.0 && previousAngle < 360.0) { |
|
193 | } else if (previousAngle > 0.0 && previousAngle < 360.0) { | |
192 | currentSegmentPath = &splinePath; |
|
194 | currentSegmentPath = &splinePath; | |
193 | } else { |
|
195 | } else { | |
194 | currentSegmentPath = 0; |
|
196 | currentSegmentPath = 0; | |
195 | } |
|
197 | } | |
196 |
|
198 | |||
197 | if (currentSegmentPath) { |
|
199 | if (currentSegmentPath) { | |
198 | if (previousSegmentPath != currentSegmentPath) |
|
200 | if (previousSegmentPath != currentSegmentPath) | |
199 | currentSegmentPath->moveTo(previousGeometryPoint); |
|
201 | currentSegmentPath->moveTo(previousGeometryPoint); | |
200 | if (!previousSegmentPath) |
|
202 | if (!previousSegmentPath) | |
201 | fullPath.moveTo(previousGeometryPoint); |
|
203 | fullPath.moveTo(previousGeometryPoint); | |
202 |
|
204 | |||
203 | currentSegmentPath->lineTo(centerPoint); |
|
205 | currentSegmentPath->lineTo(centerPoint); | |
204 | fullPath.lineTo(centerPoint); |
|
206 | fullPath.lineTo(centerPoint); | |
205 | } |
|
207 | } | |
206 |
|
208 | |||
207 | previousSegmentPath = currentSegmentPath; |
|
209 | previousSegmentPath = currentSegmentPath; | |
208 |
|
210 | |||
209 | if ((currentAngle < 0.0 || (currentAngle <= 180.0 && currentGeometryPoint.x() < rightMarginLine)) |
|
211 | if ((currentAngle < 0.0 || (currentAngle <= 180.0 && currentGeometryPoint.x() < rightMarginLine)) | |
210 | && currentGeometryPoint.y() < horizontal) { |
|
212 | && currentGeometryPoint.y() < horizontal) { | |
211 | currentSegmentPath = &splinePathRight; |
|
213 | currentSegmentPath = &splinePathRight; | |
212 | } else if ((currentAngle > 360.0 || (currentAngle > 180.0 &¤tGeometryPoint.x() > leftMarginLine)) |
|
214 | } else if ((currentAngle > 360.0 || (currentAngle > 180.0 &¤tGeometryPoint.x() > leftMarginLine)) | |
213 | && currentGeometryPoint.y() < horizontal) { |
|
215 | && currentGeometryPoint.y() < horizontal) { | |
214 | currentSegmentPath = &splinePathLeft; |
|
216 | currentSegmentPath = &splinePathLeft; | |
215 | } else if (currentAngle > 0.0 && currentAngle < 360.0) { |
|
217 | } else if (currentAngle > 0.0 && currentAngle < 360.0) { | |
216 | currentSegmentPath = &splinePath; |
|
218 | currentSegmentPath = &splinePath; | |
217 | } else { |
|
219 | } else { | |
218 | currentSegmentPath = 0; |
|
220 | currentSegmentPath = 0; | |
219 | } |
|
221 | } | |
220 |
|
222 | |||
221 | if (currentSegmentPath) { |
|
223 | if (currentSegmentPath) { | |
222 | if (previousSegmentPath != currentSegmentPath) |
|
224 | if (previousSegmentPath != currentSegmentPath) | |
223 | currentSegmentPath->moveTo(centerPoint); |
|
225 | currentSegmentPath->moveTo(centerPoint); | |
224 | if (!previousSegmentPath) |
|
226 | if (!previousSegmentPath) | |
225 | fullPath.moveTo(centerPoint); |
|
227 | fullPath.moveTo(centerPoint); | |
226 |
|
228 | |||
227 | currentSegmentPath->lineTo(currentGeometryPoint); |
|
229 | currentSegmentPath->lineTo(currentGeometryPoint); | |
228 | fullPath.lineTo(currentGeometryPoint); |
|
230 | fullPath.lineTo(currentGeometryPoint); | |
229 | } |
|
231 | } | |
230 | } else { |
|
232 | } else { | |
231 | QPointF cp1 = controlPoints[2 * (i - 1)]; |
|
233 | QPointF cp1 = controlPoints[2 * (i - 1)]; | |
232 | QPointF cp2 = controlPoints[(2 * i) - 1]; |
|
234 | QPointF cp2 = controlPoints[(2 * i) - 1]; | |
233 |
|
235 | |||
234 | if (previousAngle < 0.0 || currentAngle < 0.0 |
|
236 | if (previousAngle < 0.0 || currentAngle < 0.0 | |
235 | || ((previousAngle <= 180.0 && currentAngle <= 180.0) |
|
237 | || ((previousAngle <= 180.0 && currentAngle <= 180.0) | |
236 | && ((previousGeometryPoint.x() < rightMarginLine && previousGeometryPoint.y() < horizontal) |
|
238 | && ((previousGeometryPoint.x() < rightMarginLine && previousGeometryPoint.y() < horizontal) | |
237 | || (currentGeometryPoint.x() < rightMarginLine && currentGeometryPoint.y() < horizontal)))) { |
|
239 | || (currentGeometryPoint.x() < rightMarginLine && currentGeometryPoint.y() < horizontal)))) { | |
238 | currentSegmentPath = &splinePathRight; |
|
240 | currentSegmentPath = &splinePathRight; | |
239 | } else if (previousAngle > 360.0 || currentAngle > 360.0 |
|
241 | } else if (previousAngle > 360.0 || currentAngle > 360.0 | |
240 | || ((previousAngle > 180.0 && currentAngle > 180.0) |
|
242 | || ((previousAngle > 180.0 && currentAngle > 180.0) | |
241 | && ((previousGeometryPoint.x() > leftMarginLine && previousGeometryPoint.y() < horizontal) |
|
243 | && ((previousGeometryPoint.x() > leftMarginLine && previousGeometryPoint.y() < horizontal) | |
242 | || (currentGeometryPoint.x() > leftMarginLine && currentGeometryPoint.y() < horizontal)))) { |
|
244 | || (currentGeometryPoint.x() > leftMarginLine && currentGeometryPoint.y() < horizontal)))) { | |
243 | currentSegmentPath = &splinePathLeft; |
|
245 | currentSegmentPath = &splinePathLeft; | |
244 | } else { |
|
246 | } else { | |
245 | currentSegmentPath = &splinePath; |
|
247 | currentSegmentPath = &splinePath; | |
246 | } |
|
248 | } | |
247 |
|
249 | |||
248 | if (currentSegmentPath != previousSegmentPath) |
|
250 | if (currentSegmentPath != previousSegmentPath) | |
249 | currentSegmentPath->moveTo(previousGeometryPoint); |
|
251 | currentSegmentPath->moveTo(previousGeometryPoint); | |
250 | if (!previousSegmentPath) |
|
252 | if (!previousSegmentPath) | |
251 | fullPath.moveTo(previousGeometryPoint); |
|
253 | fullPath.moveTo(previousGeometryPoint); | |
252 |
|
254 | |||
253 | fullPath.cubicTo(cp1, cp2, currentGeometryPoint); |
|
255 | fullPath.cubicTo(cp1, cp2, currentGeometryPoint); | |
254 | currentSegmentPath->cubicTo(cp1, cp2, currentGeometryPoint); |
|
256 | currentSegmentPath->cubicTo(cp1, cp2, currentGeometryPoint); | |
255 | } |
|
257 | } | |
256 | } else { |
|
258 | } else { | |
257 | currentSegmentPath = 0; |
|
259 | currentSegmentPath = 0; | |
258 | } |
|
260 | } | |
259 |
|
261 | |||
260 | previousPointWasOffGrid = pointOffGrid; |
|
262 | previousPointWasOffGrid = pointOffGrid; | |
261 | if (!pointOffGrid && m_pointsVisible && currentSeriesPoint.y() >= minY) |
|
263 | if (!pointOffGrid && m_pointsVisible && currentSeriesPoint.y() >= minY) | |
262 | m_visiblePoints.append(currentGeometryPoint); |
|
264 | m_visiblePoints.append(currentGeometryPoint); | |
263 | previousSegmentPath = currentSegmentPath; |
|
265 | previousSegmentPath = currentSegmentPath; | |
264 | previousGeometryPoint = currentGeometryPoint; |
|
266 | previousGeometryPoint = currentGeometryPoint; | |
265 | } |
|
267 | } | |
266 |
|
268 | |||
267 | m_pathPolarRight = splinePathRight; |
|
269 | m_pathPolarRight = splinePathRight; | |
268 | m_pathPolarLeft = splinePathLeft; |
|
270 | m_pathPolarLeft = splinePathLeft; | |
269 | // Note: This construction of m_fullpath is not perfect. The partial segments that are |
|
271 | // Note: This construction of m_fullpath is not perfect. The partial segments that are | |
270 | // outside left/right clip regions at axis boundary still generate hover/click events, |
|
272 | // outside left/right clip regions at axis boundary still generate hover/click events, | |
271 | // because shape doesn't get clipped. It doesn't seem possible to do sensibly. |
|
273 | // because shape doesn't get clipped. It doesn't seem possible to do sensibly. | |
272 | } else { // not polar |
|
274 | } else { // not polar | |
273 | splinePath.moveTo(points.at(0)); |
|
275 | splinePath.moveTo(points.at(0)); | |
274 | for (int i = 0; i < points.size() - 1; i++) { |
|
276 | for (int i = 0; i < points.size() - 1; i++) { | |
275 | const QPointF &point = points.at(i + 1); |
|
277 | const QPointF &point = points.at(i + 1); | |
276 | splinePath.cubicTo(controlPoints[2 * i], controlPoints[2 * i + 1], point); |
|
278 | splinePath.cubicTo(controlPoints[2 * i], controlPoints[2 * i + 1], point); | |
277 | } |
|
279 | } | |
278 | fullPath = splinePath; |
|
280 | fullPath = splinePath; | |
279 | } |
|
281 | } | |
280 |
|
282 | |||
281 | QPainterPathStroker stroker; |
|
283 | QPainterPathStroker stroker; | |
282 | // The full path is comprised of three separate paths. |
|
284 | // The full path is comprised of three separate paths. | |
283 | // This is why we are prepared for the "worst case" scenario, i.e. use always MiterJoin and |
|
285 | // This is why we are prepared for the "worst case" scenario, i.e. use always MiterJoin and | |
284 | // multiply line width with square root of two when defining shape and bounding rectangle. |
|
286 | // multiply line width with square root of two when defining shape and bounding rectangle. | |
285 | stroker.setWidth(margin); |
|
287 | stroker.setWidth(margin); | |
286 | stroker.setJoinStyle(Qt::MiterJoin); |
|
288 | stroker.setJoinStyle(Qt::MiterJoin); | |
287 | stroker.setCapStyle(Qt::SquareCap); |
|
289 | stroker.setCapStyle(Qt::SquareCap); | |
288 | stroker.setMiterLimit(m_linePen.miterLimit()); |
|
290 | stroker.setMiterLimit(m_linePen.miterLimit()); | |
289 |
|
291 | |||
290 | // Only zoom in if the bounding rects of the path fit inside int limits. QWidget::update() uses |
|
292 | // Only zoom in if the bounding rects of the path fit inside int limits. QWidget::update() uses | |
291 | // a region that has to be compatible with QRect. |
|
293 | // a region that has to be compatible with QRect. | |
292 | QPainterPath checkShapePath = stroker.createStroke(fullPath); |
|
294 | QPainterPath checkShapePath = stroker.createStroke(fullPath); | |
293 | if (checkShapePath.boundingRect().height() <= INT_MAX |
|
295 | if (checkShapePath.boundingRect().height() <= INT_MAX | |
294 | && checkShapePath.boundingRect().width() <= INT_MAX |
|
296 | && checkShapePath.boundingRect().width() <= INT_MAX | |
295 | && splinePath.boundingRect().height() <= INT_MAX |
|
297 | && splinePath.boundingRect().height() <= INT_MAX | |
296 | && splinePath.boundingRect().width() <= INT_MAX) { |
|
298 | && splinePath.boundingRect().width() <= INT_MAX) { | |
297 | m_path = splinePath; |
|
299 | m_path = splinePath; | |
298 |
|
300 | |||
299 | prepareGeometryChange(); |
|
301 | prepareGeometryChange(); | |
300 |
|
302 | |||
301 | m_fullPath = checkShapePath; |
|
303 | m_fullPath = checkShapePath; | |
302 | m_rect = m_fullPath.boundingRect(); |
|
304 | m_rect = m_fullPath.boundingRect(); | |
303 | } |
|
305 | } | |
304 | } |
|
306 | } | |
305 |
|
307 | |||
306 | /*! |
|
308 | /*! | |
307 | Calculates control points which are needed by QPainterPath.cubicTo function to draw the cubic Bezier cureve between two points. |
|
309 | Calculates control points which are needed by QPainterPath.cubicTo function to draw the cubic Bezier cureve between two points. | |
308 | */ |
|
310 | */ | |
309 | QVector<QPointF> SplineChartItem::calculateControlPoints(const QVector<QPointF> &points) |
|
311 | QVector<QPointF> SplineChartItem::calculateControlPoints(const QVector<QPointF> &points) | |
310 | { |
|
312 | { | |
311 | QVector<QPointF> controlPoints; |
|
313 | QVector<QPointF> controlPoints; | |
312 | controlPoints.resize(points.count() * 2 - 2); |
|
314 | controlPoints.resize(points.count() * 2 - 2); | |
313 |
|
315 | |||
314 | int n = points.count() - 1; |
|
316 | int n = points.count() - 1; | |
315 |
|
317 | |||
316 | if (n == 1) { |
|
318 | if (n == 1) { | |
317 | //for n==1 |
|
319 | //for n==1 | |
318 | controlPoints[0].setX((2 * points[0].x() + points[1].x()) / 3); |
|
320 | controlPoints[0].setX((2 * points[0].x() + points[1].x()) / 3); | |
319 | controlPoints[0].setY((2 * points[0].y() + points[1].y()) / 3); |
|
321 | controlPoints[0].setY((2 * points[0].y() + points[1].y()) / 3); | |
320 | controlPoints[1].setX(2 * controlPoints[0].x() - points[0].x()); |
|
322 | controlPoints[1].setX(2 * controlPoints[0].x() - points[0].x()); | |
321 | controlPoints[1].setY(2 * controlPoints[0].y() - points[0].y()); |
|
323 | controlPoints[1].setY(2 * controlPoints[0].y() - points[0].y()); | |
322 | return controlPoints; |
|
324 | return controlPoints; | |
323 | } |
|
325 | } | |
324 |
|
326 | |||
325 | // Calculate first Bezier control points |
|
327 | // Calculate first Bezier control points | |
326 | // Set of equations for P0 to Pn points. |
|
328 | // Set of equations for P0 to Pn points. | |
327 | // |
|
329 | // | |
328 | // | 2 1 0 0 ... 0 0 0 ... 0 0 0 | | P1_1 | | P0 + 2 * P1 | |
|
330 | // | 2 1 0 0 ... 0 0 0 ... 0 0 0 | | P1_1 | | P0 + 2 * P1 | | |
329 | // | 1 4 1 0 ... 0 0 0 ... 0 0 0 | | P1_2 | | 4 * P1 + 2 * P2 | |
|
331 | // | 1 4 1 0 ... 0 0 0 ... 0 0 0 | | P1_2 | | 4 * P1 + 2 * P2 | | |
330 | // | 0 1 4 1 ... 0 0 0 ... 0 0 0 | | P1_3 | | 4 * P2 + 2 * P3 | |
|
332 | // | 0 1 4 1 ... 0 0 0 ... 0 0 0 | | P1_3 | | 4 * P2 + 2 * P3 | | |
331 | // | . . . . . . . . . . . . | | ... | | ... | |
|
333 | // | . . . . . . . . . . . . | | ... | | ... | | |
332 | // | 0 0 0 0 ... 1 4 1 ... 0 0 0 | * | P1_i | = | 4 * P(i-1) + 2 * Pi | |
|
334 | // | 0 0 0 0 ... 1 4 1 ... 0 0 0 | * | P1_i | = | 4 * P(i-1) + 2 * Pi | | |
333 | // | . . . . . . . . . . . . | | ... | | ... | |
|
335 | // | . . . . . . . . . . . . | | ... | | ... | | |
334 | // | 0 0 0 0 0 0 0 0 ... 1 4 1 | | P1_(n-1)| | 4 * P(n-2) + 2 * P(n-1) | |
|
336 | // | 0 0 0 0 0 0 0 0 ... 1 4 1 | | P1_(n-1)| | 4 * P(n-2) + 2 * P(n-1) | | |
335 | // | 0 0 0 0 0 0 0 0 ... 0 2 7 | | P1_n | | 8 * P(n-1) + Pn | |
|
337 | // | 0 0 0 0 0 0 0 0 ... 0 2 7 | | P1_n | | 8 * P(n-1) + Pn | | |
336 | // |
|
338 | // | |
337 | QVector<qreal> vector; |
|
339 | QVector<qreal> vector; | |
338 | vector.resize(n); |
|
340 | vector.resize(n); | |
339 |
|
341 | |||
340 | vector[0] = points[0].x() + 2 * points[1].x(); |
|
342 | vector[0] = points[0].x() + 2 * points[1].x(); | |
341 |
|
343 | |||
342 |
|
344 | |||
343 | for (int i = 1; i < n - 1; ++i) |
|
345 | for (int i = 1; i < n - 1; ++i) | |
344 | vector[i] = 4 * points[i].x() + 2 * points[i + 1].x(); |
|
346 | vector[i] = 4 * points[i].x() + 2 * points[i + 1].x(); | |
345 |
|
347 | |||
346 | vector[n - 1] = (8 * points[n - 1].x() + points[n].x()) / 2.0; |
|
348 | vector[n - 1] = (8 * points[n - 1].x() + points[n].x()) / 2.0; | |
347 |
|
349 | |||
348 | QVector<qreal> xControl = firstControlPoints(vector); |
|
350 | QVector<qreal> xControl = firstControlPoints(vector); | |
349 |
|
351 | |||
350 | vector[0] = points[0].y() + 2 * points[1].y(); |
|
352 | vector[0] = points[0].y() + 2 * points[1].y(); | |
351 |
|
353 | |||
352 | for (int i = 1; i < n - 1; ++i) |
|
354 | for (int i = 1; i < n - 1; ++i) | |
353 | vector[i] = 4 * points[i].y() + 2 * points[i + 1].y(); |
|
355 | vector[i] = 4 * points[i].y() + 2 * points[i + 1].y(); | |
354 |
|
356 | |||
355 | vector[n - 1] = (8 * points[n - 1].y() + points[n].y()) / 2.0; |
|
357 | vector[n - 1] = (8 * points[n - 1].y() + points[n].y()) / 2.0; | |
356 |
|
358 | |||
357 | QVector<qreal> yControl = firstControlPoints(vector); |
|
359 | QVector<qreal> yControl = firstControlPoints(vector); | |
358 |
|
360 | |||
359 | for (int i = 0, j = 0; i < n; ++i, ++j) { |
|
361 | for (int i = 0, j = 0; i < n; ++i, ++j) { | |
360 |
|
362 | |||
361 | controlPoints[j].setX(xControl[i]); |
|
363 | controlPoints[j].setX(xControl[i]); | |
362 | controlPoints[j].setY(yControl[i]); |
|
364 | controlPoints[j].setY(yControl[i]); | |
363 |
|
365 | |||
364 | j++; |
|
366 | j++; | |
365 |
|
367 | |||
366 | if (i < n - 1) { |
|
368 | if (i < n - 1) { | |
367 | controlPoints[j].setX(2 * points[i + 1].x() - xControl[i + 1]); |
|
369 | controlPoints[j].setX(2 * points[i + 1].x() - xControl[i + 1]); | |
368 | controlPoints[j].setY(2 * points[i + 1].y() - yControl[i + 1]); |
|
370 | controlPoints[j].setY(2 * points[i + 1].y() - yControl[i + 1]); | |
369 | } else { |
|
371 | } else { | |
370 | controlPoints[j].setX((points[n].x() + xControl[n - 1]) / 2); |
|
372 | controlPoints[j].setX((points[n].x() + xControl[n - 1]) / 2); | |
371 | controlPoints[j].setY((points[n].y() + yControl[n - 1]) / 2); |
|
373 | controlPoints[j].setY((points[n].y() + yControl[n - 1]) / 2); | |
372 | } |
|
374 | } | |
373 | } |
|
375 | } | |
374 | return controlPoints; |
|
376 | return controlPoints; | |
375 | } |
|
377 | } | |
376 |
|
378 | |||
377 | QVector<qreal> SplineChartItem::firstControlPoints(const QVector<qreal>& vector) |
|
379 | QVector<qreal> SplineChartItem::firstControlPoints(const QVector<qreal>& vector) | |
378 | { |
|
380 | { | |
379 | QVector<qreal> result; |
|
381 | QVector<qreal> result; | |
380 |
|
382 | |||
381 | int count = vector.count(); |
|
383 | int count = vector.count(); | |
382 | result.resize(count); |
|
384 | result.resize(count); | |
383 | result[0] = vector[0] / 2.0; |
|
385 | result[0] = vector[0] / 2.0; | |
384 |
|
386 | |||
385 | QVector<qreal> temp; |
|
387 | QVector<qreal> temp; | |
386 | temp.resize(count); |
|
388 | temp.resize(count); | |
387 | temp[0] = 0; |
|
389 | temp[0] = 0; | |
388 |
|
390 | |||
389 | qreal b = 2.0; |
|
391 | qreal b = 2.0; | |
390 |
|
392 | |||
391 | for (int i = 1; i < count; i++) { |
|
393 | for (int i = 1; i < count; i++) { | |
392 | temp[i] = 1 / b; |
|
394 | temp[i] = 1 / b; | |
393 | b = (i < count - 1 ? 4.0 : 3.5) - temp[i]; |
|
395 | b = (i < count - 1 ? 4.0 : 3.5) - temp[i]; | |
394 | result[i] = (vector[i] - result[i - 1]) / b; |
|
396 | result[i] = (vector[i] - result[i - 1]) / b; | |
395 | } |
|
397 | } | |
396 |
|
398 | |||
397 | for (int i = 1; i < count; i++) |
|
399 | for (int i = 1; i < count; i++) | |
398 | result[count - i - 1] -= temp[count - i] * result[count - i]; |
|
400 | result[count - i - 1] -= temp[count - i] * result[count - i]; | |
399 |
|
401 | |||
400 | return result; |
|
402 | return result; | |
401 | } |
|
403 | } | |
402 |
|
404 | |||
403 | //handlers |
|
405 | //handlers | |
404 |
|
406 | |||
405 | void SplineChartItem::handleUpdated() |
|
407 | void SplineChartItem::handleUpdated() | |
406 | { |
|
408 | { | |
407 | setVisible(m_series->isVisible()); |
|
409 | setVisible(m_series->isVisible()); | |
408 | setOpacity(m_series->opacity()); |
|
410 | setOpacity(m_series->opacity()); | |
409 | m_pointsVisible = m_series->pointsVisible(); |
|
411 | m_pointsVisible = m_series->pointsVisible(); | |
410 | m_linePen = m_series->pen(); |
|
412 | m_linePen = m_series->pen(); | |
411 | m_pointPen = m_series->pen(); |
|
413 | m_pointPen = m_series->pen(); | |
412 | m_pointPen.setWidthF(2 * m_pointPen.width()); |
|
414 | m_pointPen.setWidthF(2 * m_pointPen.width()); | |
413 | m_pointLabelsFormat = m_series->pointLabelsFormat(); |
|
415 | m_pointLabelsFormat = m_series->pointLabelsFormat(); | |
414 | m_pointLabelsVisible = m_series->pointLabelsVisible(); |
|
416 | m_pointLabelsVisible = m_series->pointLabelsVisible(); | |
415 | m_pointLabelsFont = m_series->pointLabelsFont(); |
|
417 | m_pointLabelsFont = m_series->pointLabelsFont(); | |
416 | m_pointLabelsColor = m_series->pointLabelsColor(); |
|
418 | m_pointLabelsColor = m_series->pointLabelsColor(); | |
|
419 | m_pointLabelsClipping = m_series->pointLabelsClipping(); | |||
417 | update(); |
|
420 | update(); | |
418 | } |
|
421 | } | |
419 |
|
422 | |||
420 | //painter |
|
423 | //painter | |
421 |
|
424 | |||
422 | void SplineChartItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) |
|
425 | void SplineChartItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) | |
423 | { |
|
426 | { | |
424 | Q_UNUSED(widget) |
|
427 | Q_UNUSED(widget) | |
425 | Q_UNUSED(option) |
|
428 | Q_UNUSED(option) | |
426 |
|
429 | |||
427 | QRectF clipRect = QRectF(QPointF(0, 0), domain()->size()); |
|
430 | QRectF clipRect = QRectF(QPointF(0, 0), domain()->size()); | |
428 |
|
431 | |||
429 | painter->save(); |
|
432 | painter->save(); | |
430 | painter->setPen(m_linePen); |
|
433 | painter->setPen(m_linePen); | |
431 | painter->setBrush(Qt::NoBrush); |
|
434 | painter->setBrush(Qt::NoBrush); | |
432 |
|
435 | |||
433 | if (m_series->chart()->chartType() == QChart::ChartTypePolar) { |
|
436 | if (m_series->chart()->chartType() == QChart::ChartTypePolar) { | |
434 | qreal halfWidth = domain()->size().width() / 2.0; |
|
437 | qreal halfWidth = domain()->size().width() / 2.0; | |
435 | QRectF clipRectLeft = QRectF(0, 0, halfWidth, domain()->size().height()); |
|
438 | QRectF clipRectLeft = QRectF(0, 0, halfWidth, domain()->size().height()); | |
436 | QRectF clipRectRight = QRectF(halfWidth, 0, halfWidth, domain()->size().height()); |
|
439 | QRectF clipRectRight = QRectF(halfWidth, 0, halfWidth, domain()->size().height()); | |
437 | QRegion fullPolarClipRegion(clipRect.toRect(), QRegion::Ellipse); |
|
440 | QRegion fullPolarClipRegion(clipRect.toRect(), QRegion::Ellipse); | |
438 | QRegion clipRegionLeft(fullPolarClipRegion.intersected(clipRectLeft.toRect())); |
|
441 | QRegion clipRegionLeft(fullPolarClipRegion.intersected(clipRectLeft.toRect())); | |
439 | QRegion clipRegionRight(fullPolarClipRegion.intersected(clipRectRight.toRect())); |
|
442 | QRegion clipRegionRight(fullPolarClipRegion.intersected(clipRectRight.toRect())); | |
440 | painter->setClipRegion(clipRegionLeft); |
|
443 | painter->setClipRegion(clipRegionLeft); | |
441 | painter->drawPath(m_pathPolarLeft); |
|
444 | painter->drawPath(m_pathPolarLeft); | |
442 | painter->setClipRegion(clipRegionRight); |
|
445 | painter->setClipRegion(clipRegionRight); | |
443 | painter->drawPath(m_pathPolarRight); |
|
446 | painter->drawPath(m_pathPolarRight); | |
444 | painter->setClipRegion(fullPolarClipRegion); |
|
447 | painter->setClipRegion(fullPolarClipRegion); | |
445 | } else { |
|
448 | } else { | |
446 | painter->setClipRect(clipRect); |
|
449 | painter->setClipRect(clipRect); | |
447 | } |
|
450 | } | |
448 |
|
451 | |||
449 | reversePainter(painter, clipRect); |
|
452 | reversePainter(painter, clipRect); | |
450 |
|
453 | |||
451 | painter->drawPath(m_path); |
|
454 | painter->drawPath(m_path); | |
452 |
|
455 | |||
453 | if (m_pointsVisible) { |
|
456 | if (m_pointsVisible) { | |
454 | painter->setPen(m_pointPen); |
|
457 | painter->setPen(m_pointPen); | |
455 | if (m_series->chart()->chartType() == QChart::ChartTypePolar) |
|
458 | if (m_series->chart()->chartType() == QChart::ChartTypePolar) | |
456 | painter->drawPoints(m_visiblePoints); |
|
459 | painter->drawPoints(m_visiblePoints); | |
457 | else |
|
460 | else | |
458 | painter->drawPoints(geometryPoints()); |
|
461 | painter->drawPoints(geometryPoints()); | |
459 | } |
|
462 | } | |
460 |
|
463 | |||
461 | reversePainter(painter, clipRect); |
|
464 | reversePainter(painter, clipRect); | |
462 |
|
465 | |||
463 | if (m_pointLabelsVisible) |
|
466 | if (m_pointLabelsVisible) { | |
|
467 | if (m_pointLabelsClipping) | |||
|
468 | painter->setClipping(true); | |||
|
469 | else | |||
|
470 | painter->setClipping(false); | |||
464 | m_series->d_func()->drawSeriesPointLabels(painter, m_points, m_linePen.width() / 2); |
|
471 | m_series->d_func()->drawSeriesPointLabels(painter, m_points, m_linePen.width() / 2); | |
|
472 | } | |||
465 |
|
473 | |||
466 | painter->restore(); |
|
474 | painter->restore(); | |
467 | } |
|
475 | } | |
468 |
|
476 | |||
469 | void SplineChartItem::mousePressEvent(QGraphicsSceneMouseEvent *event) |
|
477 | void SplineChartItem::mousePressEvent(QGraphicsSceneMouseEvent *event) | |
470 | { |
|
478 | { | |
471 | emit XYChart::pressed(domain()->calculateDomainPoint(event->pos())); |
|
479 | emit XYChart::pressed(domain()->calculateDomainPoint(event->pos())); | |
472 | m_lastMousePos = event->pos(); |
|
480 | m_lastMousePos = event->pos(); | |
473 | m_mousePressed = true; |
|
481 | m_mousePressed = true; | |
474 | QGraphicsItem::mousePressEvent(event); |
|
482 | QGraphicsItem::mousePressEvent(event); | |
475 | } |
|
483 | } | |
476 |
|
484 | |||
477 | void SplineChartItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event) |
|
485 | void SplineChartItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event) | |
478 | { |
|
486 | { | |
479 | emit XYChart::hovered(domain()->calculateDomainPoint(event->pos()), true); |
|
487 | emit XYChart::hovered(domain()->calculateDomainPoint(event->pos()), true); | |
480 | QGraphicsItem::hoverEnterEvent(event); |
|
488 | QGraphicsItem::hoverEnterEvent(event); | |
481 | } |
|
489 | } | |
482 |
|
490 | |||
483 | void SplineChartItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) |
|
491 | void SplineChartItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) | |
484 | { |
|
492 | { | |
485 | emit XYChart::hovered(domain()->calculateDomainPoint(event->pos()), false); |
|
493 | emit XYChart::hovered(domain()->calculateDomainPoint(event->pos()), false); | |
486 | QGraphicsItem::hoverLeaveEvent(event); |
|
494 | QGraphicsItem::hoverLeaveEvent(event); | |
487 | } |
|
495 | } | |
488 |
|
496 | |||
489 | void SplineChartItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) |
|
497 | void SplineChartItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) | |
490 | { |
|
498 | { | |
491 | emit XYChart::released(domain()->calculateDomainPoint(m_lastMousePos)); |
|
499 | emit XYChart::released(domain()->calculateDomainPoint(m_lastMousePos)); | |
492 | if (m_mousePressed) |
|
500 | if (m_mousePressed) | |
493 | emit XYChart::clicked(domain()->calculateDomainPoint(m_lastMousePos)); |
|
501 | emit XYChart::clicked(domain()->calculateDomainPoint(m_lastMousePos)); | |
494 | m_mousePressed = false; |
|
502 | m_mousePressed = false; | |
495 | QGraphicsItem::mouseReleaseEvent(event); |
|
503 | QGraphicsItem::mouseReleaseEvent(event); | |
496 | } |
|
504 | } | |
497 |
|
505 | |||
498 | void SplineChartItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) |
|
506 | void SplineChartItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) | |
499 | { |
|
507 | { | |
500 | emit XYChart::doubleClicked(domain()->calculateDomainPoint(m_lastMousePos)); |
|
508 | emit XYChart::doubleClicked(domain()->calculateDomainPoint(m_lastMousePos)); | |
501 | QGraphicsItem::mouseDoubleClickEvent(event); |
|
509 | QGraphicsItem::mouseDoubleClickEvent(event); | |
502 | } |
|
510 | } | |
503 |
|
511 | |||
504 | #include "moc_splinechartitem_p.cpp" |
|
512 | #include "moc_splinechartitem_p.cpp" | |
505 |
|
513 | |||
506 | QT_CHARTS_END_NAMESPACE |
|
514 | QT_CHARTS_END_NAMESPACE |
@@ -1,97 +1,98 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
3 | ** Copyright (C) 2015 The Qt Company Ltd | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Charts module. |
|
7 | ** This file is part of the Qt Charts module. | |
8 | ** |
|
8 | ** | |
9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
9 | ** Licensees holding valid commercial license for Qt may use this file in | |
10 | ** accordance with the Qt License Agreement provided with the Software |
|
10 | ** accordance with the Qt License Agreement provided with the Software | |
11 | ** or, alternatively, in accordance with the terms contained in a written |
|
11 | ** or, alternatively, in accordance with the terms contained in a written | |
12 | ** agreement between you and The Qt Company. |
|
12 | ** agreement between you and The Qt Company. | |
13 | ** |
|
13 | ** | |
14 | ** If you have questions regarding the use of this file, please use |
|
14 | ** If you have questions regarding the use of this file, please use | |
15 | ** contact form at http://qt.io |
|
15 | ** contact form at http://qt.io | |
16 | ** |
|
16 | ** | |
17 | ****************************************************************************/ |
|
17 | ****************************************************************************/ | |
18 |
|
18 | |||
19 | // W A R N I N G |
|
19 | // W A R N I N G | |
20 | // ------------- |
|
20 | // ------------- | |
21 | // |
|
21 | // | |
22 | // This file is not part of the Qt Chart API. It exists purely as an |
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
23 | // implementation detail. This header file may change from version to |
|
23 | // implementation detail. This header file may change from version to | |
24 | // version without notice, or even be removed. |
|
24 | // version without notice, or even be removed. | |
25 | // |
|
25 | // | |
26 | // We mean it. |
|
26 | // We mean it. | |
27 |
|
27 | |||
28 | #ifndef SPLINECHARTITEM_P_H |
|
28 | #ifndef SPLINECHARTITEM_P_H | |
29 | #define SPLINECHARTITEM_P_H |
|
29 | #define SPLINECHARTITEM_P_H | |
30 |
|
30 | |||
31 | #include <QtCharts/QSplineSeries> |
|
31 | #include <QtCharts/QSplineSeries> | |
32 | #include <private/xychart_p.h> |
|
32 | #include <private/xychart_p.h> | |
33 |
|
33 | |||
34 | QT_CHARTS_BEGIN_NAMESPACE |
|
34 | QT_CHARTS_BEGIN_NAMESPACE | |
35 |
|
35 | |||
36 | class SplineAnimation; |
|
36 | class SplineAnimation; | |
37 |
|
37 | |||
38 | class SplineChartItem : public XYChart |
|
38 | class SplineChartItem : public XYChart | |
39 | { |
|
39 | { | |
40 | Q_OBJECT |
|
40 | Q_OBJECT | |
41 | Q_INTERFACES(QGraphicsItem) |
|
41 | Q_INTERFACES(QGraphicsItem) | |
42 | public: |
|
42 | public: | |
43 | SplineChartItem(QSplineSeries *series, QGraphicsItem *item = 0); |
|
43 | SplineChartItem(QSplineSeries *series, QGraphicsItem *item = 0); | |
44 |
|
44 | |||
45 | //from QGraphicsItem |
|
45 | //from QGraphicsItem | |
46 | QRectF boundingRect() const; |
|
46 | QRectF boundingRect() const; | |
47 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); |
|
47 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); | |
48 | QPainterPath shape() const; |
|
48 | QPainterPath shape() const; | |
49 |
|
49 | |||
50 | void setControlGeometryPoints(QVector<QPointF>& points); |
|
50 | void setControlGeometryPoints(QVector<QPointF>& points); | |
51 | QVector<QPointF> controlGeometryPoints() const; |
|
51 | QVector<QPointF> controlGeometryPoints() const; | |
52 |
|
52 | |||
53 | void setAnimation(SplineAnimation *animation); |
|
53 | void setAnimation(SplineAnimation *animation); | |
54 | ChartAnimation *animation() const; |
|
54 | ChartAnimation *animation() const; | |
55 |
|
55 | |||
56 | public Q_SLOTS: |
|
56 | public Q_SLOTS: | |
57 | void handleUpdated(); |
|
57 | void handleUpdated(); | |
58 |
|
58 | |||
59 | protected: |
|
59 | protected: | |
60 | void updateGeometry(); |
|
60 | void updateGeometry(); | |
61 | QVector<QPointF> calculateControlPoints(const QVector<QPointF> &points); |
|
61 | QVector<QPointF> calculateControlPoints(const QVector<QPointF> &points); | |
62 | QVector<qreal> firstControlPoints(const QVector<qreal>& vector); |
|
62 | QVector<qreal> firstControlPoints(const QVector<qreal>& vector); | |
63 | void updateChart(QVector<QPointF> &oldPoints, QVector<QPointF> &newPoints, int index); |
|
63 | void updateChart(QVector<QPointF> &oldPoints, QVector<QPointF> &newPoints, int index); | |
64 | void mousePressEvent(QGraphicsSceneMouseEvent *event); |
|
64 | void mousePressEvent(QGraphicsSceneMouseEvent *event); | |
65 | void hoverEnterEvent(QGraphicsSceneHoverEvent *event); |
|
65 | void hoverEnterEvent(QGraphicsSceneHoverEvent *event); | |
66 | void hoverLeaveEvent(QGraphicsSceneHoverEvent *event); |
|
66 | void hoverLeaveEvent(QGraphicsSceneHoverEvent *event); | |
67 | void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); |
|
67 | void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); | |
68 | void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event); |
|
68 | void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event); | |
69 |
|
69 | |||
70 | private: |
|
70 | private: | |
71 | QSplineSeries *m_series; |
|
71 | QSplineSeries *m_series; | |
72 | QPainterPath m_path; |
|
72 | QPainterPath m_path; | |
73 | QPainterPath m_pathPolarRight; |
|
73 | QPainterPath m_pathPolarRight; | |
74 | QPainterPath m_pathPolarLeft; |
|
74 | QPainterPath m_pathPolarLeft; | |
75 | QPainterPath m_fullPath; |
|
75 | QPainterPath m_fullPath; | |
76 | QRectF m_rect; |
|
76 | QRectF m_rect; | |
77 | QPen m_linePen; |
|
77 | QPen m_linePen; | |
78 | QPen m_pointPen; |
|
78 | QPen m_pointPen; | |
79 | bool m_pointsVisible; |
|
79 | bool m_pointsVisible; | |
80 | QVector<QPointF> m_controlPoints; |
|
80 | QVector<QPointF> m_controlPoints; | |
81 | QVector<QPointF> m_visiblePoints; |
|
81 | QVector<QPointF> m_visiblePoints; | |
82 | SplineAnimation *m_animation; |
|
82 | SplineAnimation *m_animation; | |
83 |
|
83 | |||
84 | bool m_pointLabelsVisible; |
|
84 | bool m_pointLabelsVisible; | |
85 | QString m_pointLabelsFormat; |
|
85 | QString m_pointLabelsFormat; | |
86 | QFont m_pointLabelsFont; |
|
86 | QFont m_pointLabelsFont; | |
87 | QColor m_pointLabelsColor; |
|
87 | QColor m_pointLabelsColor; | |
|
88 | bool m_pointLabelsClipping; | |||
88 |
|
89 | |||
89 | QPointF m_lastMousePos; |
|
90 | QPointF m_lastMousePos; | |
90 | bool m_mousePressed; |
|
91 | bool m_mousePressed; | |
91 |
|
92 | |||
92 | friend class SplineAnimation; |
|
93 | friend class SplineAnimation; | |
93 | }; |
|
94 | }; | |
94 |
|
95 | |||
95 | QT_CHARTS_END_NAMESPACE |
|
96 | QT_CHARTS_END_NAMESPACE | |
96 |
|
97 | |||
97 | #endif // SPLINECHARTITEM_P_H |
|
98 | #endif // SPLINECHARTITEM_P_H |
@@ -1,924 +1,963 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
3 | ** Copyright (C) 2015 The Qt Company Ltd | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Charts module. |
|
7 | ** This file is part of the Qt Charts module. | |
8 | ** |
|
8 | ** | |
9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
9 | ** Licensees holding valid commercial license for Qt may use this file in | |
10 | ** accordance with the Qt License Agreement provided with the Software |
|
10 | ** accordance with the Qt License Agreement provided with the Software | |
11 | ** or, alternatively, in accordance with the terms contained in a written |
|
11 | ** or, alternatively, in accordance with the terms contained in a written | |
12 | ** agreement between you and The Qt Company. |
|
12 | ** agreement between you and The Qt Company. | |
13 | ** |
|
13 | ** | |
14 | ** If you have questions regarding the use of this file, please use |
|
14 | ** If you have questions regarding the use of this file, please use | |
15 | ** contact form at http://qt.io |
|
15 | ** contact form at http://qt.io | |
16 | ** |
|
16 | ** | |
17 | ****************************************************************************/ |
|
17 | ****************************************************************************/ | |
18 |
|
18 | |||
19 | #include <QtCharts/QXYSeries> |
|
19 | #include <QtCharts/QXYSeries> | |
20 | #include <private/qxyseries_p.h> |
|
20 | #include <private/qxyseries_p.h> | |
21 | #include <private/abstractdomain_p.h> |
|
21 | #include <private/abstractdomain_p.h> | |
22 | #include <QtCharts/QValueAxis> |
|
22 | #include <QtCharts/QValueAxis> | |
23 | #include <private/xychart_p.h> |
|
23 | #include <private/xychart_p.h> | |
24 | #include <QtCharts/QXYLegendMarker> |
|
24 | #include <QtCharts/QXYLegendMarker> | |
25 | #include <private/charthelpers_p.h> |
|
25 | #include <private/charthelpers_p.h> | |
26 | #include <private/qchart_p.h> |
|
26 | #include <private/qchart_p.h> | |
27 | #include <QtGui/QPainter> |
|
27 | #include <QtGui/QPainter> | |
28 |
|
28 | |||
29 | QT_CHARTS_BEGIN_NAMESPACE |
|
29 | QT_CHARTS_BEGIN_NAMESPACE | |
30 |
|
30 | |||
31 | /*! |
|
31 | /*! | |
32 | \class QXYSeries |
|
32 | \class QXYSeries | |
33 | \inmodule Qt Charts |
|
33 | \inmodule Qt Charts | |
34 | \brief The QXYSeries class is a base class for line, spline and scatter series. |
|
34 | \brief The QXYSeries class is a base class for line, spline and scatter series. | |
35 | */ |
|
35 | */ | |
36 | /*! |
|
36 | /*! | |
37 | \qmltype XYSeries |
|
37 | \qmltype XYSeries | |
38 | \instantiates QXYSeries |
|
38 | \instantiates QXYSeries | |
39 | \inqmlmodule QtCharts |
|
39 | \inqmlmodule QtCharts | |
40 |
|
40 | |||
41 | \inherits AbstractSeries |
|
41 | \inherits AbstractSeries | |
42 |
|
42 | |||
43 | \brief The XYSeries type is a base type for line, spline and scatter series. |
|
43 | \brief The XYSeries type is a base type for line, spline and scatter series. | |
44 |
|
44 | |||
45 | The XYSeries class is a base class for line, spline and scatter series. |
|
45 | The XYSeries class is a base class for line, spline and scatter series. | |
46 | The class cannot be instantiated directly. |
|
46 | The class cannot be instantiated directly. | |
47 | */ |
|
47 | */ | |
48 |
|
48 | |||
49 | /*! |
|
49 | /*! | |
50 | \qmlproperty AbstractAxis XYSeries::axisX |
|
50 | \qmlproperty AbstractAxis XYSeries::axisX | |
51 | The x axis used for the series. If you leave both axisX and axisXTop undefined, a ValueAxis is created for |
|
51 | The x axis used for the series. If you leave both axisX and axisXTop undefined, a ValueAxis is created for | |
52 | the series. |
|
52 | the series. | |
53 | \sa axisXTop |
|
53 | \sa axisXTop | |
54 | */ |
|
54 | */ | |
55 |
|
55 | |||
56 | /*! |
|
56 | /*! | |
57 | \qmlproperty AbstractAxis XYSeries::axisY |
|
57 | \qmlproperty AbstractAxis XYSeries::axisY | |
58 | The y axis used for the series. If you leave both axisY and axisYRight undefined, a ValueAxis is created for |
|
58 | The y axis used for the series. If you leave both axisY and axisYRight undefined, a ValueAxis is created for | |
59 | the series. |
|
59 | the series. | |
60 | \sa axisYRight |
|
60 | \sa axisYRight | |
61 | */ |
|
61 | */ | |
62 |
|
62 | |||
63 | /*! |
|
63 | /*! | |
64 | \qmlproperty AbstractAxis XYSeries::axisXTop |
|
64 | \qmlproperty AbstractAxis XYSeries::axisXTop | |
65 | The x axis used for the series, drawn on top of the chart view. Note that you can only provide either axisX or |
|
65 | The x axis used for the series, drawn on top of the chart view. Note that you can only provide either axisX or | |
66 | axisXTop, but not both. |
|
66 | axisXTop, but not both. | |
67 | \sa axisX |
|
67 | \sa axisX | |
68 | */ |
|
68 | */ | |
69 |
|
69 | |||
70 | /*! |
|
70 | /*! | |
71 | \qmlproperty AbstractAxis XYSeries::axisYRight |
|
71 | \qmlproperty AbstractAxis XYSeries::axisYRight | |
72 | The y axis used for the series, drawn to the right on the chart view. Note that you can only provide either axisY |
|
72 | The y axis used for the series, drawn to the right on the chart view. Note that you can only provide either axisY | |
73 | or axisYRight, but not both. |
|
73 | or axisYRight, but not both. | |
74 | \sa axisY |
|
74 | \sa axisY | |
75 | */ |
|
75 | */ | |
76 |
|
76 | |||
77 | /*! |
|
77 | /*! | |
78 | \qmlproperty AbstractAxis XYSeries::axisAngular |
|
78 | \qmlproperty AbstractAxis XYSeries::axisAngular | |
79 | The angular axis used for the series, drawn around the polar chart view. |
|
79 | The angular axis used for the series, drawn around the polar chart view. | |
80 | \sa axisX |
|
80 | \sa axisX | |
81 | */ |
|
81 | */ | |
82 |
|
82 | |||
83 | /*! |
|
83 | /*! | |
84 | \qmlproperty AbstractAxis XYSeries::axisRadial |
|
84 | \qmlproperty AbstractAxis XYSeries::axisRadial | |
85 | The radial axis used for the series, drawn inside the polar chart view. |
|
85 | The radial axis used for the series, drawn inside the polar chart view. | |
86 | \sa axisY |
|
86 | \sa axisY | |
87 | */ |
|
87 | */ | |
88 |
|
88 | |||
89 | /*! |
|
89 | /*! | |
90 | \property QXYSeries::pointsVisible |
|
90 | \property QXYSeries::pointsVisible | |
91 | Controls if the data points are visible and should be drawn. |
|
91 | Controls if the data points are visible and should be drawn. | |
92 | */ |
|
92 | */ | |
93 | /*! |
|
93 | /*! | |
94 | \qmlproperty bool XYSeries::pointsVisible |
|
94 | \qmlproperty bool XYSeries::pointsVisible | |
95 | Controls if the data points are visible and should be drawn. |
|
95 | Controls if the data points are visible and should be drawn. | |
96 | */ |
|
96 | */ | |
97 |
|
97 | |||
98 | /*! |
|
98 | /*! | |
99 | \fn QPen QXYSeries::pen() const |
|
99 | \fn QPen QXYSeries::pen() const | |
100 | \brief Returns pen used to draw points for series. |
|
100 | \brief Returns pen used to draw points for series. | |
101 | \sa setPen() |
|
101 | \sa setPen() | |
102 | */ |
|
102 | */ | |
103 |
|
103 | |||
104 | /*! |
|
104 | /*! | |
105 | \fn QBrush QXYSeries::brush() const |
|
105 | \fn QBrush QXYSeries::brush() const | |
106 | \brief Returns brush used to draw points for series. |
|
106 | \brief Returns brush used to draw points for series. | |
107 | \sa setBrush() |
|
107 | \sa setBrush() | |
108 | */ |
|
108 | */ | |
109 |
|
109 | |||
110 | /*! |
|
110 | /*! | |
111 | \property QXYSeries::color |
|
111 | \property QXYSeries::color | |
112 | The color of the series. This is line (pen) color in case of QLineSeries or QSplineSeries and |
|
112 | The color of the series. This is line (pen) color in case of QLineSeries or QSplineSeries and | |
113 | fill (brush) color in case of QScatterSeries or QAreaSeries. |
|
113 | fill (brush) color in case of QScatterSeries or QAreaSeries. | |
114 | \sa pen(), brush() |
|
114 | \sa pen(), brush() | |
115 | */ |
|
115 | */ | |
116 | /*! |
|
116 | /*! | |
117 | \qmlproperty color XYSeries::color |
|
117 | \qmlproperty color XYSeries::color | |
118 | The color of the series. This is line (pen) color in case of LineSeries or SplineSeries and |
|
118 | The color of the series. This is line (pen) color in case of LineSeries or SplineSeries and | |
119 | fill (brush) color in case of ScatterSeries or AreaSeries. |
|
119 | fill (brush) color in case of ScatterSeries or AreaSeries. | |
120 | */ |
|
120 | */ | |
121 |
|
121 | |||
122 | /*! |
|
122 | /*! | |
123 | \property QXYSeries::pointLabelsFormat |
|
123 | \property QXYSeries::pointLabelsFormat | |
124 | The \a format used for showing labels with series points. |
|
124 | The \a format used for showing labels with series points. | |
125 |
|
125 | |||
126 | QXYSeries supports the following format tags: |
|
126 | QXYSeries supports the following format tags: | |
127 | \table |
|
127 | \table | |
128 | \row |
|
128 | \row | |
129 | \li @xPoint \li The x value of the data point |
|
129 | \li @xPoint \li The x value of the data point | |
130 | \row |
|
130 | \row | |
131 | \li @yPoint \li The y value of the data point |
|
131 | \li @yPoint \li The y value of the data point | |
132 | \endtable |
|
132 | \endtable | |
133 |
|
133 | |||
134 | For example, the following usage of the format tags would produce labels that have the data |
|
134 | For example, the following usage of the format tags would produce labels that have the data | |
135 | point (x, y) shown inside brackets separated by a comma: |
|
135 | point (x, y) shown inside brackets separated by a comma: | |
136 | \code |
|
136 | \code | |
137 | series->setPointLabelsFormat("(@xPoint, @yPoint)"); |
|
137 | series->setPointLabelsFormat("(@xPoint, @yPoint)"); | |
138 | \endcode |
|
138 | \endcode | |
139 |
|
139 | |||
140 | By default, the labels format is set to '@xPoint, @yPoint'. The labels are shown on the plot |
|
140 | By default, the labels format is set to '@xPoint, @yPoint'. The labels are shown on the plot | |
141 | area, labels on the edge of the plot area are cut. If the points are close to each other the |
|
141 | area, labels on the edge of the plot area are cut. If the points are close to each other the | |
142 | labels may overlap. |
|
142 | labels may overlap. | |
143 |
|
143 | |||
144 | \sa pointLabelsVisible, pointLabelsFont, pointLabelsColor |
|
144 | \sa pointLabelsVisible, pointLabelsFont, pointLabelsColor | |
145 | */ |
|
145 | */ | |
146 | /*! |
|
146 | /*! | |
147 | \qmlproperty string XYSeries::pointLabelsFormat |
|
147 | \qmlproperty string XYSeries::pointLabelsFormat | |
148 | The \a format used for showing labels with series points. |
|
148 | The \a format used for showing labels with series points. | |
149 |
|
149 | |||
150 | \sa pointLabelsFormat, pointLabelsVisible, pointLabelsFont, pointLabelsColor |
|
150 | \sa pointLabelsFormat, pointLabelsVisible, pointLabelsFont, pointLabelsColor | |
151 | */ |
|
151 | */ | |
152 | /*! |
|
152 | /*! | |
153 | \fn void QXYSeries::pointLabelsFormatChanged(const QString &format) |
|
153 | \fn void QXYSeries::pointLabelsFormatChanged(const QString &format) | |
154 | Signal is emitted when the \a format of data point labels is changed. |
|
154 | Signal is emitted when the \a format of data point labels is changed. | |
155 | */ |
|
155 | */ | |
156 | /*! |
|
156 | /*! | |
157 | \qmlsignal XYSeries::onPointLabelsFormatChanged(string format) |
|
157 | \qmlsignal XYSeries::onPointLabelsFormatChanged(string format) | |
158 | Signal is emitted when the \a format of data point labels is changed. |
|
158 | Signal is emitted when the \a format of data point labels is changed. | |
159 | */ |
|
159 | */ | |
160 |
|
160 | |||
161 | /*! |
|
161 | /*! | |
162 | \property QXYSeries::pointLabelsVisible |
|
162 | \property QXYSeries::pointLabelsVisible | |
163 | Defines the visibility for data point labels. False by default. |
|
163 | Defines the visibility for data point labels. False by default. | |
164 |
|
164 | |||
165 | \sa pointLabelsFormat |
|
165 | \sa pointLabelsFormat, pointLabelsClipping | |
166 | */ |
|
166 | */ | |
167 | /*! |
|
167 | /*! | |
168 | \qmlproperty bool XYSeries::pointLabelsVisible |
|
168 | \qmlproperty bool XYSeries::pointLabelsVisible | |
169 | Defines the visibility for data point labels. |
|
169 | Defines the visibility for data point labels. | |
170 |
|
170 | |||
171 | \sa pointLabelsFormat |
|
171 | \sa pointLabelsFormat, pointLabelsClipping | |
172 | */ |
|
172 | */ | |
173 | /*! |
|
173 | /*! | |
174 | \fn void QXYSeries::pointLabelsVisibilityChanged(bool visible) |
|
174 | \fn void QXYSeries::pointLabelsVisibilityChanged(bool visible) | |
175 | The visibility of the data point labels is changed to \a visible. |
|
175 | The visibility of the data point labels is changed to \a visible. | |
176 | */ |
|
176 | */ | |
177 | /*! |
|
177 | /*! | |
178 | \qmlsignal XYSeries::onPointLabelsVisibilityChanged(bool visible) |
|
178 | \qmlsignal XYSeries::onPointLabelsVisibilityChanged(bool visible) | |
179 | The visibility of the data point labels is changed to \a visible. |
|
179 | The visibility of the data point labels is changed to \a visible. | |
180 | */ |
|
180 | */ | |
181 |
|
181 | |||
182 | /*! |
|
182 | /*! | |
183 | \property QXYSeries::pointLabelsFont |
|
183 | \property QXYSeries::pointLabelsFont | |
184 | Defines the font used for data point labels. |
|
184 | Defines the font used for data point labels. | |
185 |
|
185 | |||
186 | \sa pointLabelsFormat |
|
186 | \sa pointLabelsFormat | |
187 | */ |
|
187 | */ | |
188 | /*! |
|
188 | /*! | |
189 | \qmlproperty font XYSeries::pointLabelsFont |
|
189 | \qmlproperty font XYSeries::pointLabelsFont | |
190 | Defines the font used for data point labels. |
|
190 | Defines the font used for data point labels. | |
191 |
|
191 | |||
192 | \sa pointLabelsFormat |
|
192 | \sa pointLabelsFormat | |
193 | */ |
|
193 | */ | |
194 | /*! |
|
194 | /*! | |
195 | \fn void QXYSeries::pointLabelsFontChanged(const QFont &font); |
|
195 | \fn void QXYSeries::pointLabelsFontChanged(const QFont &font); | |
196 | The font used for data point labels is changed to \a font. |
|
196 | The font used for data point labels is changed to \a font. | |
197 | */ |
|
197 | */ | |
198 | /*! |
|
198 | /*! | |
199 | \qmlsignal XYSeries::onPointLabelsFontChanged(Font font) |
|
199 | \qmlsignal XYSeries::onPointLabelsFontChanged(Font font) | |
200 | The font used for data point labels is changed to \a font. |
|
200 | The font used for data point labels is changed to \a font. | |
201 | */ |
|
201 | */ | |
202 |
|
202 | |||
203 | /*! |
|
203 | /*! | |
204 | \property QXYSeries::pointLabelsColor |
|
204 | \property QXYSeries::pointLabelsColor | |
205 | Defines the color used for data point labels. By default, the color is the color of the brush |
|
205 | Defines the color used for data point labels. By default, the color is the color of the brush | |
206 | defined in theme for labels. |
|
206 | defined in theme for labels. | |
207 |
|
207 | |||
208 | \sa pointLabelsFormat |
|
208 | \sa pointLabelsFormat | |
209 | */ |
|
209 | */ | |
210 | /*! |
|
210 | /*! | |
211 | \qmlproperty font XYSeries::pointLabelsColor |
|
211 | \qmlproperty font XYSeries::pointLabelsColor | |
212 | Defines the color used for data point labels. By default, the color is the color of the brush |
|
212 | Defines the color used for data point labels. By default, the color is the color of the brush | |
213 | defined in theme for labels. |
|
213 | defined in theme for labels. | |
214 |
|
214 | |||
215 | \sa pointLabelsFormat |
|
215 | \sa pointLabelsFormat | |
216 | */ |
|
216 | */ | |
217 | /*! |
|
217 | /*! | |
218 | \fn void QXYSeries::pointLabelsColorChanged(const QColor &color); |
|
218 | \fn void QXYSeries::pointLabelsColorChanged(const QColor &color); | |
219 | The color used for data point labels is changed to \a color. |
|
219 | The color used for data point labels is changed to \a color. | |
220 | */ |
|
220 | */ | |
221 | /*! |
|
221 | /*! | |
222 | \qmlsignal XYSeries::onPointLabelsColorChanged(Color color) |
|
222 | \qmlsignal XYSeries::onPointLabelsColorChanged(Color color) | |
223 | The color used for data point labels is changed to \a color. |
|
223 | The color used for data point labels is changed to \a color. | |
224 | */ |
|
224 | */ | |
225 |
|
225 | |||
226 | /*! |
|
226 | /*! | |
|
227 | \property QXYSeries::pointLabelsClipping | |||
|
228 | Defines the clipping for data point labels. True by default. The labels on the edge of the plot | |||
|
229 | area are cut when clipping is enabled. | |||
|
230 | ||||
|
231 | \sa pointLabelsVisible | |||
|
232 | */ | |||
|
233 | /*! | |||
|
234 | \qmlproperty bool XYSeries::pointLabelsClipping | |||
|
235 | Defines the clipping for data point labels. True by default. The labels on the edge of the plot | |||
|
236 | area are cut when clipping is enabled. | |||
|
237 | ||||
|
238 | \sa pointLabelsVisible | |||
|
239 | */ | |||
|
240 | /*! | |||
|
241 | \fn void QXYSeries::pointLabelsClippintChanged(bool clipping) | |||
|
242 | The clipping of the data point labels is changed to \a clipping. | |||
|
243 | */ | |||
|
244 | /*! | |||
|
245 | \qmlsignal XYSeries::onPointLabelsClippingChanged(bool clipping) | |||
|
246 | The clipping of the data point labels is changed to \a clipping. | |||
|
247 | */ | |||
|
248 | ||||
|
249 | /*! | |||
227 | \fn void QXYSeries::clicked(const QPointF& point) |
|
250 | \fn void QXYSeries::clicked(const QPointF& point) | |
228 | \brief Signal is emitted when user clicks the \a point on chart. The \a point is the point |
|
251 | \brief Signal is emitted when user clicks the \a point on chart. The \a point is the point | |
229 | where the press was triggered. |
|
252 | where the press was triggered. | |
230 | \sa pressed, released, doubleClicked |
|
253 | \sa pressed, released, doubleClicked | |
231 | */ |
|
254 | */ | |
232 | /*! |
|
255 | /*! | |
233 | \qmlsignal XYSeries::onClicked(QPointF point) |
|
256 | \qmlsignal XYSeries::onClicked(QPointF point) | |
234 | Signal is emitted when user clicks the \a point on chart. The \a point is the point where the |
|
257 | Signal is emitted when user clicks the \a point on chart. The \a point is the point where the | |
235 | press was triggered. For example: |
|
258 | press was triggered. For example: | |
236 | \code |
|
259 | \code | |
237 | LineSeries { |
|
260 | LineSeries { | |
238 | XYPoint { x: 0; y: 0 } |
|
261 | XYPoint { x: 0; y: 0 } | |
239 | XYPoint { x: 1.1; y: 2.1 } |
|
262 | XYPoint { x: 1.1; y: 2.1 } | |
240 | onClicked: console.log("onClicked: " + point.x + ", " + point.y); |
|
263 | onClicked: console.log("onClicked: " + point.x + ", " + point.y); | |
241 | } |
|
264 | } | |
242 | \endcode |
|
265 | \endcode | |
243 | \sa onPressed, onReleased, onDoubleClicked |
|
266 | \sa onPressed, onReleased, onDoubleClicked | |
244 | */ |
|
267 | */ | |
245 |
|
268 | |||
246 | /*! |
|
269 | /*! | |
247 | \fn void QXYSeries::hovered(const QPointF &point, bool state) |
|
270 | \fn void QXYSeries::hovered(const QPointF &point, bool state) | |
248 | This signal is emitted when user has hovered over or away from the series. \a point shows the origin (coordinate) |
|
271 | This signal is emitted when user has hovered over or away from the series. \a point shows the origin (coordinate) | |
249 | of the hover event. \a state is true when user has hovered over the series and false when hover has moved away from |
|
272 | of the hover event. \a state is true when user has hovered over the series and false when hover has moved away from | |
250 | the series. |
|
273 | the series. | |
251 | */ |
|
274 | */ | |
252 | /*! |
|
275 | /*! | |
253 | \qmlsignal XYSeries::onHovered(point point, bool state) |
|
276 | \qmlsignal XYSeries::onHovered(point point, bool state) | |
254 | This signal is emitted when user has hovered over or away from the series. \a point shows the origin (coordinate) |
|
277 | This signal is emitted when user has hovered over or away from the series. \a point shows the origin (coordinate) | |
255 | of the hover event. \a state is true when user has hovered over the series and false when hover has moved away from |
|
278 | of the hover event. \a state is true when user has hovered over the series and false when hover has moved away from | |
256 | the series. |
|
279 | the series. | |
257 | */ |
|
280 | */ | |
258 |
|
281 | |||
259 | /*! |
|
282 | /*! | |
260 | \fn void QXYSeries::pressed(const QPointF& point) |
|
283 | \fn void QXYSeries::pressed(const QPointF& point) | |
261 | \brief Signal is emitted when user presses the \a point on chart. |
|
284 | \brief Signal is emitted when user presses the \a point on chart. | |
262 | \sa clicked, released, doubleClicked |
|
285 | \sa clicked, released, doubleClicked | |
263 | */ |
|
286 | */ | |
264 | /*! |
|
287 | /*! | |
265 | \qmlsignal XYSeries::onPressed(QPointF point) |
|
288 | \qmlsignal XYSeries::onPressed(QPointF point) | |
266 | Signal is emitted when user presses the \a point on chart. For example: |
|
289 | Signal is emitted when user presses the \a point on chart. For example: | |
267 | \code |
|
290 | \code | |
268 | LineSeries { |
|
291 | LineSeries { | |
269 | XYPoint { x: 0; y: 0 } |
|
292 | XYPoint { x: 0; y: 0 } | |
270 | XYPoint { x: 1.1; y: 2.1 } |
|
293 | XYPoint { x: 1.1; y: 2.1 } | |
271 | onPressed: console.log("onPressed: " + point.x + ", " + point.y); |
|
294 | onPressed: console.log("onPressed: " + point.x + ", " + point.y); | |
272 | } |
|
295 | } | |
273 | \endcode |
|
296 | \endcode | |
274 | \sa onClicked, onReleased, onDoubleClicked |
|
297 | \sa onClicked, onReleased, onDoubleClicked | |
275 | */ |
|
298 | */ | |
276 |
|
299 | |||
277 | /*! |
|
300 | /*! | |
278 | \fn void QXYSeries::released(const QPointF& point) |
|
301 | \fn void QXYSeries::released(const QPointF& point) | |
279 | \brief Signal is emitted when user releases a press that was triggered on a \a point on chart. |
|
302 | \brief Signal is emitted when user releases a press that was triggered on a \a point on chart. | |
280 | \sa pressed, clicked, doubleClicked |
|
303 | \sa pressed, clicked, doubleClicked | |
281 | */ |
|
304 | */ | |
282 | /*! |
|
305 | /*! | |
283 | \qmlsignal XYSeries::onReleased(QPointF point) |
|
306 | \qmlsignal XYSeries::onReleased(QPointF point) | |
284 | Signal is emitted when user releases a press that was triggered on a \a point on chart. |
|
307 | Signal is emitted when user releases a press that was triggered on a \a point on chart. | |
285 | For example: |
|
308 | For example: | |
286 | \code |
|
309 | \code | |
287 | LineSeries { |
|
310 | LineSeries { | |
288 | XYPoint { x: 0; y: 0 } |
|
311 | XYPoint { x: 0; y: 0 } | |
289 | XYPoint { x: 1.1; y: 2.1 } |
|
312 | XYPoint { x: 1.1; y: 2.1 } | |
290 | onReleased: console.log("onReleased: " + point.x + ", " + point.y); |
|
313 | onReleased: console.log("onReleased: " + point.x + ", " + point.y); | |
291 | } |
|
314 | } | |
292 | \endcode |
|
315 | \endcode | |
293 | \sa onPressed, onClicked, onDoubleClicked |
|
316 | \sa onPressed, onClicked, onDoubleClicked | |
294 | */ |
|
317 | */ | |
295 |
|
318 | |||
296 | /*! |
|
319 | /*! | |
297 | \fn void QXYSeries::doubleClicked(const QPointF& point) |
|
320 | \fn void QXYSeries::doubleClicked(const QPointF& point) | |
298 | \brief Signal is emitted when user doubleclicks the \a point on chart. The \a point is the |
|
321 | \brief Signal is emitted when user doubleclicks the \a point on chart. The \a point is the | |
299 | point where the first press was triggered. |
|
322 | point where the first press was triggered. | |
300 | \sa pressed, released, clicked |
|
323 | \sa pressed, released, clicked | |
301 | */ |
|
324 | */ | |
302 | /*! |
|
325 | /*! | |
303 | \qmlsignal XYSeries::onDoubleClicked(QPointF point) |
|
326 | \qmlsignal XYSeries::onDoubleClicked(QPointF point) | |
304 | Signal is emitted when user doubleclicks the \a point on chart. The \a point is the point where |
|
327 | Signal is emitted when user doubleclicks the \a point on chart. The \a point is the point where | |
305 | the first press was triggered. For example: |
|
328 | the first press was triggered. For example: | |
306 | \code |
|
329 | \code | |
307 | LineSeries { |
|
330 | LineSeries { | |
308 | XYPoint { x: 0; y: 0 } |
|
331 | XYPoint { x: 0; y: 0 } | |
309 | XYPoint { x: 1.1; y: 2.1 } |
|
332 | XYPoint { x: 1.1; y: 2.1 } | |
310 | onDoubleClicked: console.log("onDoubleClicked: " + point.x + ", " + point.y); |
|
333 | onDoubleClicked: console.log("onDoubleClicked: " + point.x + ", " + point.y); | |
311 | } |
|
334 | } | |
312 | \endcode |
|
335 | \endcode | |
313 | \sa onPressed, onReleased, onClicked |
|
336 | \sa onPressed, onReleased, onClicked | |
314 | */ |
|
337 | */ | |
315 |
|
338 | |||
316 | /*! |
|
339 | /*! | |
317 | \fn void QXYSeries::pointReplaced(int index) |
|
340 | \fn void QXYSeries::pointReplaced(int index) | |
318 | Signal is emitted when a point has been replaced at \a index. |
|
341 | Signal is emitted when a point has been replaced at \a index. | |
319 | \sa replace() |
|
342 | \sa replace() | |
320 | */ |
|
343 | */ | |
321 | /*! |
|
344 | /*! | |
322 | \qmlsignal XYSeries::onPointReplaced(int index) |
|
345 | \qmlsignal XYSeries::onPointReplaced(int index) | |
323 | Signal is emitted when a point has been replaced at \a index. |
|
346 | Signal is emitted when a point has been replaced at \a index. | |
324 | */ |
|
347 | */ | |
325 |
|
348 | |||
326 | /*! |
|
349 | /*! | |
327 | \fn void QXYSeries::pointsReplaced() |
|
350 | \fn void QXYSeries::pointsReplaced() | |
328 | Signal is emitted when all points have been replaced with other points. |
|
351 | Signal is emitted when all points have been replaced with other points. | |
329 | \sa replace() |
|
352 | \sa replace() | |
330 | */ |
|
353 | */ | |
331 | /*! |
|
354 | /*! | |
332 | \qmlsignal XYSeries::onPointsReplaced() |
|
355 | \qmlsignal XYSeries::onPointsReplaced() | |
333 | Signal is emitted when all points have been replaced with other points. |
|
356 | Signal is emitted when all points have been replaced with other points. | |
334 | */ |
|
357 | */ | |
335 |
|
358 | |||
336 | /*! |
|
359 | /*! | |
337 | \fn void QXYSeries::pointAdded(int index) |
|
360 | \fn void QXYSeries::pointAdded(int index) | |
338 | Signal is emitted when a point has been added at \a index. |
|
361 | Signal is emitted when a point has been added at \a index. | |
339 | \sa append(), insert() |
|
362 | \sa append(), insert() | |
340 | */ |
|
363 | */ | |
341 | /*! |
|
364 | /*! | |
342 | \qmlsignal XYSeries::onPointAdded(int index) |
|
365 | \qmlsignal XYSeries::onPointAdded(int index) | |
343 | Signal is emitted when a point has been added at \a index. |
|
366 | Signal is emitted when a point has been added at \a index. | |
344 | */ |
|
367 | */ | |
345 |
|
368 | |||
346 | /*! |
|
369 | /*! | |
347 | \fn void QXYSeries::pointRemoved(int index) |
|
370 | \fn void QXYSeries::pointRemoved(int index) | |
348 | Signal is emitted when a point has been removed from \a index. |
|
371 | Signal is emitted when a point has been removed from \a index. | |
349 | \sa remove() |
|
372 | \sa remove() | |
350 | */ |
|
373 | */ | |
351 |
|
374 | |||
352 | /*! |
|
375 | /*! | |
353 | \qmlsignal XYSeries::onPointRemoved(int index) |
|
376 | \qmlsignal XYSeries::onPointRemoved(int index) | |
354 | Signal is emitted when a point has been removed from \a index. |
|
377 | Signal is emitted when a point has been removed from \a index. | |
355 | */ |
|
378 | */ | |
356 |
|
379 | |||
357 | /*! |
|
380 | /*! | |
358 | \fn void QXYSeries::pointsRemoved(int index, int count) |
|
381 | \fn void QXYSeries::pointsRemoved(int index, int count) | |
359 | Signal is emitted when a \a count of points has been removed starting at \a index. |
|
382 | Signal is emitted when a \a count of points has been removed starting at \a index. | |
360 | \sa removePoints(), clear() |
|
383 | \sa removePoints(), clear() | |
361 | */ |
|
384 | */ | |
362 |
|
385 | |||
363 | /*! |
|
386 | /*! | |
364 | \qmlsignal XYSeries::onPointsRemoved(int index, int count) |
|
387 | \qmlsignal XYSeries::onPointsRemoved(int index, int count) | |
365 | Signal is emitted when a \a count of points has been removed starting at \a index. |
|
388 | Signal is emitted when a \a count of points has been removed starting at \a index. | |
366 | */ |
|
389 | */ | |
367 |
|
390 | |||
368 | /*! |
|
391 | /*! | |
369 | \fn void QXYSeries::colorChanged(QColor color) |
|
392 | \fn void QXYSeries::colorChanged(QColor color) | |
370 | \brief Signal is emitted when the line (pen) color has changed to \a color. |
|
393 | \brief Signal is emitted when the line (pen) color has changed to \a color. | |
371 | */ |
|
394 | */ | |
372 | /*! |
|
395 | /*! | |
373 | \qmlsignal XYSeries::onColorChanged(color color) |
|
396 | \qmlsignal XYSeries::onColorChanged(color color) | |
374 | Signal is emitted when the line (pen) color has changed to \a color. |
|
397 | Signal is emitted when the line (pen) color has changed to \a color. | |
375 | */ |
|
398 | */ | |
376 |
|
399 | |||
377 | /*! |
|
400 | /*! | |
378 | \fn void QXYSeriesPrivate::updated() |
|
401 | \fn void QXYSeriesPrivate::updated() | |
379 | \brief \internal |
|
402 | \brief \internal | |
380 | */ |
|
403 | */ | |
381 |
|
404 | |||
382 | /*! |
|
405 | /*! | |
383 | \qmlmethod XYSeries::append(real x, real y) |
|
406 | \qmlmethod XYSeries::append(real x, real y) | |
384 | Append point (\a x, \a y) to the series |
|
407 | Append point (\a x, \a y) to the series | |
385 | */ |
|
408 | */ | |
386 |
|
409 | |||
387 | /*! |
|
410 | /*! | |
388 | \qmlmethod XYSeries::replace(real oldX, real oldY, real newX, real newY) |
|
411 | \qmlmethod XYSeries::replace(real oldX, real oldY, real newX, real newY) | |
389 | Replaces point (\a oldX, \a oldY) with point (\a newX, \a newY). Does nothing, if point (oldX, oldY) does not |
|
412 | Replaces point (\a oldX, \a oldY) with point (\a newX, \a newY). Does nothing, if point (oldX, oldY) does not | |
390 | exist. |
|
413 | exist. | |
391 | */ |
|
414 | */ | |
392 |
|
415 | |||
393 | /*! |
|
416 | /*! | |
394 | \qmlmethod XYSeries::remove(real x, real y) |
|
417 | \qmlmethod XYSeries::remove(real x, real y) | |
395 | Removes point (\a x, \a y) from the series. Does nothing, if point (x, y) does not exist. |
|
418 | Removes point (\a x, \a y) from the series. Does nothing, if point (x, y) does not exist. | |
396 | */ |
|
419 | */ | |
397 |
|
420 | |||
398 | /*! |
|
421 | /*! | |
399 | \qmlmethod XYSeries::remove(int index) |
|
422 | \qmlmethod XYSeries::remove(int index) | |
400 | Removes a point from the series at \a index. |
|
423 | Removes a point from the series at \a index. | |
401 | */ |
|
424 | */ | |
402 |
|
425 | |||
403 | /*! |
|
426 | /*! | |
404 | \qmlmethod XYSeries::removePoints(int index, int count) |
|
427 | \qmlmethod XYSeries::removePoints(int index, int count) | |
405 | Removes \a count points from the series starting at \a index. |
|
428 | Removes \a count points from the series starting at \a index. | |
406 | */ |
|
429 | */ | |
407 |
|
430 | |||
408 | /*! |
|
431 | /*! | |
409 | \qmlmethod XYSeries::insert(int index, real x, real y) |
|
432 | \qmlmethod XYSeries::insert(int index, real x, real y) | |
410 | Inserts point (\a x, \a y) to the \a index. If index is 0 or smaller than 0 the point is prepended to the list of |
|
433 | Inserts point (\a x, \a y) to the \a index. If index is 0 or smaller than 0 the point is prepended to the list of | |
411 | points. If index is the same as or bigger than count, the point is appended to the list of points. |
|
434 | points. If index is the same as or bigger than count, the point is appended to the list of points. | |
412 | */ |
|
435 | */ | |
413 |
|
436 | |||
414 | /*! |
|
437 | /*! | |
415 | \qmlmethod QPointF XYSeries::at(int index) |
|
438 | \qmlmethod QPointF XYSeries::at(int index) | |
416 | Returns point at \a index. Returns (0, 0) if the index is not valid. |
|
439 | Returns point at \a index. Returns (0, 0) if the index is not valid. | |
417 | */ |
|
440 | */ | |
418 |
|
441 | |||
419 | /*! |
|
442 | /*! | |
420 | \internal |
|
443 | \internal | |
421 |
|
444 | |||
422 | Constructs empty series object which is a child of \a parent. |
|
445 | Constructs empty series object which is a child of \a parent. | |
423 | When series object is added to QChart instance ownerships is transferred. |
|
446 | When series object is added to QChart instance ownerships is transferred. | |
424 | */ |
|
447 | */ | |
425 | QXYSeries::QXYSeries(QXYSeriesPrivate &d, QObject *parent) |
|
448 | QXYSeries::QXYSeries(QXYSeriesPrivate &d, QObject *parent) | |
426 | : QAbstractSeries(d, parent) |
|
449 | : QAbstractSeries(d, parent) | |
427 | { |
|
450 | { | |
428 | } |
|
451 | } | |
429 |
|
452 | |||
430 | /*! |
|
453 | /*! | |
431 | Destroys the object. Series added to QChart instances are owned by those, |
|
454 | Destroys the object. Series added to QChart instances are owned by those, | |
432 | and are destroyed when QChart instances are destroyed. |
|
455 | and are destroyed when QChart instances are destroyed. | |
433 | */ |
|
456 | */ | |
434 | QXYSeries::~QXYSeries() |
|
457 | QXYSeries::~QXYSeries() | |
435 | { |
|
458 | { | |
436 | } |
|
459 | } | |
437 |
|
460 | |||
438 | /*! |
|
461 | /*! | |
439 | Adds data point (\a x, \a y) to the series. |
|
462 | Adds data point (\a x, \a y) to the series. | |
440 | */ |
|
463 | */ | |
441 | void QXYSeries::append(qreal x, qreal y) |
|
464 | void QXYSeries::append(qreal x, qreal y) | |
442 | { |
|
465 | { | |
443 | append(QPointF(x, y)); |
|
466 | append(QPointF(x, y)); | |
444 | } |
|
467 | } | |
445 |
|
468 | |||
446 | /*! |
|
469 | /*! | |
447 | This is an overloaded function. |
|
470 | This is an overloaded function. | |
448 | Adds data \a point to the series. |
|
471 | Adds data \a point to the series. | |
449 | */ |
|
472 | */ | |
450 | void QXYSeries::append(const QPointF &point) |
|
473 | void QXYSeries::append(const QPointF &point) | |
451 | { |
|
474 | { | |
452 | Q_D(QXYSeries); |
|
475 | Q_D(QXYSeries); | |
453 |
|
476 | |||
454 | if (isValidValue(point)) { |
|
477 | if (isValidValue(point)) { | |
455 | d->m_points << point; |
|
478 | d->m_points << point; | |
456 | emit pointAdded(d->m_points.count() - 1); |
|
479 | emit pointAdded(d->m_points.count() - 1); | |
457 | } |
|
480 | } | |
458 | } |
|
481 | } | |
459 |
|
482 | |||
460 | /*! |
|
483 | /*! | |
461 | This is an overloaded function. |
|
484 | This is an overloaded function. | |
462 | Adds list of data \a points to the series. |
|
485 | Adds list of data \a points to the series. | |
463 | */ |
|
486 | */ | |
464 | void QXYSeries::append(const QList<QPointF> &points) |
|
487 | void QXYSeries::append(const QList<QPointF> &points) | |
465 | { |
|
488 | { | |
466 | foreach (const QPointF &point , points) |
|
489 | foreach (const QPointF &point , points) | |
467 | append(point); |
|
490 | append(point); | |
468 | } |
|
491 | } | |
469 |
|
492 | |||
470 | /*! |
|
493 | /*! | |
471 | Replaces data point (\a oldX, \a oldY) with data point (\a newX, \a newY). |
|
494 | Replaces data point (\a oldX, \a oldY) with data point (\a newX, \a newY). | |
472 | \sa pointReplaced() |
|
495 | \sa pointReplaced() | |
473 | */ |
|
496 | */ | |
474 | void QXYSeries::replace(qreal oldX, qreal oldY, qreal newX, qreal newY) |
|
497 | void QXYSeries::replace(qreal oldX, qreal oldY, qreal newX, qreal newY) | |
475 | { |
|
498 | { | |
476 | replace(QPointF(oldX, oldY), QPointF(newX, newY)); |
|
499 | replace(QPointF(oldX, oldY), QPointF(newX, newY)); | |
477 | } |
|
500 | } | |
478 |
|
501 | |||
479 | /*! |
|
502 | /*! | |
480 | Replaces \a oldPoint with \a newPoint. |
|
503 | Replaces \a oldPoint with \a newPoint. | |
481 | \sa pointReplaced() |
|
504 | \sa pointReplaced() | |
482 | */ |
|
505 | */ | |
483 | void QXYSeries::replace(const QPointF &oldPoint, const QPointF &newPoint) |
|
506 | void QXYSeries::replace(const QPointF &oldPoint, const QPointF &newPoint) | |
484 | { |
|
507 | { | |
485 | Q_D(QXYSeries); |
|
508 | Q_D(QXYSeries); | |
486 | int index = d->m_points.indexOf(oldPoint); |
|
509 | int index = d->m_points.indexOf(oldPoint); | |
487 | if (index == -1) |
|
510 | if (index == -1) | |
488 | return; |
|
511 | return; | |
489 | replace(index, newPoint); |
|
512 | replace(index, newPoint); | |
490 | } |
|
513 | } | |
491 |
|
514 | |||
492 | /*! |
|
515 | /*! | |
493 | Replaces the point at \a index with data point (\a newX, \a newY). |
|
516 | Replaces the point at \a index with data point (\a newX, \a newY). | |
494 | \sa pointReplaced() |
|
517 | \sa pointReplaced() | |
495 | */ |
|
518 | */ | |
496 | void QXYSeries::replace(int index, qreal newX, qreal newY) |
|
519 | void QXYSeries::replace(int index, qreal newX, qreal newY) | |
497 | { |
|
520 | { | |
498 | replace(index, QPointF(newX, newY)); |
|
521 | replace(index, QPointF(newX, newY)); | |
499 | } |
|
522 | } | |
500 |
|
523 | |||
501 | /*! |
|
524 | /*! | |
502 | Replaces the point at \a index with \a newPoint. |
|
525 | Replaces the point at \a index with \a newPoint. | |
503 | \sa pointReplaced() |
|
526 | \sa pointReplaced() | |
504 | */ |
|
527 | */ | |
505 | void QXYSeries::replace(int index, const QPointF &newPoint) |
|
528 | void QXYSeries::replace(int index, const QPointF &newPoint) | |
506 | { |
|
529 | { | |
507 | Q_D(QXYSeries); |
|
530 | Q_D(QXYSeries); | |
508 | if (isValidValue(newPoint)) { |
|
531 | if (isValidValue(newPoint)) { | |
509 | d->m_points[index] = newPoint; |
|
532 | d->m_points[index] = newPoint; | |
510 | emit pointReplaced(index); |
|
533 | emit pointReplaced(index); | |
511 | } |
|
534 | } | |
512 | } |
|
535 | } | |
513 |
|
536 | |||
514 | /*! |
|
537 | /*! | |
515 | Replaces the current points with \a points. |
|
538 | Replaces the current points with \a points. | |
516 | \note This is much faster than replacing data points one by one, |
|
539 | \note This is much faster than replacing data points one by one, | |
517 | or first clearing all data, and then appending the new data. Emits QXYSeries::pointsReplaced() |
|
540 | or first clearing all data, and then appending the new data. Emits QXYSeries::pointsReplaced() | |
518 | when the points have been replaced. However, note that using the overload that takes |
|
541 | when the points have been replaced. However, note that using the overload that takes | |
519 | \c{QVector<QPointF>} as parameter is slightly faster than using this overload. |
|
542 | \c{QVector<QPointF>} as parameter is slightly faster than using this overload. | |
520 | \sa pointsReplaced() |
|
543 | \sa pointsReplaced() | |
521 | */ |
|
544 | */ | |
522 | void QXYSeries::replace(QList<QPointF> points) |
|
545 | void QXYSeries::replace(QList<QPointF> points) | |
523 | { |
|
546 | { | |
524 | replace(points.toVector()); |
|
547 | replace(points.toVector()); | |
525 | } |
|
548 | } | |
526 |
|
549 | |||
527 | /*! |
|
550 | /*! | |
528 | Replaces the current points with \a points. |
|
551 | Replaces the current points with \a points. | |
529 | \note This is much faster than replacing data points one by one, |
|
552 | \note This is much faster than replacing data points one by one, | |
530 | or first clearing all data, and then appending the new data. Emits QXYSeries::pointsReplaced() |
|
553 | or first clearing all data, and then appending the new data. Emits QXYSeries::pointsReplaced() | |
531 | when the points have been replaced. |
|
554 | when the points have been replaced. | |
532 | \sa pointsReplaced() |
|
555 | \sa pointsReplaced() | |
533 | */ |
|
556 | */ | |
534 | void QXYSeries::replace(QVector<QPointF> points) |
|
557 | void QXYSeries::replace(QVector<QPointF> points) | |
535 | { |
|
558 | { | |
536 | Q_D(QXYSeries); |
|
559 | Q_D(QXYSeries); | |
537 | d->m_points = points; |
|
560 | d->m_points = points; | |
538 | emit pointsReplaced(); |
|
561 | emit pointsReplaced(); | |
539 | } |
|
562 | } | |
540 |
|
563 | |||
541 | /*! |
|
564 | /*! | |
542 | Removes the point (\a x, \a y) from the series. |
|
565 | Removes the point (\a x, \a y) from the series. | |
543 | \sa pointRemoved() |
|
566 | \sa pointRemoved() | |
544 | */ |
|
567 | */ | |
545 | void QXYSeries::remove(qreal x, qreal y) |
|
568 | void QXYSeries::remove(qreal x, qreal y) | |
546 | { |
|
569 | { | |
547 | remove(QPointF(x, y)); |
|
570 | remove(QPointF(x, y)); | |
548 | } |
|
571 | } | |
549 |
|
572 | |||
550 | /*! |
|
573 | /*! | |
551 | Removes the \a point from the series. |
|
574 | Removes the \a point from the series. | |
552 | \sa pointRemoved() |
|
575 | \sa pointRemoved() | |
553 | */ |
|
576 | */ | |
554 | void QXYSeries::remove(const QPointF &point) |
|
577 | void QXYSeries::remove(const QPointF &point) | |
555 | { |
|
578 | { | |
556 | Q_D(QXYSeries); |
|
579 | Q_D(QXYSeries); | |
557 | int index = d->m_points.indexOf(point); |
|
580 | int index = d->m_points.indexOf(point); | |
558 | if (index == -1) |
|
581 | if (index == -1) | |
559 | return; |
|
582 | return; | |
560 | remove(index); |
|
583 | remove(index); | |
561 | } |
|
584 | } | |
562 |
|
585 | |||
563 | /*! |
|
586 | /*! | |
564 | Removes the point at \a index from the series. |
|
587 | Removes the point at \a index from the series. | |
565 | \sa pointRemoved() |
|
588 | \sa pointRemoved() | |
566 | */ |
|
589 | */ | |
567 | void QXYSeries::remove(int index) |
|
590 | void QXYSeries::remove(int index) | |
568 | { |
|
591 | { | |
569 | Q_D(QXYSeries); |
|
592 | Q_D(QXYSeries); | |
570 | d->m_points.remove(index); |
|
593 | d->m_points.remove(index); | |
571 | emit pointRemoved(index); |
|
594 | emit pointRemoved(index); | |
572 | } |
|
595 | } | |
573 |
|
596 | |||
574 | /*! |
|
597 | /*! | |
575 | Removes \a count number of points from the series starting at \a index. |
|
598 | Removes \a count number of points from the series starting at \a index. | |
576 | \sa pointsRemoved() |
|
599 | \sa pointsRemoved() | |
577 | */ |
|
600 | */ | |
578 | void QXYSeries::removePoints(int index, int count) |
|
601 | void QXYSeries::removePoints(int index, int count) | |
579 | { |
|
602 | { | |
580 | // This function doesn't overload remove as there is chance for it to get mixed up with |
|
603 | // This function doesn't overload remove as there is chance for it to get mixed up with | |
581 | // remove(qreal, qreal) overload in some implicit casting cases. |
|
604 | // remove(qreal, qreal) overload in some implicit casting cases. | |
582 | Q_D(QXYSeries); |
|
605 | Q_D(QXYSeries); | |
583 | if (count > 0) { |
|
606 | if (count > 0) { | |
584 | d->m_points.remove(index, count); |
|
607 | d->m_points.remove(index, count); | |
585 | emit pointsRemoved(index, count); |
|
608 | emit pointsRemoved(index, count); | |
586 | } |
|
609 | } | |
587 | } |
|
610 | } | |
588 |
|
611 | |||
589 | /*! |
|
612 | /*! | |
590 | Inserts a \a point in the series at \a index position. |
|
613 | Inserts a \a point in the series at \a index position. | |
591 | \sa pointAdded() |
|
614 | \sa pointAdded() | |
592 | */ |
|
615 | */ | |
593 | void QXYSeries::insert(int index, const QPointF &point) |
|
616 | void QXYSeries::insert(int index, const QPointF &point) | |
594 | { |
|
617 | { | |
595 | Q_D(QXYSeries); |
|
618 | Q_D(QXYSeries); | |
596 | if (isValidValue(point)) { |
|
619 | if (isValidValue(point)) { | |
597 | index = qMax(0, qMin(index, d->m_points.size())); |
|
620 | index = qMax(0, qMin(index, d->m_points.size())); | |
598 | d->m_points.insert(index, point); |
|
621 | d->m_points.insert(index, point); | |
599 | emit pointAdded(index); |
|
622 | emit pointAdded(index); | |
600 | } |
|
623 | } | |
601 | } |
|
624 | } | |
602 |
|
625 | |||
603 | /*! |
|
626 | /*! | |
604 | Removes all points from the series. |
|
627 | Removes all points from the series. | |
605 | \sa pointsRemoved() |
|
628 | \sa pointsRemoved() | |
606 | */ |
|
629 | */ | |
607 | void QXYSeries::clear() |
|
630 | void QXYSeries::clear() | |
608 | { |
|
631 | { | |
609 | Q_D(QXYSeries); |
|
632 | Q_D(QXYSeries); | |
610 | removePoints(0, d->m_points.size()); |
|
633 | removePoints(0, d->m_points.size()); | |
611 | } |
|
634 | } | |
612 |
|
635 | |||
613 | /*! |
|
636 | /*! | |
614 | Returns list of points in the series. |
|
637 | Returns list of points in the series. | |
615 | */ |
|
638 | */ | |
616 | QList<QPointF> QXYSeries::points() const |
|
639 | QList<QPointF> QXYSeries::points() const | |
617 | { |
|
640 | { | |
618 | Q_D(const QXYSeries); |
|
641 | Q_D(const QXYSeries); | |
619 | return d->m_points.toList(); |
|
642 | return d->m_points.toList(); | |
620 | } |
|
643 | } | |
621 |
|
644 | |||
622 | /*! |
|
645 | /*! | |
623 | Returns point at \a index in internal points vector. |
|
646 | Returns point at \a index in internal points vector. | |
624 | */ |
|
647 | */ | |
625 | const QPointF &QXYSeries::at(int index) const |
|
648 | const QPointF &QXYSeries::at(int index) const | |
626 | { |
|
649 | { | |
627 | Q_D(const QXYSeries); |
|
650 | Q_D(const QXYSeries); | |
628 | return d->m_points.at(index); |
|
651 | return d->m_points.at(index); | |
629 | } |
|
652 | } | |
630 |
|
653 | |||
631 | /*! |
|
654 | /*! | |
632 | Returns number of data points within series. |
|
655 | Returns number of data points within series. | |
633 | */ |
|
656 | */ | |
634 | int QXYSeries::count() const |
|
657 | int QXYSeries::count() const | |
635 | { |
|
658 | { | |
636 | Q_D(const QXYSeries); |
|
659 | Q_D(const QXYSeries); | |
637 | return d->m_points.count(); |
|
660 | return d->m_points.count(); | |
638 | } |
|
661 | } | |
639 |
|
662 | |||
640 |
|
663 | |||
641 | /*! |
|
664 | /*! | |
642 | Sets \a pen used for drawing points on the chart. If the pen is not defined, the |
|
665 | Sets \a pen used for drawing points on the chart. If the pen is not defined, the | |
643 | pen from chart theme is used. |
|
666 | pen from chart theme is used. | |
644 | \sa QChart::setTheme() |
|
667 | \sa QChart::setTheme() | |
645 | */ |
|
668 | */ | |
646 | void QXYSeries::setPen(const QPen &pen) |
|
669 | void QXYSeries::setPen(const QPen &pen) | |
647 | { |
|
670 | { | |
648 | Q_D(QXYSeries); |
|
671 | Q_D(QXYSeries); | |
649 | if (d->m_pen != pen) { |
|
672 | if (d->m_pen != pen) { | |
650 | bool emitColorChanged = d->m_pen.color() != pen.color(); |
|
673 | bool emitColorChanged = d->m_pen.color() != pen.color(); | |
651 | d->m_pen = pen; |
|
674 | d->m_pen = pen; | |
652 | emit d->updated(); |
|
675 | emit d->updated(); | |
653 | if (emitColorChanged) |
|
676 | if (emitColorChanged) | |
654 | emit colorChanged(pen.color()); |
|
677 | emit colorChanged(pen.color()); | |
655 | } |
|
678 | } | |
656 | } |
|
679 | } | |
657 |
|
680 | |||
658 | QPen QXYSeries::pen() const |
|
681 | QPen QXYSeries::pen() const | |
659 | { |
|
682 | { | |
660 | Q_D(const QXYSeries); |
|
683 | Q_D(const QXYSeries); | |
661 | if (d->m_pen == QChartPrivate::defaultPen()) |
|
684 | if (d->m_pen == QChartPrivate::defaultPen()) | |
662 | return QPen(); |
|
685 | return QPen(); | |
663 | else |
|
686 | else | |
664 | return d->m_pen; |
|
687 | return d->m_pen; | |
665 | } |
|
688 | } | |
666 |
|
689 | |||
667 | /*! |
|
690 | /*! | |
668 | Sets \a brush used for drawing points on the chart. If the brush is not defined, brush |
|
691 | Sets \a brush used for drawing points on the chart. If the brush is not defined, brush | |
669 | from chart theme setting is used. |
|
692 | from chart theme setting is used. | |
670 | \sa QChart::setTheme() |
|
693 | \sa QChart::setTheme() | |
671 | */ |
|
694 | */ | |
672 | void QXYSeries::setBrush(const QBrush &brush) |
|
695 | void QXYSeries::setBrush(const QBrush &brush) | |
673 | { |
|
696 | { | |
674 | Q_D(QXYSeries); |
|
697 | Q_D(QXYSeries); | |
675 | if (d->m_brush != brush) { |
|
698 | if (d->m_brush != brush) { | |
676 | d->m_brush = brush; |
|
699 | d->m_brush = brush; | |
677 | emit d->updated(); |
|
700 | emit d->updated(); | |
678 | } |
|
701 | } | |
679 | } |
|
702 | } | |
680 |
|
703 | |||
681 | QBrush QXYSeries::brush() const |
|
704 | QBrush QXYSeries::brush() const | |
682 | { |
|
705 | { | |
683 | Q_D(const QXYSeries); |
|
706 | Q_D(const QXYSeries); | |
684 | if (d->m_brush == QChartPrivate::defaultBrush()) |
|
707 | if (d->m_brush == QChartPrivate::defaultBrush()) | |
685 | return QBrush(); |
|
708 | return QBrush(); | |
686 | else |
|
709 | else | |
687 | return d->m_brush; |
|
710 | return d->m_brush; | |
688 | } |
|
711 | } | |
689 |
|
712 | |||
690 | void QXYSeries::setColor(const QColor &color) |
|
713 | void QXYSeries::setColor(const QColor &color) | |
691 | { |
|
714 | { | |
692 | QPen p = pen(); |
|
715 | QPen p = pen(); | |
693 | if (p.color() != color) { |
|
716 | if (p.color() != color) { | |
694 | p.setColor(color); |
|
717 | p.setColor(color); | |
695 | setPen(p); |
|
718 | setPen(p); | |
696 | } |
|
719 | } | |
697 | } |
|
720 | } | |
698 |
|
721 | |||
699 | QColor QXYSeries::color() const |
|
722 | QColor QXYSeries::color() const | |
700 | { |
|
723 | { | |
701 | return pen().color(); |
|
724 | return pen().color(); | |
702 | } |
|
725 | } | |
703 |
|
726 | |||
704 | void QXYSeries::setPointsVisible(bool visible) |
|
727 | void QXYSeries::setPointsVisible(bool visible) | |
705 | { |
|
728 | { | |
706 | Q_D(QXYSeries); |
|
729 | Q_D(QXYSeries); | |
707 | if (d->m_pointsVisible != visible) { |
|
730 | if (d->m_pointsVisible != visible) { | |
708 | d->m_pointsVisible = visible; |
|
731 | d->m_pointsVisible = visible; | |
709 | emit d->updated(); |
|
732 | emit d->updated(); | |
710 | } |
|
733 | } | |
711 | } |
|
734 | } | |
712 |
|
735 | |||
713 | bool QXYSeries::pointsVisible() const |
|
736 | bool QXYSeries::pointsVisible() const | |
714 | { |
|
737 | { | |
715 | Q_D(const QXYSeries); |
|
738 | Q_D(const QXYSeries); | |
716 | return d->m_pointsVisible; |
|
739 | return d->m_pointsVisible; | |
717 | } |
|
740 | } | |
718 |
|
741 | |||
719 | void QXYSeries::setPointLabelsFormat(const QString &format) |
|
742 | void QXYSeries::setPointLabelsFormat(const QString &format) | |
720 | { |
|
743 | { | |
721 | Q_D(QXYSeries); |
|
744 | Q_D(QXYSeries); | |
722 | if (d->m_pointLabelsFormat != format) { |
|
745 | if (d->m_pointLabelsFormat != format) { | |
723 | d->m_pointLabelsFormat = format; |
|
746 | d->m_pointLabelsFormat = format; | |
724 | emit pointLabelsFormatChanged(format); |
|
747 | emit pointLabelsFormatChanged(format); | |
725 | } |
|
748 | } | |
726 | } |
|
749 | } | |
727 |
|
750 | |||
728 | QString QXYSeries::pointLabelsFormat() const |
|
751 | QString QXYSeries::pointLabelsFormat() const | |
729 | { |
|
752 | { | |
730 | Q_D(const QXYSeries); |
|
753 | Q_D(const QXYSeries); | |
731 | return d->m_pointLabelsFormat; |
|
754 | return d->m_pointLabelsFormat; | |
732 | } |
|
755 | } | |
733 |
|
756 | |||
734 | void QXYSeries::setPointLabelsVisible(bool visible) |
|
757 | void QXYSeries::setPointLabelsVisible(bool visible) | |
735 | { |
|
758 | { | |
736 | Q_D(QXYSeries); |
|
759 | Q_D(QXYSeries); | |
737 | if (d->m_pointLabelsVisible != visible) { |
|
760 | if (d->m_pointLabelsVisible != visible) { | |
738 | d->m_pointLabelsVisible = visible; |
|
761 | d->m_pointLabelsVisible = visible; | |
739 | emit pointLabelsVisibilityChanged(visible); |
|
762 | emit pointLabelsVisibilityChanged(visible); | |
740 | } |
|
763 | } | |
741 | } |
|
764 | } | |
742 |
|
765 | |||
743 | bool QXYSeries::pointLabelsVisible() const |
|
766 | bool QXYSeries::pointLabelsVisible() const | |
744 | { |
|
767 | { | |
745 | Q_D(const QXYSeries); |
|
768 | Q_D(const QXYSeries); | |
746 | return d->m_pointLabelsVisible; |
|
769 | return d->m_pointLabelsVisible; | |
747 | } |
|
770 | } | |
748 |
|
771 | |||
749 | void QXYSeries::setPointLabelsFont(const QFont &font) |
|
772 | void QXYSeries::setPointLabelsFont(const QFont &font) | |
750 | { |
|
773 | { | |
751 | Q_D(QXYSeries); |
|
774 | Q_D(QXYSeries); | |
752 | if (d->m_pointLabelsFont != font) { |
|
775 | if (d->m_pointLabelsFont != font) { | |
753 | d->m_pointLabelsFont = font; |
|
776 | d->m_pointLabelsFont = font; | |
754 | emit pointLabelsFontChanged(font); |
|
777 | emit pointLabelsFontChanged(font); | |
755 | } |
|
778 | } | |
756 | } |
|
779 | } | |
757 |
|
780 | |||
758 | QFont QXYSeries::pointLabelsFont() const |
|
781 | QFont QXYSeries::pointLabelsFont() const | |
759 | { |
|
782 | { | |
760 | Q_D(const QXYSeries); |
|
783 | Q_D(const QXYSeries); | |
761 | return d->m_pointLabelsFont; |
|
784 | return d->m_pointLabelsFont; | |
762 | } |
|
785 | } | |
763 |
|
786 | |||
764 | void QXYSeries::setPointLabelsColor(const QColor &color) |
|
787 | void QXYSeries::setPointLabelsColor(const QColor &color) | |
765 | { |
|
788 | { | |
766 | Q_D(QXYSeries); |
|
789 | Q_D(QXYSeries); | |
767 | if (d->m_pointLabelsColor != color) { |
|
790 | if (d->m_pointLabelsColor != color) { | |
768 | d->m_pointLabelsColor = color; |
|
791 | d->m_pointLabelsColor = color; | |
769 | emit pointLabelsColorChanged(color); |
|
792 | emit pointLabelsColorChanged(color); | |
770 | } |
|
793 | } | |
771 | } |
|
794 | } | |
772 |
|
795 | |||
773 | QColor QXYSeries::pointLabelsColor() const |
|
796 | QColor QXYSeries::pointLabelsColor() const | |
774 | { |
|
797 | { | |
775 | Q_D(const QXYSeries); |
|
798 | Q_D(const QXYSeries); | |
776 | if (d->m_pointLabelsColor == QChartPrivate::defaultPen().color()) |
|
799 | if (d->m_pointLabelsColor == QChartPrivate::defaultPen().color()) | |
777 | return QPen().color(); |
|
800 | return QPen().color(); | |
778 | else |
|
801 | else | |
779 | return d->m_pointLabelsColor; |
|
802 | return d->m_pointLabelsColor; | |
780 | } |
|
803 | } | |
781 |
|
804 | |||
|
805 | void QXYSeries::setPointLabelsClipping(bool enabled) | |||
|
806 | { | |||
|
807 | Q_D(QXYSeries); | |||
|
808 | if (d->m_pointLabelsClipping != enabled) { | |||
|
809 | d->m_pointLabelsClipping = enabled; | |||
|
810 | emit pointLabelsClippingChanged(enabled); | |||
|
811 | } | |||
|
812 | } | |||
|
813 | ||||
|
814 | bool QXYSeries::pointLabelsClipping() const | |||
|
815 | { | |||
|
816 | Q_D(const QXYSeries); | |||
|
817 | return d->m_pointLabelsClipping; | |||
|
818 | } | |||
|
819 | ||||
782 | /*! |
|
820 | /*! | |
783 | Stream operator for adding a data \a point to the series. |
|
821 | Stream operator for adding a data \a point to the series. | |
784 | \sa append() |
|
822 | \sa append() | |
785 | */ |
|
823 | */ | |
786 | QXYSeries &QXYSeries::operator<< (const QPointF &point) |
|
824 | QXYSeries &QXYSeries::operator<< (const QPointF &point) | |
787 | { |
|
825 | { | |
788 | append(point); |
|
826 | append(point); | |
789 | return *this; |
|
827 | return *this; | |
790 | } |
|
828 | } | |
791 |
|
829 | |||
792 |
|
830 | |||
793 | /*! |
|
831 | /*! | |
794 | Stream operator for adding a list of \a points to the series. |
|
832 | Stream operator for adding a list of \a points to the series. | |
795 | \sa append() |
|
833 | \sa append() | |
796 | */ |
|
834 | */ | |
797 |
|
835 | |||
798 | QXYSeries &QXYSeries::operator<< (const QList<QPointF>& points) |
|
836 | QXYSeries &QXYSeries::operator<< (const QList<QPointF>& points) | |
799 | { |
|
837 | { | |
800 | append(points); |
|
838 | append(points); | |
801 | return *this; |
|
839 | return *this; | |
802 | } |
|
840 | } | |
803 |
|
841 | |||
804 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
842 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
805 |
|
843 | |||
806 |
|
844 | |||
807 | QXYSeriesPrivate::QXYSeriesPrivate(QXYSeries *q) |
|
845 | QXYSeriesPrivate::QXYSeriesPrivate(QXYSeries *q) | |
808 | : QAbstractSeriesPrivate(q), |
|
846 | : QAbstractSeriesPrivate(q), | |
809 | m_pen(QChartPrivate::defaultPen()), |
|
847 | m_pen(QChartPrivate::defaultPen()), | |
810 | m_brush(QChartPrivate::defaultBrush()), |
|
848 | m_brush(QChartPrivate::defaultBrush()), | |
811 | m_pointsVisible(false), |
|
849 | m_pointsVisible(false), | |
812 | m_pointLabelsFormat(QLatin1String("@xPoint, @yPoint")), |
|
850 | m_pointLabelsFormat(QLatin1String("@xPoint, @yPoint")), | |
813 | m_pointLabelsVisible(false), |
|
851 | m_pointLabelsVisible(false), | |
814 | m_pointLabelsFont(QChartPrivate::defaultFont()), |
|
852 | m_pointLabelsFont(QChartPrivate::defaultFont()), | |
815 | m_pointLabelsColor(QChartPrivate::defaultPen().color()) |
|
853 | m_pointLabelsColor(QChartPrivate::defaultPen().color()), | |
|
854 | m_pointLabelsClipping(true) | |||
816 | { |
|
855 | { | |
817 | } |
|
856 | } | |
818 |
|
857 | |||
819 | void QXYSeriesPrivate::initializeDomain() |
|
858 | void QXYSeriesPrivate::initializeDomain() | |
820 | { |
|
859 | { | |
821 | qreal minX(0); |
|
860 | qreal minX(0); | |
822 | qreal minY(0); |
|
861 | qreal minY(0); | |
823 | qreal maxX(1); |
|
862 | qreal maxX(1); | |
824 | qreal maxY(1); |
|
863 | qreal maxY(1); | |
825 |
|
864 | |||
826 | Q_Q(QXYSeries); |
|
865 | Q_Q(QXYSeries); | |
827 |
|
866 | |||
828 | const QList<QPointF>& points = q->points(); |
|
867 | const QList<QPointF>& points = q->points(); | |
829 |
|
868 | |||
830 | if (!points.isEmpty()) { |
|
869 | if (!points.isEmpty()) { | |
831 | minX = points[0].x(); |
|
870 | minX = points[0].x(); | |
832 | minY = points[0].y(); |
|
871 | minY = points[0].y(); | |
833 | maxX = minX; |
|
872 | maxX = minX; | |
834 | maxY = minY; |
|
873 | maxY = minY; | |
835 |
|
874 | |||
836 | for (int i = 0; i < points.count(); i++) { |
|
875 | for (int i = 0; i < points.count(); i++) { | |
837 | qreal x = points[i].x(); |
|
876 | qreal x = points[i].x(); | |
838 | qreal y = points[i].y(); |
|
877 | qreal y = points[i].y(); | |
839 | minX = qMin(minX, x); |
|
878 | minX = qMin(minX, x); | |
840 | minY = qMin(minY, y); |
|
879 | minY = qMin(minY, y); | |
841 | maxX = qMax(maxX, x); |
|
880 | maxX = qMax(maxX, x); | |
842 | maxY = qMax(maxY, y); |
|
881 | maxY = qMax(maxY, y); | |
843 | } |
|
882 | } | |
844 | } |
|
883 | } | |
845 |
|
884 | |||
846 | domain()->setRange(minX, maxX, minY, maxY); |
|
885 | domain()->setRange(minX, maxX, minY, maxY); | |
847 | } |
|
886 | } | |
848 |
|
887 | |||
849 | QList<QLegendMarker*> QXYSeriesPrivate::createLegendMarkers(QLegend* legend) |
|
888 | QList<QLegendMarker*> QXYSeriesPrivate::createLegendMarkers(QLegend* legend) | |
850 | { |
|
889 | { | |
851 | Q_Q(QXYSeries); |
|
890 | Q_Q(QXYSeries); | |
852 | QList<QLegendMarker*> list; |
|
891 | QList<QLegendMarker*> list; | |
853 | return list << new QXYLegendMarker(q,legend); |
|
892 | return list << new QXYLegendMarker(q,legend); | |
854 | } |
|
893 | } | |
855 |
|
894 | |||
856 | void QXYSeriesPrivate::initializeAxes() |
|
895 | void QXYSeriesPrivate::initializeAxes() | |
857 | { |
|
896 | { | |
858 |
|
897 | |||
859 | } |
|
898 | } | |
860 |
|
899 | |||
861 | QAbstractAxis::AxisType QXYSeriesPrivate::defaultAxisType(Qt::Orientation orientation) const |
|
900 | QAbstractAxis::AxisType QXYSeriesPrivate::defaultAxisType(Qt::Orientation orientation) const | |
862 | { |
|
901 | { | |
863 | Q_UNUSED(orientation); |
|
902 | Q_UNUSED(orientation); | |
864 | return QAbstractAxis::AxisTypeValue; |
|
903 | return QAbstractAxis::AxisTypeValue; | |
865 | } |
|
904 | } | |
866 |
|
905 | |||
867 | QAbstractAxis* QXYSeriesPrivate::createDefaultAxis(Qt::Orientation orientation) const |
|
906 | QAbstractAxis* QXYSeriesPrivate::createDefaultAxis(Qt::Orientation orientation) const | |
868 | { |
|
907 | { | |
869 | Q_UNUSED(orientation); |
|
908 | Q_UNUSED(orientation); | |
870 | return new QValueAxis; |
|
909 | return new QValueAxis; | |
871 | } |
|
910 | } | |
872 |
|
911 | |||
873 | void QXYSeriesPrivate::initializeAnimations(QtCharts::QChart::AnimationOptions options, |
|
912 | void QXYSeriesPrivate::initializeAnimations(QtCharts::QChart::AnimationOptions options, | |
874 | int duration, QEasingCurve &curve) |
|
913 | int duration, QEasingCurve &curve) | |
875 | { |
|
914 | { | |
876 | XYChart *item = static_cast<XYChart *>(m_item.data()); |
|
915 | XYChart *item = static_cast<XYChart *>(m_item.data()); | |
877 | Q_ASSERT(item); |
|
916 | Q_ASSERT(item); | |
878 | if (item->animation()) |
|
917 | if (item->animation()) | |
879 | item->animation()->stopAndDestroyLater(); |
|
918 | item->animation()->stopAndDestroyLater(); | |
880 |
|
919 | |||
881 | if (options.testFlag(QChart::SeriesAnimations)) |
|
920 | if (options.testFlag(QChart::SeriesAnimations)) | |
882 | item->setAnimation(new XYAnimation(item, duration, curve)); |
|
921 | item->setAnimation(new XYAnimation(item, duration, curve)); | |
883 | else |
|
922 | else | |
884 | item->setAnimation(0); |
|
923 | item->setAnimation(0); | |
885 | QAbstractSeriesPrivate::initializeAnimations(options, duration, curve); |
|
924 | QAbstractSeriesPrivate::initializeAnimations(options, duration, curve); | |
886 | } |
|
925 | } | |
887 |
|
926 | |||
888 | void QXYSeriesPrivate::drawSeriesPointLabels(QPainter *painter, const QVector<QPointF> &points, |
|
927 | void QXYSeriesPrivate::drawSeriesPointLabels(QPainter *painter, const QVector<QPointF> &points, | |
889 | const int offset) |
|
928 | const int offset) | |
890 | { |
|
929 | { | |
891 | static const QString xPointTag(QLatin1String("@xPoint")); |
|
930 | static const QString xPointTag(QLatin1String("@xPoint")); | |
892 | static const QString yPointTag(QLatin1String("@yPoint")); |
|
931 | static const QString yPointTag(QLatin1String("@yPoint")); | |
893 | const int labelOffset = offset + 2; |
|
932 | const int labelOffset = offset + 2; | |
894 |
|
933 | |||
895 | painter->setFont(m_pointLabelsFont); |
|
934 | painter->setFont(m_pointLabelsFont); | |
896 | painter->setPen(QPen(m_pointLabelsColor)); |
|
935 | painter->setPen(QPen(m_pointLabelsColor)); | |
897 | QFontMetrics fm(painter->font()); |
|
936 | QFontMetrics fm(painter->font()); | |
898 | // m_points is used for the label here as it has the series point information |
|
937 | // m_points is used for the label here as it has the series point information | |
899 | // points variable passed is used for positioning because it has the coordinates |
|
938 | // points variable passed is used for positioning because it has the coordinates | |
900 | for (int i(0); i < m_points.size(); i++) { |
|
939 | for (int i(0); i < m_points.size(); i++) { | |
901 | QString pointLabel = m_pointLabelsFormat; |
|
940 | QString pointLabel = m_pointLabelsFormat; | |
902 | pointLabel.replace(xPointTag, presenter()->numberToString(m_points.at(i).x())); |
|
941 | pointLabel.replace(xPointTag, presenter()->numberToString(m_points.at(i).x())); | |
903 | pointLabel.replace(yPointTag, presenter()->numberToString(m_points.at(i).y())); |
|
942 | pointLabel.replace(yPointTag, presenter()->numberToString(m_points.at(i).y())); | |
904 |
|
943 | |||
905 | // Position text in relation to the point |
|
944 | // Position text in relation to the point | |
906 | int pointLabelWidth = fm.width(pointLabel); |
|
945 | int pointLabelWidth = fm.width(pointLabel); | |
907 | QPointF position(points.at(i)); |
|
946 | QPointF position(points.at(i)); | |
908 | if (!reverseXAxis()) |
|
947 | if (!reverseXAxis()) | |
909 | position.setX(position.x() - pointLabelWidth / 2); |
|
948 | position.setX(position.x() - pointLabelWidth / 2); | |
910 | else |
|
949 | else | |
911 | position.setX(domain()->size().width() - position.x() - pointLabelWidth / 2); |
|
950 | position.setX(domain()->size().width() - position.x() - pointLabelWidth / 2); | |
912 | if (!reverseYAxis()) |
|
951 | if (!reverseYAxis()) | |
913 | position.setY(position.y() - labelOffset); |
|
952 | position.setY(position.y() - labelOffset); | |
914 | else |
|
953 | else | |
915 | position.setY(domain()->size().height() - position.y() - labelOffset); |
|
954 | position.setY(domain()->size().height() - position.y() - labelOffset); | |
916 |
|
955 | |||
917 | painter->drawText(position, pointLabel); |
|
956 | painter->drawText(position, pointLabel); | |
918 | } |
|
957 | } | |
919 | } |
|
958 | } | |
920 |
|
959 | |||
921 | #include "moc_qxyseries.cpp" |
|
960 | #include "moc_qxyseries.cpp" | |
922 | #include "moc_qxyseries_p.cpp" |
|
961 | #include "moc_qxyseries_p.cpp" | |
923 |
|
962 | |||
924 | QT_CHARTS_END_NAMESPACE |
|
963 | QT_CHARTS_END_NAMESPACE |
@@ -1,126 +1,131 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
3 | ** Copyright (C) 2015 The Qt Company Ltd | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Charts module. |
|
7 | ** This file is part of the Qt Charts module. | |
8 | ** |
|
8 | ** | |
9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
9 | ** Licensees holding valid commercial license for Qt may use this file in | |
10 | ** accordance with the Qt License Agreement provided with the Software |
|
10 | ** accordance with the Qt License Agreement provided with the Software | |
11 | ** or, alternatively, in accordance with the terms contained in a written |
|
11 | ** or, alternatively, in accordance with the terms contained in a written | |
12 | ** agreement between you and The Qt Company. |
|
12 | ** agreement between you and The Qt Company. | |
13 | ** |
|
13 | ** | |
14 | ** If you have questions regarding the use of this file, please use |
|
14 | ** If you have questions regarding the use of this file, please use | |
15 | ** contact form at http://qt.io |
|
15 | ** contact form at http://qt.io | |
16 | ** |
|
16 | ** | |
17 | ****************************************************************************/ |
|
17 | ****************************************************************************/ | |
18 |
|
18 | |||
19 | #ifndef QXYSERIES_H |
|
19 | #ifndef QXYSERIES_H | |
20 | #define QXYSERIES_H |
|
20 | #define QXYSERIES_H | |
21 |
|
21 | |||
22 | #include <QtCharts/QChartGlobal> |
|
22 | #include <QtCharts/QChartGlobal> | |
23 | #include <QtCharts/QAbstractSeries> |
|
23 | #include <QtCharts/QAbstractSeries> | |
24 | #include <QtGui/QPen> |
|
24 | #include <QtGui/QPen> | |
25 | #include <QtGui/QBrush> |
|
25 | #include <QtGui/QBrush> | |
26 |
|
26 | |||
27 | QT_BEGIN_NAMESPACE |
|
27 | QT_BEGIN_NAMESPACE | |
28 | class QModelIndex; |
|
28 | class QModelIndex; | |
29 | QT_END_NAMESPACE |
|
29 | QT_END_NAMESPACE | |
30 |
|
30 | |||
31 | QT_CHARTS_BEGIN_NAMESPACE |
|
31 | QT_CHARTS_BEGIN_NAMESPACE | |
32 |
|
32 | |||
33 | class QXYSeriesPrivate; |
|
33 | class QXYSeriesPrivate; | |
34 | class QXYModelMapper; |
|
34 | class QXYModelMapper; | |
35 |
|
35 | |||
36 | class QT_CHARTS_EXPORT QXYSeries : public QAbstractSeries |
|
36 | class QT_CHARTS_EXPORT QXYSeries : public QAbstractSeries | |
37 | { |
|
37 | { | |
38 | Q_OBJECT |
|
38 | Q_OBJECT | |
39 | Q_PROPERTY(bool pointsVisible READ pointsVisible WRITE setPointsVisible) |
|
39 | Q_PROPERTY(bool pointsVisible READ pointsVisible WRITE setPointsVisible) | |
40 | Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) |
|
40 | Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) | |
41 | Q_PROPERTY(QString pointLabelsFormat READ pointLabelsFormat WRITE setPointLabelsFormat NOTIFY pointLabelsFormatChanged) |
|
41 | Q_PROPERTY(QString pointLabelsFormat READ pointLabelsFormat WRITE setPointLabelsFormat NOTIFY pointLabelsFormatChanged) | |
42 | Q_PROPERTY(bool pointLabelsVisible READ pointLabelsVisible WRITE setPointLabelsVisible NOTIFY pointLabelsVisibilityChanged) |
|
42 | Q_PROPERTY(bool pointLabelsVisible READ pointLabelsVisible WRITE setPointLabelsVisible NOTIFY pointLabelsVisibilityChanged) | |
43 | Q_PROPERTY(QFont pointLabelsFont READ pointLabelsFont WRITE setPointLabelsFont NOTIFY pointLabelsFontChanged) |
|
43 | Q_PROPERTY(QFont pointLabelsFont READ pointLabelsFont WRITE setPointLabelsFont NOTIFY pointLabelsFontChanged) | |
44 | Q_PROPERTY(QColor pointLabelsColor READ pointLabelsColor WRITE setPointLabelsColor NOTIFY pointLabelsColorChanged) |
|
44 | Q_PROPERTY(QColor pointLabelsColor READ pointLabelsColor WRITE setPointLabelsColor NOTIFY pointLabelsColorChanged) | |
|
45 | Q_PROPERTY(bool pointLabelsClipping READ pointLabelsClipping WRITE setPointLabelsClipping NOTIFY pointLabelsClippingChanged) | |||
45 |
|
46 | |||
46 | protected: |
|
47 | protected: | |
47 | explicit QXYSeries(QXYSeriesPrivate &d, QObject *parent = 0); |
|
48 | explicit QXYSeries(QXYSeriesPrivate &d, QObject *parent = 0); | |
48 |
|
49 | |||
49 | public: |
|
50 | public: | |
50 | ~QXYSeries(); |
|
51 | ~QXYSeries(); | |
51 | void append(qreal x, qreal y); |
|
52 | void append(qreal x, qreal y); | |
52 | void append(const QPointF &point); |
|
53 | void append(const QPointF &point); | |
53 | void append(const QList<QPointF> &points); |
|
54 | void append(const QList<QPointF> &points); | |
54 | void replace(qreal oldX, qreal oldY, qreal newX, qreal newY); |
|
55 | void replace(qreal oldX, qreal oldY, qreal newX, qreal newY); | |
55 | void replace(const QPointF &oldPoint, const QPointF &newPoint); |
|
56 | void replace(const QPointF &oldPoint, const QPointF &newPoint); | |
56 | void replace(int index, qreal newX, qreal newY); |
|
57 | void replace(int index, qreal newX, qreal newY); | |
57 | void replace(int index, const QPointF &newPoint); |
|
58 | void replace(int index, const QPointF &newPoint); | |
58 | void remove(qreal x, qreal y); |
|
59 | void remove(qreal x, qreal y); | |
59 | void remove(const QPointF &point); |
|
60 | void remove(const QPointF &point); | |
60 | void remove(int index); |
|
61 | void remove(int index); | |
61 | void removePoints(int index, int count); |
|
62 | void removePoints(int index, int count); | |
62 | void insert(int index, const QPointF &point); |
|
63 | void insert(int index, const QPointF &point); | |
63 | void clear(); |
|
64 | void clear(); | |
64 |
|
65 | |||
65 | int count() const; |
|
66 | int count() const; | |
66 | QList<QPointF> points() const; |
|
67 | QList<QPointF> points() const; | |
67 | const QPointF &at(int index) const; |
|
68 | const QPointF &at(int index) const; | |
68 |
|
69 | |||
69 | QXYSeries &operator << (const QPointF &point); |
|
70 | QXYSeries &operator << (const QPointF &point); | |
70 | QXYSeries &operator << (const QList<QPointF> &points); |
|
71 | QXYSeries &operator << (const QList<QPointF> &points); | |
71 |
|
72 | |||
72 | virtual void setPen(const QPen &pen); |
|
73 | virtual void setPen(const QPen &pen); | |
73 | QPen pen() const; |
|
74 | QPen pen() const; | |
74 |
|
75 | |||
75 | virtual void setBrush(const QBrush &brush); |
|
76 | virtual void setBrush(const QBrush &brush); | |
76 | QBrush brush() const; |
|
77 | QBrush brush() const; | |
77 |
|
78 | |||
78 | virtual void setColor(const QColor &color); |
|
79 | virtual void setColor(const QColor &color); | |
79 | virtual QColor color() const; |
|
80 | virtual QColor color() const; | |
80 |
|
81 | |||
81 | void setPointsVisible(bool visible = true); |
|
82 | void setPointsVisible(bool visible = true); | |
82 | bool pointsVisible() const; |
|
83 | bool pointsVisible() const; | |
83 |
|
84 | |||
84 | void setPointLabelsFormat(const QString &format); |
|
85 | void setPointLabelsFormat(const QString &format); | |
85 | QString pointLabelsFormat() const; |
|
86 | QString pointLabelsFormat() const; | |
86 |
|
87 | |||
87 | void setPointLabelsVisible(bool visible = true); |
|
88 | void setPointLabelsVisible(bool visible = true); | |
88 | bool pointLabelsVisible() const; |
|
89 | bool pointLabelsVisible() const; | |
89 |
|
90 | |||
90 | void setPointLabelsFont(const QFont &font); |
|
91 | void setPointLabelsFont(const QFont &font); | |
91 | QFont pointLabelsFont() const; |
|
92 | QFont pointLabelsFont() const; | |
92 |
|
93 | |||
93 | void setPointLabelsColor(const QColor &color); |
|
94 | void setPointLabelsColor(const QColor &color); | |
94 | QColor pointLabelsColor() const; |
|
95 | QColor pointLabelsColor() const; | |
95 |
|
96 | |||
|
97 | void setPointLabelsClipping(bool enabled = true); | |||
|
98 | bool pointLabelsClipping() const; | |||
|
99 | ||||
96 | void replace(QList<QPointF> points); |
|
100 | void replace(QList<QPointF> points); | |
97 | void replace(QVector<QPointF> points); |
|
101 | void replace(QVector<QPointF> points); | |
98 |
|
102 | |||
99 | Q_SIGNALS: |
|
103 | Q_SIGNALS: | |
100 | void clicked(const QPointF &point); |
|
104 | void clicked(const QPointF &point); | |
101 | void hovered(const QPointF &point, bool state); |
|
105 | void hovered(const QPointF &point, bool state); | |
102 | void pressed(const QPointF &point); |
|
106 | void pressed(const QPointF &point); | |
103 | void released(const QPointF &point); |
|
107 | void released(const QPointF &point); | |
104 | void doubleClicked(const QPointF &point); |
|
108 | void doubleClicked(const QPointF &point); | |
105 | void pointReplaced(int index); |
|
109 | void pointReplaced(int index); | |
106 | void pointRemoved(int index); |
|
110 | void pointRemoved(int index); | |
107 | void pointAdded(int index); |
|
111 | void pointAdded(int index); | |
108 | void colorChanged(QColor color); |
|
112 | void colorChanged(QColor color); | |
109 | void pointsReplaced(); |
|
113 | void pointsReplaced(); | |
110 | void pointLabelsFormatChanged(const QString &format); |
|
114 | void pointLabelsFormatChanged(const QString &format); | |
111 | void pointLabelsVisibilityChanged(bool visible); |
|
115 | void pointLabelsVisibilityChanged(bool visible); | |
112 | void pointLabelsFontChanged(const QFont &font); |
|
116 | void pointLabelsFontChanged(const QFont &font); | |
113 | void pointLabelsColorChanged(const QColor &color); |
|
117 | void pointLabelsColorChanged(const QColor &color); | |
|
118 | void pointLabelsClippingChanged(bool clipping); | |||
114 | void pointsRemoved(int index, int count); |
|
119 | void pointsRemoved(int index, int count); | |
115 |
|
120 | |||
116 | private: |
|
121 | private: | |
117 | Q_DECLARE_PRIVATE(QXYSeries) |
|
122 | Q_DECLARE_PRIVATE(QXYSeries) | |
118 | Q_DISABLE_COPY(QXYSeries) |
|
123 | Q_DISABLE_COPY(QXYSeries) | |
119 | friend class QXYLegendMarkerPrivate; |
|
124 | friend class QXYLegendMarkerPrivate; | |
120 | friend class XYLegendMarker; |
|
125 | friend class XYLegendMarker; | |
121 | friend class XYChart; |
|
126 | friend class XYChart; | |
122 | }; |
|
127 | }; | |
123 |
|
128 | |||
124 | QT_CHARTS_END_NAMESPACE |
|
129 | QT_CHARTS_END_NAMESPACE | |
125 |
|
130 | |||
126 | #endif // QXYSERIES_H |
|
131 | #endif // QXYSERIES_H |
@@ -1,78 +1,79 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
3 | ** Copyright (C) 2015 The Qt Company Ltd | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Charts module. |
|
7 | ** This file is part of the Qt Charts module. | |
8 | ** |
|
8 | ** | |
9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
9 | ** Licensees holding valid commercial license for Qt may use this file in | |
10 | ** accordance with the Qt License Agreement provided with the Software |
|
10 | ** accordance with the Qt License Agreement provided with the Software | |
11 | ** or, alternatively, in accordance with the terms contained in a written |
|
11 | ** or, alternatively, in accordance with the terms contained in a written | |
12 | ** agreement between you and The Qt Company. |
|
12 | ** agreement between you and The Qt Company. | |
13 | ** |
|
13 | ** | |
14 | ** If you have questions regarding the use of this file, please use |
|
14 | ** If you have questions regarding the use of this file, please use | |
15 | ** contact form at http://qt.io |
|
15 | ** contact form at http://qt.io | |
16 | ** |
|
16 | ** | |
17 | ****************************************************************************/ |
|
17 | ****************************************************************************/ | |
18 |
|
18 | |||
19 | // W A R N I N G |
|
19 | // W A R N I N G | |
20 | // ------------- |
|
20 | // ------------- | |
21 | // |
|
21 | // | |
22 | // This file is not part of the Qt Chart API. It exists purely as an |
|
22 | // This file is not part of the Qt Chart API. It exists purely as an | |
23 | // implementation detail. This header file may change from version to |
|
23 | // implementation detail. This header file may change from version to | |
24 | // version without notice, or even be removed. |
|
24 | // version without notice, or even be removed. | |
25 | // |
|
25 | // | |
26 | // We mean it. |
|
26 | // We mean it. | |
27 |
|
27 | |||
28 | #ifndef QXYSERIES_P_H |
|
28 | #ifndef QXYSERIES_P_H | |
29 | #define QXYSERIES_P_H |
|
29 | #define QXYSERIES_P_H | |
30 |
|
30 | |||
31 | #include <private/qabstractseries_p.h> |
|
31 | #include <private/qabstractseries_p.h> | |
32 |
|
32 | |||
33 | QT_CHARTS_BEGIN_NAMESPACE |
|
33 | QT_CHARTS_BEGIN_NAMESPACE | |
34 |
|
34 | |||
35 | class QXYSeries; |
|
35 | class QXYSeries; | |
36 | class QAbstractAxis; |
|
36 | class QAbstractAxis; | |
37 |
|
37 | |||
38 | class QXYSeriesPrivate: public QAbstractSeriesPrivate |
|
38 | class QXYSeriesPrivate: public QAbstractSeriesPrivate | |
39 | { |
|
39 | { | |
40 | Q_OBJECT |
|
40 | Q_OBJECT | |
41 |
|
41 | |||
42 | public: |
|
42 | public: | |
43 | QXYSeriesPrivate(QXYSeries *q); |
|
43 | QXYSeriesPrivate(QXYSeries *q); | |
44 |
|
44 | |||
45 | void initializeDomain(); |
|
45 | void initializeDomain(); | |
46 | void initializeAxes(); |
|
46 | void initializeAxes(); | |
47 | void initializeAnimations(QtCharts::QChart::AnimationOptions options, int duration, |
|
47 | void initializeAnimations(QtCharts::QChart::AnimationOptions options, int duration, | |
48 | QEasingCurve &curve); |
|
48 | QEasingCurve &curve); | |
49 |
|
49 | |||
50 | QList<QLegendMarker*> createLegendMarkers(QLegend* legend); |
|
50 | QList<QLegendMarker*> createLegendMarkers(QLegend* legend); | |
51 |
|
51 | |||
52 | QAbstractAxis::AxisType defaultAxisType(Qt::Orientation orientation) const; |
|
52 | QAbstractAxis::AxisType defaultAxisType(Qt::Orientation orientation) const; | |
53 | QAbstractAxis* createDefaultAxis(Qt::Orientation orientation) const; |
|
53 | QAbstractAxis* createDefaultAxis(Qt::Orientation orientation) const; | |
54 |
|
54 | |||
55 | void drawSeriesPointLabels(QPainter *painter, const QVector<QPointF> &points, |
|
55 | void drawSeriesPointLabels(QPainter *painter, const QVector<QPointF> &points, | |
56 | const int offset = 0); |
|
56 | const int offset = 0); | |
57 |
|
57 | |||
58 | Q_SIGNALS: |
|
58 | Q_SIGNALS: | |
59 | void updated(); |
|
59 | void updated(); | |
60 |
|
60 | |||
61 | protected: |
|
61 | protected: | |
62 | QVector<QPointF> m_points; |
|
62 | QVector<QPointF> m_points; | |
63 | QPen m_pen; |
|
63 | QPen m_pen; | |
64 | QBrush m_brush; |
|
64 | QBrush m_brush; | |
65 | bool m_pointsVisible; |
|
65 | bool m_pointsVisible; | |
66 | QString m_pointLabelsFormat; |
|
66 | QString m_pointLabelsFormat; | |
67 | bool m_pointLabelsVisible; |
|
67 | bool m_pointLabelsVisible; | |
68 | QFont m_pointLabelsFont; |
|
68 | QFont m_pointLabelsFont; | |
69 | QColor m_pointLabelsColor; |
|
69 | QColor m_pointLabelsColor; | |
|
70 | bool m_pointLabelsClipping; | |||
70 |
|
71 | |||
71 | private: |
|
72 | private: | |
72 | Q_DECLARE_PUBLIC(QXYSeries) |
|
73 | Q_DECLARE_PUBLIC(QXYSeries) | |
73 | friend class QScatterSeries; |
|
74 | friend class QScatterSeries; | |
74 | }; |
|
75 | }; | |
75 |
|
76 | |||
76 | QT_CHARTS_END_NAMESPACE |
|
77 | QT_CHARTS_END_NAMESPACE | |
77 |
|
78 | |||
78 | #endif |
|
79 | #endif |
@@ -1,2962 +1,2972 | |||||
1 | import QtQuick.tooling 1.2 |
|
1 | import QtQuick.tooling 1.2 | |
2 |
|
2 | |||
3 | // This file describes the plugin-supplied types contained in the library. |
|
3 | // This file describes the plugin-supplied types contained in the library. | |
4 | // It is used for QML tooling purposes only. |
|
4 | // It is used for QML tooling purposes only. | |
5 | // |
|
5 | // | |
6 | // This file was auto-generated by: |
|
6 | // This file was auto-generated by: | |
7 | // 'qmlplugindump -nonrelocatable QtCharts 2.0' |
|
7 | // 'qmlplugindump -nonrelocatable QtCharts 2.0' | |
8 |
|
8 | |||
9 | Module { |
|
9 | Module { | |
10 | dependencies: [] |
|
10 | dependencies: [] | |
11 | Component { |
|
11 | Component { | |
12 | name: "QAbstractItemModel" |
|
12 | name: "QAbstractItemModel" | |
13 | prototype: "QObject" |
|
13 | prototype: "QObject" | |
14 | exports: [ |
|
14 | exports: [ | |
15 | "QtCharts/AbstractItemModel 1.0", |
|
15 | "QtCharts/AbstractItemModel 1.0", | |
16 | "QtCharts/AbstractItemModel 2.0" |
|
16 | "QtCharts/AbstractItemModel 2.0" | |
17 | ] |
|
17 | ] | |
18 | isCreatable: false |
|
18 | isCreatable: false | |
19 | exportMetaObjectRevisions: [0, 0] |
|
19 | exportMetaObjectRevisions: [0, 0] | |
20 | Enum { |
|
20 | Enum { | |
21 | name: "LayoutChangeHint" |
|
21 | name: "LayoutChangeHint" | |
22 | values: { |
|
22 | values: { | |
23 | "NoLayoutChangeHint": 0, |
|
23 | "NoLayoutChangeHint": 0, | |
24 | "VerticalSortHint": 1, |
|
24 | "VerticalSortHint": 1, | |
25 | "HorizontalSortHint": 2 |
|
25 | "HorizontalSortHint": 2 | |
26 | } |
|
26 | } | |
27 | } |
|
27 | } | |
28 | Signal { |
|
28 | Signal { | |
29 | name: "dataChanged" |
|
29 | name: "dataChanged" | |
30 | Parameter { name: "topLeft"; type: "QModelIndex" } |
|
30 | Parameter { name: "topLeft"; type: "QModelIndex" } | |
31 | Parameter { name: "bottomRight"; type: "QModelIndex" } |
|
31 | Parameter { name: "bottomRight"; type: "QModelIndex" } | |
32 | Parameter { name: "roles"; type: "QVector<int>" } |
|
32 | Parameter { name: "roles"; type: "QVector<int>" } | |
33 | } |
|
33 | } | |
34 | Signal { |
|
34 | Signal { | |
35 | name: "dataChanged" |
|
35 | name: "dataChanged" | |
36 | Parameter { name: "topLeft"; type: "QModelIndex" } |
|
36 | Parameter { name: "topLeft"; type: "QModelIndex" } | |
37 | Parameter { name: "bottomRight"; type: "QModelIndex" } |
|
37 | Parameter { name: "bottomRight"; type: "QModelIndex" } | |
38 | } |
|
38 | } | |
39 | Signal { |
|
39 | Signal { | |
40 | name: "headerDataChanged" |
|
40 | name: "headerDataChanged" | |
41 | Parameter { name: "orientation"; type: "Qt::Orientation" } |
|
41 | Parameter { name: "orientation"; type: "Qt::Orientation" } | |
42 | Parameter { name: "first"; type: "int" } |
|
42 | Parameter { name: "first"; type: "int" } | |
43 | Parameter { name: "last"; type: "int" } |
|
43 | Parameter { name: "last"; type: "int" } | |
44 | } |
|
44 | } | |
45 | Signal { |
|
45 | Signal { | |
46 | name: "layoutChanged" |
|
46 | name: "layoutChanged" | |
47 | Parameter { name: "parents"; type: "QList<QPersistentModelIndex>" } |
|
47 | Parameter { name: "parents"; type: "QList<QPersistentModelIndex>" } | |
48 | Parameter { name: "hint"; type: "QAbstractItemModel::LayoutChangeHint" } |
|
48 | Parameter { name: "hint"; type: "QAbstractItemModel::LayoutChangeHint" } | |
49 | } |
|
49 | } | |
50 | Signal { |
|
50 | Signal { | |
51 | name: "layoutChanged" |
|
51 | name: "layoutChanged" | |
52 | Parameter { name: "parents"; type: "QList<QPersistentModelIndex>" } |
|
52 | Parameter { name: "parents"; type: "QList<QPersistentModelIndex>" } | |
53 | } |
|
53 | } | |
54 | Signal { name: "layoutChanged" } |
|
54 | Signal { name: "layoutChanged" } | |
55 | Signal { |
|
55 | Signal { | |
56 | name: "layoutAboutToBeChanged" |
|
56 | name: "layoutAboutToBeChanged" | |
57 | Parameter { name: "parents"; type: "QList<QPersistentModelIndex>" } |
|
57 | Parameter { name: "parents"; type: "QList<QPersistentModelIndex>" } | |
58 | Parameter { name: "hint"; type: "QAbstractItemModel::LayoutChangeHint" } |
|
58 | Parameter { name: "hint"; type: "QAbstractItemModel::LayoutChangeHint" } | |
59 | } |
|
59 | } | |
60 | Signal { |
|
60 | Signal { | |
61 | name: "layoutAboutToBeChanged" |
|
61 | name: "layoutAboutToBeChanged" | |
62 | Parameter { name: "parents"; type: "QList<QPersistentModelIndex>" } |
|
62 | Parameter { name: "parents"; type: "QList<QPersistentModelIndex>" } | |
63 | } |
|
63 | } | |
64 | Signal { name: "layoutAboutToBeChanged" } |
|
64 | Signal { name: "layoutAboutToBeChanged" } | |
65 | Signal { |
|
65 | Signal { | |
66 | name: "rowsAboutToBeInserted" |
|
66 | name: "rowsAboutToBeInserted" | |
67 | Parameter { name: "parent"; type: "QModelIndex" } |
|
67 | Parameter { name: "parent"; type: "QModelIndex" } | |
68 | Parameter { name: "first"; type: "int" } |
|
68 | Parameter { name: "first"; type: "int" } | |
69 | Parameter { name: "last"; type: "int" } |
|
69 | Parameter { name: "last"; type: "int" } | |
70 | } |
|
70 | } | |
71 | Signal { |
|
71 | Signal { | |
72 | name: "rowsInserted" |
|
72 | name: "rowsInserted" | |
73 | Parameter { name: "parent"; type: "QModelIndex" } |
|
73 | Parameter { name: "parent"; type: "QModelIndex" } | |
74 | Parameter { name: "first"; type: "int" } |
|
74 | Parameter { name: "first"; type: "int" } | |
75 | Parameter { name: "last"; type: "int" } |
|
75 | Parameter { name: "last"; type: "int" } | |
76 | } |
|
76 | } | |
77 | Signal { |
|
77 | Signal { | |
78 | name: "rowsAboutToBeRemoved" |
|
78 | name: "rowsAboutToBeRemoved" | |
79 | Parameter { name: "parent"; type: "QModelIndex" } |
|
79 | Parameter { name: "parent"; type: "QModelIndex" } | |
80 | Parameter { name: "first"; type: "int" } |
|
80 | Parameter { name: "first"; type: "int" } | |
81 | Parameter { name: "last"; type: "int" } |
|
81 | Parameter { name: "last"; type: "int" } | |
82 | } |
|
82 | } | |
83 | Signal { |
|
83 | Signal { | |
84 | name: "rowsRemoved" |
|
84 | name: "rowsRemoved" | |
85 | Parameter { name: "parent"; type: "QModelIndex" } |
|
85 | Parameter { name: "parent"; type: "QModelIndex" } | |
86 | Parameter { name: "first"; type: "int" } |
|
86 | Parameter { name: "first"; type: "int" } | |
87 | Parameter { name: "last"; type: "int" } |
|
87 | Parameter { name: "last"; type: "int" } | |
88 | } |
|
88 | } | |
89 | Signal { |
|
89 | Signal { | |
90 | name: "columnsAboutToBeInserted" |
|
90 | name: "columnsAboutToBeInserted" | |
91 | Parameter { name: "parent"; type: "QModelIndex" } |
|
91 | Parameter { name: "parent"; type: "QModelIndex" } | |
92 | Parameter { name: "first"; type: "int" } |
|
92 | Parameter { name: "first"; type: "int" } | |
93 | Parameter { name: "last"; type: "int" } |
|
93 | Parameter { name: "last"; type: "int" } | |
94 | } |
|
94 | } | |
95 | Signal { |
|
95 | Signal { | |
96 | name: "columnsInserted" |
|
96 | name: "columnsInserted" | |
97 | Parameter { name: "parent"; type: "QModelIndex" } |
|
97 | Parameter { name: "parent"; type: "QModelIndex" } | |
98 | Parameter { name: "first"; type: "int" } |
|
98 | Parameter { name: "first"; type: "int" } | |
99 | Parameter { name: "last"; type: "int" } |
|
99 | Parameter { name: "last"; type: "int" } | |
100 | } |
|
100 | } | |
101 | Signal { |
|
101 | Signal { | |
102 | name: "columnsAboutToBeRemoved" |
|
102 | name: "columnsAboutToBeRemoved" | |
103 | Parameter { name: "parent"; type: "QModelIndex" } |
|
103 | Parameter { name: "parent"; type: "QModelIndex" } | |
104 | Parameter { name: "first"; type: "int" } |
|
104 | Parameter { name: "first"; type: "int" } | |
105 | Parameter { name: "last"; type: "int" } |
|
105 | Parameter { name: "last"; type: "int" } | |
106 | } |
|
106 | } | |
107 | Signal { |
|
107 | Signal { | |
108 | name: "columnsRemoved" |
|
108 | name: "columnsRemoved" | |
109 | Parameter { name: "parent"; type: "QModelIndex" } |
|
109 | Parameter { name: "parent"; type: "QModelIndex" } | |
110 | Parameter { name: "first"; type: "int" } |
|
110 | Parameter { name: "first"; type: "int" } | |
111 | Parameter { name: "last"; type: "int" } |
|
111 | Parameter { name: "last"; type: "int" } | |
112 | } |
|
112 | } | |
113 | Signal { name: "modelAboutToBeReset" } |
|
113 | Signal { name: "modelAboutToBeReset" } | |
114 | Signal { name: "modelReset" } |
|
114 | Signal { name: "modelReset" } | |
115 | Signal { |
|
115 | Signal { | |
116 | name: "rowsAboutToBeMoved" |
|
116 | name: "rowsAboutToBeMoved" | |
117 | Parameter { name: "sourceParent"; type: "QModelIndex" } |
|
117 | Parameter { name: "sourceParent"; type: "QModelIndex" } | |
118 | Parameter { name: "sourceStart"; type: "int" } |
|
118 | Parameter { name: "sourceStart"; type: "int" } | |
119 | Parameter { name: "sourceEnd"; type: "int" } |
|
119 | Parameter { name: "sourceEnd"; type: "int" } | |
120 | Parameter { name: "destinationParent"; type: "QModelIndex" } |
|
120 | Parameter { name: "destinationParent"; type: "QModelIndex" } | |
121 | Parameter { name: "destinationRow"; type: "int" } |
|
121 | Parameter { name: "destinationRow"; type: "int" } | |
122 | } |
|
122 | } | |
123 | Signal { |
|
123 | Signal { | |
124 | name: "rowsMoved" |
|
124 | name: "rowsMoved" | |
125 | Parameter { name: "parent"; type: "QModelIndex" } |
|
125 | Parameter { name: "parent"; type: "QModelIndex" } | |
126 | Parameter { name: "start"; type: "int" } |
|
126 | Parameter { name: "start"; type: "int" } | |
127 | Parameter { name: "end"; type: "int" } |
|
127 | Parameter { name: "end"; type: "int" } | |
128 | Parameter { name: "destination"; type: "QModelIndex" } |
|
128 | Parameter { name: "destination"; type: "QModelIndex" } | |
129 | Parameter { name: "row"; type: "int" } |
|
129 | Parameter { name: "row"; type: "int" } | |
130 | } |
|
130 | } | |
131 | Signal { |
|
131 | Signal { | |
132 | name: "columnsAboutToBeMoved" |
|
132 | name: "columnsAboutToBeMoved" | |
133 | Parameter { name: "sourceParent"; type: "QModelIndex" } |
|
133 | Parameter { name: "sourceParent"; type: "QModelIndex" } | |
134 | Parameter { name: "sourceStart"; type: "int" } |
|
134 | Parameter { name: "sourceStart"; type: "int" } | |
135 | Parameter { name: "sourceEnd"; type: "int" } |
|
135 | Parameter { name: "sourceEnd"; type: "int" } | |
136 | Parameter { name: "destinationParent"; type: "QModelIndex" } |
|
136 | Parameter { name: "destinationParent"; type: "QModelIndex" } | |
137 | Parameter { name: "destinationColumn"; type: "int" } |
|
137 | Parameter { name: "destinationColumn"; type: "int" } | |
138 | } |
|
138 | } | |
139 | Signal { |
|
139 | Signal { | |
140 | name: "columnsMoved" |
|
140 | name: "columnsMoved" | |
141 | Parameter { name: "parent"; type: "QModelIndex" } |
|
141 | Parameter { name: "parent"; type: "QModelIndex" } | |
142 | Parameter { name: "start"; type: "int" } |
|
142 | Parameter { name: "start"; type: "int" } | |
143 | Parameter { name: "end"; type: "int" } |
|
143 | Parameter { name: "end"; type: "int" } | |
144 | Parameter { name: "destination"; type: "QModelIndex" } |
|
144 | Parameter { name: "destination"; type: "QModelIndex" } | |
145 | Parameter { name: "column"; type: "int" } |
|
145 | Parameter { name: "column"; type: "int" } | |
146 | } |
|
146 | } | |
147 | Method { name: "submit"; type: "bool" } |
|
147 | Method { name: "submit"; type: "bool" } | |
148 | Method { name: "revert" } |
|
148 | Method { name: "revert" } | |
149 | Method { |
|
149 | Method { | |
150 | name: "hasIndex" |
|
150 | name: "hasIndex" | |
151 | type: "bool" |
|
151 | type: "bool" | |
152 | Parameter { name: "row"; type: "int" } |
|
152 | Parameter { name: "row"; type: "int" } | |
153 | Parameter { name: "column"; type: "int" } |
|
153 | Parameter { name: "column"; type: "int" } | |
154 | Parameter { name: "parent"; type: "QModelIndex" } |
|
154 | Parameter { name: "parent"; type: "QModelIndex" } | |
155 | } |
|
155 | } | |
156 | Method { |
|
156 | Method { | |
157 | name: "hasIndex" |
|
157 | name: "hasIndex" | |
158 | type: "bool" |
|
158 | type: "bool" | |
159 | Parameter { name: "row"; type: "int" } |
|
159 | Parameter { name: "row"; type: "int" } | |
160 | Parameter { name: "column"; type: "int" } |
|
160 | Parameter { name: "column"; type: "int" } | |
161 | } |
|
161 | } | |
162 | Method { |
|
162 | Method { | |
163 | name: "index" |
|
163 | name: "index" | |
164 | type: "QModelIndex" |
|
164 | type: "QModelIndex" | |
165 | Parameter { name: "row"; type: "int" } |
|
165 | Parameter { name: "row"; type: "int" } | |
166 | Parameter { name: "column"; type: "int" } |
|
166 | Parameter { name: "column"; type: "int" } | |
167 | Parameter { name: "parent"; type: "QModelIndex" } |
|
167 | Parameter { name: "parent"; type: "QModelIndex" } | |
168 | } |
|
168 | } | |
169 | Method { |
|
169 | Method { | |
170 | name: "index" |
|
170 | name: "index" | |
171 | type: "QModelIndex" |
|
171 | type: "QModelIndex" | |
172 | Parameter { name: "row"; type: "int" } |
|
172 | Parameter { name: "row"; type: "int" } | |
173 | Parameter { name: "column"; type: "int" } |
|
173 | Parameter { name: "column"; type: "int" } | |
174 | } |
|
174 | } | |
175 | Method { |
|
175 | Method { | |
176 | name: "parent" |
|
176 | name: "parent" | |
177 | type: "QModelIndex" |
|
177 | type: "QModelIndex" | |
178 | Parameter { name: "child"; type: "QModelIndex" } |
|
178 | Parameter { name: "child"; type: "QModelIndex" } | |
179 | } |
|
179 | } | |
180 | Method { |
|
180 | Method { | |
181 | name: "sibling" |
|
181 | name: "sibling" | |
182 | type: "QModelIndex" |
|
182 | type: "QModelIndex" | |
183 | Parameter { name: "row"; type: "int" } |
|
183 | Parameter { name: "row"; type: "int" } | |
184 | Parameter { name: "column"; type: "int" } |
|
184 | Parameter { name: "column"; type: "int" } | |
185 | Parameter { name: "idx"; type: "QModelIndex" } |
|
185 | Parameter { name: "idx"; type: "QModelIndex" } | |
186 | } |
|
186 | } | |
187 | Method { |
|
187 | Method { | |
188 | name: "rowCount" |
|
188 | name: "rowCount" | |
189 | type: "int" |
|
189 | type: "int" | |
190 | Parameter { name: "parent"; type: "QModelIndex" } |
|
190 | Parameter { name: "parent"; type: "QModelIndex" } | |
191 | } |
|
191 | } | |
192 | Method { name: "rowCount"; type: "int" } |
|
192 | Method { name: "rowCount"; type: "int" } | |
193 | Method { |
|
193 | Method { | |
194 | name: "columnCount" |
|
194 | name: "columnCount" | |
195 | type: "int" |
|
195 | type: "int" | |
196 | Parameter { name: "parent"; type: "QModelIndex" } |
|
196 | Parameter { name: "parent"; type: "QModelIndex" } | |
197 | } |
|
197 | } | |
198 | Method { name: "columnCount"; type: "int" } |
|
198 | Method { name: "columnCount"; type: "int" } | |
199 | Method { |
|
199 | Method { | |
200 | name: "hasChildren" |
|
200 | name: "hasChildren" | |
201 | type: "bool" |
|
201 | type: "bool" | |
202 | Parameter { name: "parent"; type: "QModelIndex" } |
|
202 | Parameter { name: "parent"; type: "QModelIndex" } | |
203 | } |
|
203 | } | |
204 | Method { name: "hasChildren"; type: "bool" } |
|
204 | Method { name: "hasChildren"; type: "bool" } | |
205 | Method { |
|
205 | Method { | |
206 | name: "data" |
|
206 | name: "data" | |
207 | type: "QVariant" |
|
207 | type: "QVariant" | |
208 | Parameter { name: "index"; type: "QModelIndex" } |
|
208 | Parameter { name: "index"; type: "QModelIndex" } | |
209 | Parameter { name: "role"; type: "int" } |
|
209 | Parameter { name: "role"; type: "int" } | |
210 | } |
|
210 | } | |
211 | Method { |
|
211 | Method { | |
212 | name: "data" |
|
212 | name: "data" | |
213 | type: "QVariant" |
|
213 | type: "QVariant" | |
214 | Parameter { name: "index"; type: "QModelIndex" } |
|
214 | Parameter { name: "index"; type: "QModelIndex" } | |
215 | } |
|
215 | } | |
216 | Method { |
|
216 | Method { | |
217 | name: "setData" |
|
217 | name: "setData" | |
218 | type: "bool" |
|
218 | type: "bool" | |
219 | Parameter { name: "index"; type: "QModelIndex" } |
|
219 | Parameter { name: "index"; type: "QModelIndex" } | |
220 | Parameter { name: "value"; type: "QVariant" } |
|
220 | Parameter { name: "value"; type: "QVariant" } | |
221 | Parameter { name: "role"; type: "int" } |
|
221 | Parameter { name: "role"; type: "int" } | |
222 | } |
|
222 | } | |
223 | Method { |
|
223 | Method { | |
224 | name: "setData" |
|
224 | name: "setData" | |
225 | type: "bool" |
|
225 | type: "bool" | |
226 | Parameter { name: "index"; type: "QModelIndex" } |
|
226 | Parameter { name: "index"; type: "QModelIndex" } | |
227 | Parameter { name: "value"; type: "QVariant" } |
|
227 | Parameter { name: "value"; type: "QVariant" } | |
228 | } |
|
228 | } | |
229 | Method { |
|
229 | Method { | |
230 | name: "headerData" |
|
230 | name: "headerData" | |
231 | type: "QVariant" |
|
231 | type: "QVariant" | |
232 | Parameter { name: "section"; type: "int" } |
|
232 | Parameter { name: "section"; type: "int" } | |
233 | Parameter { name: "orientation"; type: "Qt::Orientation" } |
|
233 | Parameter { name: "orientation"; type: "Qt::Orientation" } | |
234 | Parameter { name: "role"; type: "int" } |
|
234 | Parameter { name: "role"; type: "int" } | |
235 | } |
|
235 | } | |
236 | Method { |
|
236 | Method { | |
237 | name: "headerData" |
|
237 | name: "headerData" | |
238 | type: "QVariant" |
|
238 | type: "QVariant" | |
239 | Parameter { name: "section"; type: "int" } |
|
239 | Parameter { name: "section"; type: "int" } | |
240 | Parameter { name: "orientation"; type: "Qt::Orientation" } |
|
240 | Parameter { name: "orientation"; type: "Qt::Orientation" } | |
241 | } |
|
241 | } | |
242 | Method { |
|
242 | Method { | |
243 | name: "fetchMore" |
|
243 | name: "fetchMore" | |
244 | Parameter { name: "parent"; type: "QModelIndex" } |
|
244 | Parameter { name: "parent"; type: "QModelIndex" } | |
245 | } |
|
245 | } | |
246 | Method { |
|
246 | Method { | |
247 | name: "canFetchMore" |
|
247 | name: "canFetchMore" | |
248 | type: "bool" |
|
248 | type: "bool" | |
249 | Parameter { name: "parent"; type: "QModelIndex" } |
|
249 | Parameter { name: "parent"; type: "QModelIndex" } | |
250 | } |
|
250 | } | |
251 | Method { |
|
251 | Method { | |
252 | name: "flags" |
|
252 | name: "flags" | |
253 | type: "Qt::ItemFlags" |
|
253 | type: "Qt::ItemFlags" | |
254 | Parameter { name: "index"; type: "QModelIndex" } |
|
254 | Parameter { name: "index"; type: "QModelIndex" } | |
255 | } |
|
255 | } | |
256 | Method { |
|
256 | Method { | |
257 | name: "match" |
|
257 | name: "match" | |
258 | type: "QModelIndexList" |
|
258 | type: "QModelIndexList" | |
259 | Parameter { name: "start"; type: "QModelIndex" } |
|
259 | Parameter { name: "start"; type: "QModelIndex" } | |
260 | Parameter { name: "role"; type: "int" } |
|
260 | Parameter { name: "role"; type: "int" } | |
261 | Parameter { name: "value"; type: "QVariant" } |
|
261 | Parameter { name: "value"; type: "QVariant" } | |
262 | Parameter { name: "hits"; type: "int" } |
|
262 | Parameter { name: "hits"; type: "int" } | |
263 | Parameter { name: "flags"; type: "Qt::MatchFlags" } |
|
263 | Parameter { name: "flags"; type: "Qt::MatchFlags" } | |
264 | } |
|
264 | } | |
265 | Method { |
|
265 | Method { | |
266 | name: "match" |
|
266 | name: "match" | |
267 | type: "QModelIndexList" |
|
267 | type: "QModelIndexList" | |
268 | Parameter { name: "start"; type: "QModelIndex" } |
|
268 | Parameter { name: "start"; type: "QModelIndex" } | |
269 | Parameter { name: "role"; type: "int" } |
|
269 | Parameter { name: "role"; type: "int" } | |
270 | Parameter { name: "value"; type: "QVariant" } |
|
270 | Parameter { name: "value"; type: "QVariant" } | |
271 | Parameter { name: "hits"; type: "int" } |
|
271 | Parameter { name: "hits"; type: "int" } | |
272 | } |
|
272 | } | |
273 | Method { |
|
273 | Method { | |
274 | name: "match" |
|
274 | name: "match" | |
275 | type: "QModelIndexList" |
|
275 | type: "QModelIndexList" | |
276 | Parameter { name: "start"; type: "QModelIndex" } |
|
276 | Parameter { name: "start"; type: "QModelIndex" } | |
277 | Parameter { name: "role"; type: "int" } |
|
277 | Parameter { name: "role"; type: "int" } | |
278 | Parameter { name: "value"; type: "QVariant" } |
|
278 | Parameter { name: "value"; type: "QVariant" } | |
279 | } |
|
279 | } | |
280 | } |
|
280 | } | |
281 | Component { |
|
281 | Component { | |
282 | name: "QGraphicsObject" |
|
282 | name: "QGraphicsObject" | |
283 | defaultProperty: "children" |
|
283 | defaultProperty: "children" | |
284 | prototype: "QObject" |
|
284 | prototype: "QObject" | |
285 | Property { name: "parent"; type: "QGraphicsObject"; isPointer: true } |
|
285 | Property { name: "parent"; type: "QGraphicsObject"; isPointer: true } | |
286 | Property { name: "opacity"; type: "double" } |
|
286 | Property { name: "opacity"; type: "double" } | |
287 | Property { name: "enabled"; type: "bool" } |
|
287 | Property { name: "enabled"; type: "bool" } | |
288 | Property { name: "visible"; type: "bool" } |
|
288 | Property { name: "visible"; type: "bool" } | |
289 | Property { name: "pos"; type: "QPointF" } |
|
289 | Property { name: "pos"; type: "QPointF" } | |
290 | Property { name: "x"; type: "double" } |
|
290 | Property { name: "x"; type: "double" } | |
291 | Property { name: "y"; type: "double" } |
|
291 | Property { name: "y"; type: "double" } | |
292 | Property { name: "z"; type: "double" } |
|
292 | Property { name: "z"; type: "double" } | |
293 | Property { name: "rotation"; type: "double" } |
|
293 | Property { name: "rotation"; type: "double" } | |
294 | Property { name: "scale"; type: "double" } |
|
294 | Property { name: "scale"; type: "double" } | |
295 | Property { name: "transformOriginPoint"; type: "QPointF" } |
|
295 | Property { name: "transformOriginPoint"; type: "QPointF" } | |
296 | Property { name: "effect"; type: "QGraphicsEffect"; isPointer: true } |
|
296 | Property { name: "effect"; type: "QGraphicsEffect"; isPointer: true } | |
297 | Property { |
|
297 | Property { | |
298 | name: "children" |
|
298 | name: "children" | |
299 | type: "QDeclarativeListProperty<QGraphicsObject>" |
|
299 | type: "QDeclarativeListProperty<QGraphicsObject>" | |
300 | isReadonly: true |
|
300 | isReadonly: true | |
301 | } |
|
301 | } | |
302 | Property { name: "width"; type: "double" } |
|
302 | Property { name: "width"; type: "double" } | |
303 | Property { name: "height"; type: "double" } |
|
303 | Property { name: "height"; type: "double" } | |
304 | } |
|
304 | } | |
305 | Component { |
|
305 | Component { | |
306 | name: "QGraphicsWidget" |
|
306 | name: "QGraphicsWidget" | |
307 | defaultProperty: "children" |
|
307 | defaultProperty: "children" | |
308 | prototype: "QGraphicsObject" |
|
308 | prototype: "QGraphicsObject" | |
309 | Property { name: "palette"; type: "QPalette" } |
|
309 | Property { name: "palette"; type: "QPalette" } | |
310 | Property { name: "font"; type: "QFont" } |
|
310 | Property { name: "font"; type: "QFont" } | |
311 | Property { name: "layoutDirection"; type: "Qt::LayoutDirection" } |
|
311 | Property { name: "layoutDirection"; type: "Qt::LayoutDirection" } | |
312 | Property { name: "size"; type: "QSizeF" } |
|
312 | Property { name: "size"; type: "QSizeF" } | |
313 | Property { name: "minimumSize"; type: "QSizeF" } |
|
313 | Property { name: "minimumSize"; type: "QSizeF" } | |
314 | Property { name: "preferredSize"; type: "QSizeF" } |
|
314 | Property { name: "preferredSize"; type: "QSizeF" } | |
315 | Property { name: "maximumSize"; type: "QSizeF" } |
|
315 | Property { name: "maximumSize"; type: "QSizeF" } | |
316 | Property { name: "sizePolicy"; type: "QSizePolicy" } |
|
316 | Property { name: "sizePolicy"; type: "QSizePolicy" } | |
317 | Property { name: "focusPolicy"; type: "Qt::FocusPolicy" } |
|
317 | Property { name: "focusPolicy"; type: "Qt::FocusPolicy" } | |
318 | Property { name: "windowFlags"; type: "Qt::WindowFlags" } |
|
318 | Property { name: "windowFlags"; type: "Qt::WindowFlags" } | |
319 | Property { name: "windowTitle"; type: "string" } |
|
319 | Property { name: "windowTitle"; type: "string" } | |
320 | Property { name: "geometry"; type: "QRectF" } |
|
320 | Property { name: "geometry"; type: "QRectF" } | |
321 | Property { name: "autoFillBackground"; type: "bool" } |
|
321 | Property { name: "autoFillBackground"; type: "bool" } | |
322 | Property { name: "layout"; type: "QGraphicsLayout"; isPointer: true } |
|
322 | Property { name: "layout"; type: "QGraphicsLayout"; isPointer: true } | |
323 | Method { name: "close"; type: "bool" } |
|
323 | Method { name: "close"; type: "bool" } | |
324 | } |
|
324 | } | |
325 | Component { |
|
325 | Component { | |
326 | name: "QQuickItem" |
|
326 | name: "QQuickItem" | |
327 | defaultProperty: "data" |
|
327 | defaultProperty: "data" | |
328 | prototype: "QObject" |
|
328 | prototype: "QObject" | |
329 | Enum { |
|
329 | Enum { | |
330 | name: "TransformOrigin" |
|
330 | name: "TransformOrigin" | |
331 | values: { |
|
331 | values: { | |
332 | "TopLeft": 0, |
|
332 | "TopLeft": 0, | |
333 | "Top": 1, |
|
333 | "Top": 1, | |
334 | "TopRight": 2, |
|
334 | "TopRight": 2, | |
335 | "Left": 3, |
|
335 | "Left": 3, | |
336 | "Center": 4, |
|
336 | "Center": 4, | |
337 | "Right": 5, |
|
337 | "Right": 5, | |
338 | "BottomLeft": 6, |
|
338 | "BottomLeft": 6, | |
339 | "Bottom": 7, |
|
339 | "Bottom": 7, | |
340 | "BottomRight": 8 |
|
340 | "BottomRight": 8 | |
341 | } |
|
341 | } | |
342 | } |
|
342 | } | |
343 | Property { name: "parent"; type: "QQuickItem"; isPointer: true } |
|
343 | Property { name: "parent"; type: "QQuickItem"; isPointer: true } | |
344 | Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } |
|
344 | Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } | |
345 | Property { name: "resources"; type: "QObject"; isList: true; isReadonly: true } |
|
345 | Property { name: "resources"; type: "QObject"; isList: true; isReadonly: true } | |
346 | Property { name: "children"; type: "QQuickItem"; isList: true; isReadonly: true } |
|
346 | Property { name: "children"; type: "QQuickItem"; isList: true; isReadonly: true } | |
347 | Property { name: "x"; type: "double" } |
|
347 | Property { name: "x"; type: "double" } | |
348 | Property { name: "y"; type: "double" } |
|
348 | Property { name: "y"; type: "double" } | |
349 | Property { name: "z"; type: "double" } |
|
349 | Property { name: "z"; type: "double" } | |
350 | Property { name: "width"; type: "double" } |
|
350 | Property { name: "width"; type: "double" } | |
351 | Property { name: "height"; type: "double" } |
|
351 | Property { name: "height"; type: "double" } | |
352 | Property { name: "opacity"; type: "double" } |
|
352 | Property { name: "opacity"; type: "double" } | |
353 | Property { name: "enabled"; type: "bool" } |
|
353 | Property { name: "enabled"; type: "bool" } | |
354 | Property { name: "visible"; type: "bool" } |
|
354 | Property { name: "visible"; type: "bool" } | |
355 | Property { name: "visibleChildren"; type: "QQuickItem"; isList: true; isReadonly: true } |
|
355 | Property { name: "visibleChildren"; type: "QQuickItem"; isList: true; isReadonly: true } | |
356 | Property { name: "states"; type: "QQuickState"; isList: true; isReadonly: true } |
|
356 | Property { name: "states"; type: "QQuickState"; isList: true; isReadonly: true } | |
357 | Property { name: "transitions"; type: "QQuickTransition"; isList: true; isReadonly: true } |
|
357 | Property { name: "transitions"; type: "QQuickTransition"; isList: true; isReadonly: true } | |
358 | Property { name: "state"; type: "string" } |
|
358 | Property { name: "state"; type: "string" } | |
359 | Property { name: "childrenRect"; type: "QRectF"; isReadonly: true } |
|
359 | Property { name: "childrenRect"; type: "QRectF"; isReadonly: true } | |
360 | Property { name: "anchors"; type: "QQuickAnchors"; isReadonly: true; isPointer: true } |
|
360 | Property { name: "anchors"; type: "QQuickAnchors"; isReadonly: true; isPointer: true } | |
361 | Property { name: "left"; type: "QQuickAnchorLine"; isReadonly: true } |
|
361 | Property { name: "left"; type: "QQuickAnchorLine"; isReadonly: true } | |
362 | Property { name: "right"; type: "QQuickAnchorLine"; isReadonly: true } |
|
362 | Property { name: "right"; type: "QQuickAnchorLine"; isReadonly: true } | |
363 | Property { name: "horizontalCenter"; type: "QQuickAnchorLine"; isReadonly: true } |
|
363 | Property { name: "horizontalCenter"; type: "QQuickAnchorLine"; isReadonly: true } | |
364 | Property { name: "top"; type: "QQuickAnchorLine"; isReadonly: true } |
|
364 | Property { name: "top"; type: "QQuickAnchorLine"; isReadonly: true } | |
365 | Property { name: "bottom"; type: "QQuickAnchorLine"; isReadonly: true } |
|
365 | Property { name: "bottom"; type: "QQuickAnchorLine"; isReadonly: true } | |
366 | Property { name: "verticalCenter"; type: "QQuickAnchorLine"; isReadonly: true } |
|
366 | Property { name: "verticalCenter"; type: "QQuickAnchorLine"; isReadonly: true } | |
367 | Property { name: "baseline"; type: "QQuickAnchorLine"; isReadonly: true } |
|
367 | Property { name: "baseline"; type: "QQuickAnchorLine"; isReadonly: true } | |
368 | Property { name: "baselineOffset"; type: "double" } |
|
368 | Property { name: "baselineOffset"; type: "double" } | |
369 | Property { name: "clip"; type: "bool" } |
|
369 | Property { name: "clip"; type: "bool" } | |
370 | Property { name: "focus"; type: "bool" } |
|
370 | Property { name: "focus"; type: "bool" } | |
371 | Property { name: "activeFocus"; type: "bool"; isReadonly: true } |
|
371 | Property { name: "activeFocus"; type: "bool"; isReadonly: true } | |
372 | Property { name: "activeFocusOnTab"; revision: 1; type: "bool" } |
|
372 | Property { name: "activeFocusOnTab"; revision: 1; type: "bool" } | |
373 | Property { name: "rotation"; type: "double" } |
|
373 | Property { name: "rotation"; type: "double" } | |
374 | Property { name: "scale"; type: "double" } |
|
374 | Property { name: "scale"; type: "double" } | |
375 | Property { name: "transformOrigin"; type: "TransformOrigin" } |
|
375 | Property { name: "transformOrigin"; type: "TransformOrigin" } | |
376 | Property { name: "transformOriginPoint"; type: "QPointF"; isReadonly: true } |
|
376 | Property { name: "transformOriginPoint"; type: "QPointF"; isReadonly: true } | |
377 | Property { name: "transform"; type: "QQuickTransform"; isList: true; isReadonly: true } |
|
377 | Property { name: "transform"; type: "QQuickTransform"; isList: true; isReadonly: true } | |
378 | Property { name: "smooth"; type: "bool" } |
|
378 | Property { name: "smooth"; type: "bool" } | |
379 | Property { name: "antialiasing"; type: "bool" } |
|
379 | Property { name: "antialiasing"; type: "bool" } | |
380 | Property { name: "implicitWidth"; type: "double" } |
|
380 | Property { name: "implicitWidth"; type: "double" } | |
381 | Property { name: "implicitHeight"; type: "double" } |
|
381 | Property { name: "implicitHeight"; type: "double" } | |
382 | Property { name: "layer"; type: "QQuickItemLayer"; isReadonly: true; isPointer: true } |
|
382 | Property { name: "layer"; type: "QQuickItemLayer"; isReadonly: true; isPointer: true } | |
383 | Signal { |
|
383 | Signal { | |
384 | name: "childrenRectChanged" |
|
384 | name: "childrenRectChanged" | |
385 | Parameter { type: "QRectF" } |
|
385 | Parameter { type: "QRectF" } | |
386 | } |
|
386 | } | |
387 | Signal { |
|
387 | Signal { | |
388 | name: "baselineOffsetChanged" |
|
388 | name: "baselineOffsetChanged" | |
389 | Parameter { type: "double" } |
|
389 | Parameter { type: "double" } | |
390 | } |
|
390 | } | |
391 | Signal { |
|
391 | Signal { | |
392 | name: "stateChanged" |
|
392 | name: "stateChanged" | |
393 | Parameter { type: "string" } |
|
393 | Parameter { type: "string" } | |
394 | } |
|
394 | } | |
395 | Signal { |
|
395 | Signal { | |
396 | name: "focusChanged" |
|
396 | name: "focusChanged" | |
397 | Parameter { type: "bool" } |
|
397 | Parameter { type: "bool" } | |
398 | } |
|
398 | } | |
399 | Signal { |
|
399 | Signal { | |
400 | name: "activeFocusChanged" |
|
400 | name: "activeFocusChanged" | |
401 | Parameter { type: "bool" } |
|
401 | Parameter { type: "bool" } | |
402 | } |
|
402 | } | |
403 | Signal { |
|
403 | Signal { | |
404 | name: "activeFocusOnTabChanged" |
|
404 | name: "activeFocusOnTabChanged" | |
405 | revision: 1 |
|
405 | revision: 1 | |
406 | Parameter { type: "bool" } |
|
406 | Parameter { type: "bool" } | |
407 | } |
|
407 | } | |
408 | Signal { |
|
408 | Signal { | |
409 | name: "parentChanged" |
|
409 | name: "parentChanged" | |
410 | Parameter { type: "QQuickItem"; isPointer: true } |
|
410 | Parameter { type: "QQuickItem"; isPointer: true } | |
411 | } |
|
411 | } | |
412 | Signal { |
|
412 | Signal { | |
413 | name: "transformOriginChanged" |
|
413 | name: "transformOriginChanged" | |
414 | Parameter { type: "TransformOrigin" } |
|
414 | Parameter { type: "TransformOrigin" } | |
415 | } |
|
415 | } | |
416 | Signal { |
|
416 | Signal { | |
417 | name: "smoothChanged" |
|
417 | name: "smoothChanged" | |
418 | Parameter { type: "bool" } |
|
418 | Parameter { type: "bool" } | |
419 | } |
|
419 | } | |
420 | Signal { |
|
420 | Signal { | |
421 | name: "antialiasingChanged" |
|
421 | name: "antialiasingChanged" | |
422 | Parameter { type: "bool" } |
|
422 | Parameter { type: "bool" } | |
423 | } |
|
423 | } | |
424 | Signal { |
|
424 | Signal { | |
425 | name: "clipChanged" |
|
425 | name: "clipChanged" | |
426 | Parameter { type: "bool" } |
|
426 | Parameter { type: "bool" } | |
427 | } |
|
427 | } | |
428 | Signal { |
|
428 | Signal { | |
429 | name: "windowChanged" |
|
429 | name: "windowChanged" | |
430 | revision: 1 |
|
430 | revision: 1 | |
431 | Parameter { name: "window"; type: "QQuickWindow"; isPointer: true } |
|
431 | Parameter { name: "window"; type: "QQuickWindow"; isPointer: true } | |
432 | } |
|
432 | } | |
433 | Method { name: "update" } |
|
433 | Method { name: "update" } | |
434 | Method { |
|
434 | Method { | |
435 | name: "grabToImage" |
|
435 | name: "grabToImage" | |
436 | revision: 2 |
|
436 | revision: 2 | |
437 | type: "bool" |
|
437 | type: "bool" | |
438 | Parameter { name: "callback"; type: "QJSValue" } |
|
438 | Parameter { name: "callback"; type: "QJSValue" } | |
439 | Parameter { name: "targetSize"; type: "QSize" } |
|
439 | Parameter { name: "targetSize"; type: "QSize" } | |
440 | } |
|
440 | } | |
441 | Method { |
|
441 | Method { | |
442 | name: "grabToImage" |
|
442 | name: "grabToImage" | |
443 | revision: 2 |
|
443 | revision: 2 | |
444 | type: "bool" |
|
444 | type: "bool" | |
445 | Parameter { name: "callback"; type: "QJSValue" } |
|
445 | Parameter { name: "callback"; type: "QJSValue" } | |
446 | } |
|
446 | } | |
447 | Method { |
|
447 | Method { | |
448 | name: "contains" |
|
448 | name: "contains" | |
449 | type: "bool" |
|
449 | type: "bool" | |
450 | Parameter { name: "point"; type: "QPointF" } |
|
450 | Parameter { name: "point"; type: "QPointF" } | |
451 | } |
|
451 | } | |
452 | Method { |
|
452 | Method { | |
453 | name: "mapFromItem" |
|
453 | name: "mapFromItem" | |
454 | Parameter { type: "QQmlV4Function"; isPointer: true } |
|
454 | Parameter { type: "QQmlV4Function"; isPointer: true } | |
455 | } |
|
455 | } | |
456 | Method { |
|
456 | Method { | |
457 | name: "mapToItem" |
|
457 | name: "mapToItem" | |
458 | Parameter { type: "QQmlV4Function"; isPointer: true } |
|
458 | Parameter { type: "QQmlV4Function"; isPointer: true } | |
459 | } |
|
459 | } | |
460 | Method { name: "forceActiveFocus" } |
|
460 | Method { name: "forceActiveFocus" } | |
461 | Method { |
|
461 | Method { | |
462 | name: "forceActiveFocus" |
|
462 | name: "forceActiveFocus" | |
463 | Parameter { name: "reason"; type: "Qt::FocusReason" } |
|
463 | Parameter { name: "reason"; type: "Qt::FocusReason" } | |
464 | } |
|
464 | } | |
465 | Method { |
|
465 | Method { | |
466 | name: "nextItemInFocusChain" |
|
466 | name: "nextItemInFocusChain" | |
467 | revision: 1 |
|
467 | revision: 1 | |
468 | type: "QQuickItem*" |
|
468 | type: "QQuickItem*" | |
469 | Parameter { name: "forward"; type: "bool" } |
|
469 | Parameter { name: "forward"; type: "bool" } | |
470 | } |
|
470 | } | |
471 | Method { name: "nextItemInFocusChain"; revision: 1; type: "QQuickItem*" } |
|
471 | Method { name: "nextItemInFocusChain"; revision: 1; type: "QQuickItem*" } | |
472 | Method { |
|
472 | Method { | |
473 | name: "childAt" |
|
473 | name: "childAt" | |
474 | type: "QQuickItem*" |
|
474 | type: "QQuickItem*" | |
475 | Parameter { name: "x"; type: "double" } |
|
475 | Parameter { name: "x"; type: "double" } | |
476 | Parameter { name: "y"; type: "double" } |
|
476 | Parameter { name: "y"; type: "double" } | |
477 | } |
|
477 | } | |
478 | } |
|
478 | } | |
479 | Component { |
|
479 | Component { | |
480 | name: "QQuickPaintedItem" |
|
480 | name: "QQuickPaintedItem" | |
481 | defaultProperty: "data" |
|
481 | defaultProperty: "data" | |
482 | prototype: "QQuickItem" |
|
482 | prototype: "QQuickItem" | |
483 | Enum { |
|
483 | Enum { | |
484 | name: "RenderTarget" |
|
484 | name: "RenderTarget" | |
485 | values: { |
|
485 | values: { | |
486 | "Image": 0, |
|
486 | "Image": 0, | |
487 | "FramebufferObject": 1, |
|
487 | "FramebufferObject": 1, | |
488 | "InvertedYFramebufferObject": 2 |
|
488 | "InvertedYFramebufferObject": 2 | |
489 | } |
|
489 | } | |
490 | } |
|
490 | } | |
491 | Property { name: "contentsSize"; type: "QSize" } |
|
491 | Property { name: "contentsSize"; type: "QSize" } | |
492 | Property { name: "fillColor"; type: "QColor" } |
|
492 | Property { name: "fillColor"; type: "QColor" } | |
493 | Property { name: "contentsScale"; type: "double" } |
|
493 | Property { name: "contentsScale"; type: "double" } | |
494 | Property { name: "renderTarget"; type: "RenderTarget" } |
|
494 | Property { name: "renderTarget"; type: "RenderTarget" } | |
495 | } |
|
495 | } | |
496 | Component { |
|
496 | Component { | |
497 | name: "QtCharts::DeclarativeAreaSeries" |
|
497 | name: "QtCharts::DeclarativeAreaSeries" | |
498 | prototype: "QtCharts::QAreaSeries" |
|
498 | prototype: "QtCharts::QAreaSeries" | |
499 | exports: [ |
|
499 | exports: [ | |
500 | "QtCharts/AreaSeries 1.0", |
|
500 | "QtCharts/AreaSeries 1.0", | |
501 | "QtCharts/AreaSeries 1.1", |
|
501 | "QtCharts/AreaSeries 1.1", | |
502 | "QtCharts/AreaSeries 1.2", |
|
502 | "QtCharts/AreaSeries 1.2", | |
503 | "QtCharts/AreaSeries 1.3", |
|
503 | "QtCharts/AreaSeries 1.3", | |
504 | "QtCharts/AreaSeries 1.4", |
|
504 | "QtCharts/AreaSeries 1.4", | |
505 | "QtCharts/AreaSeries 2.0" |
|
505 | "QtCharts/AreaSeries 2.0" | |
506 | ] |
|
506 | ] | |
507 | exportMetaObjectRevisions: [0, 1, 2, 3, 4, 4] |
|
507 | exportMetaObjectRevisions: [0, 1, 2, 3, 4, 4] | |
508 | Property { name: "upperSeries"; type: "DeclarativeLineSeries"; isPointer: true } |
|
508 | Property { name: "upperSeries"; type: "DeclarativeLineSeries"; isPointer: true } | |
509 | Property { name: "lowerSeries"; type: "DeclarativeLineSeries"; isPointer: true } |
|
509 | Property { name: "lowerSeries"; type: "DeclarativeLineSeries"; isPointer: true } | |
510 | Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true } |
|
510 | Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true } | |
511 | Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true } |
|
511 | Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true } | |
512 | Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true } |
|
512 | Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true } | |
513 | Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true } |
|
513 | Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true } | |
514 | Property { name: "axisAngular"; revision: 3; type: "QAbstractAxis"; isPointer: true } |
|
514 | Property { name: "axisAngular"; revision: 3; type: "QAbstractAxis"; isPointer: true } | |
515 | Property { name: "axisRadial"; revision: 3; type: "QAbstractAxis"; isPointer: true } |
|
515 | Property { name: "axisRadial"; revision: 3; type: "QAbstractAxis"; isPointer: true } | |
516 | Property { name: "borderWidth"; revision: 1; type: "double" } |
|
516 | Property { name: "borderWidth"; revision: 1; type: "double" } | |
517 | Property { name: "brushFilename"; revision: 4; type: "string" } |
|
517 | Property { name: "brushFilename"; revision: 4; type: "string" } | |
518 | Property { name: "brush"; revision: 4; type: "QBrush" } |
|
518 | Property { name: "brush"; revision: 4; type: "QBrush" } | |
519 | Signal { |
|
519 | Signal { | |
520 | name: "axisXChanged" |
|
520 | name: "axisXChanged" | |
521 | revision: 1 |
|
521 | revision: 1 | |
522 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
522 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
523 | } |
|
523 | } | |
524 | Signal { |
|
524 | Signal { | |
525 | name: "axisYChanged" |
|
525 | name: "axisYChanged" | |
526 | revision: 1 |
|
526 | revision: 1 | |
527 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
527 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
528 | } |
|
528 | } | |
529 | Signal { |
|
529 | Signal { | |
530 | name: "borderWidthChanged" |
|
530 | name: "borderWidthChanged" | |
531 | revision: 1 |
|
531 | revision: 1 | |
532 | Parameter { name: "width"; type: "double" } |
|
532 | Parameter { name: "width"; type: "double" } | |
533 | } |
|
533 | } | |
534 | Signal { |
|
534 | Signal { | |
535 | name: "axisXTopChanged" |
|
535 | name: "axisXTopChanged" | |
536 | revision: 2 |
|
536 | revision: 2 | |
537 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
537 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
538 | } |
|
538 | } | |
539 | Signal { |
|
539 | Signal { | |
540 | name: "axisYRightChanged" |
|
540 | name: "axisYRightChanged" | |
541 | revision: 2 |
|
541 | revision: 2 | |
542 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
542 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
543 | } |
|
543 | } | |
544 | Signal { |
|
544 | Signal { | |
545 | name: "axisAngularChanged" |
|
545 | name: "axisAngularChanged" | |
546 | revision: 3 |
|
546 | revision: 3 | |
547 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
547 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
548 | } |
|
548 | } | |
549 | Signal { |
|
549 | Signal { | |
550 | name: "axisRadialChanged" |
|
550 | name: "axisRadialChanged" | |
551 | revision: 3 |
|
551 | revision: 3 | |
552 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
552 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
553 | } |
|
553 | } | |
554 | Signal { name: "brushChanged"; revision: 4 } |
|
554 | Signal { name: "brushChanged"; revision: 4 } | |
555 | Signal { |
|
555 | Signal { | |
556 | name: "brushFilenameChanged" |
|
556 | name: "brushFilenameChanged" | |
557 | revision: 4 |
|
557 | revision: 4 | |
558 | Parameter { name: "brushFilename"; type: "string" } |
|
558 | Parameter { name: "brushFilename"; type: "string" } | |
559 | } |
|
559 | } | |
560 | } |
|
560 | } | |
561 | Component { |
|
561 | Component { | |
562 | name: "QtCharts::DeclarativeAxes" |
|
562 | name: "QtCharts::DeclarativeAxes" | |
563 | prototype: "QObject" |
|
563 | prototype: "QObject" | |
564 | exports: [ |
|
564 | exports: [ | |
565 | "QtCharts/DeclarativeAxes 1.0", |
|
565 | "QtCharts/DeclarativeAxes 1.0", | |
566 | "QtCharts/DeclarativeAxes 2.0" |
|
566 | "QtCharts/DeclarativeAxes 2.0" | |
567 | ] |
|
567 | ] | |
568 | isCreatable: false |
|
568 | isCreatable: false | |
569 | exportMetaObjectRevisions: [0, 0] |
|
569 | exportMetaObjectRevisions: [0, 0] | |
570 | Property { name: "axisX"; type: "QAbstractAxis"; isPointer: true } |
|
570 | Property { name: "axisX"; type: "QAbstractAxis"; isPointer: true } | |
571 | Property { name: "axisY"; type: "QAbstractAxis"; isPointer: true } |
|
571 | Property { name: "axisY"; type: "QAbstractAxis"; isPointer: true } | |
572 | Property { name: "axisXTop"; type: "QAbstractAxis"; isPointer: true } |
|
572 | Property { name: "axisXTop"; type: "QAbstractAxis"; isPointer: true } | |
573 | Property { name: "axisYRight"; type: "QAbstractAxis"; isPointer: true } |
|
573 | Property { name: "axisYRight"; type: "QAbstractAxis"; isPointer: true } | |
574 | Signal { |
|
574 | Signal { | |
575 | name: "axisXChanged" |
|
575 | name: "axisXChanged" | |
576 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
576 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
577 | } |
|
577 | } | |
578 | Signal { |
|
578 | Signal { | |
579 | name: "axisYChanged" |
|
579 | name: "axisYChanged" | |
580 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
580 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
581 | } |
|
581 | } | |
582 | Signal { |
|
582 | Signal { | |
583 | name: "axisXTopChanged" |
|
583 | name: "axisXTopChanged" | |
584 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
584 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
585 | } |
|
585 | } | |
586 | Signal { |
|
586 | Signal { | |
587 | name: "axisYRightChanged" |
|
587 | name: "axisYRightChanged" | |
588 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
588 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
589 | } |
|
589 | } | |
590 | } |
|
590 | } | |
591 | Component { |
|
591 | Component { | |
592 | name: "QtCharts::DeclarativeBarSeries" |
|
592 | name: "QtCharts::DeclarativeBarSeries" | |
593 | defaultProperty: "seriesChildren" |
|
593 | defaultProperty: "seriesChildren" | |
594 | prototype: "QtCharts::QBarSeries" |
|
594 | prototype: "QtCharts::QBarSeries" | |
595 | exports: [ |
|
595 | exports: [ | |
596 | "QtCharts/BarSeries 1.0", |
|
596 | "QtCharts/BarSeries 1.0", | |
597 | "QtCharts/BarSeries 1.1", |
|
597 | "QtCharts/BarSeries 1.1", | |
598 | "QtCharts/BarSeries 1.2", |
|
598 | "QtCharts/BarSeries 1.2", | |
599 | "QtCharts/BarSeries 2.0" |
|
599 | "QtCharts/BarSeries 2.0" | |
600 | ] |
|
600 | ] | |
601 | exportMetaObjectRevisions: [0, 1, 2, 2] |
|
601 | exportMetaObjectRevisions: [0, 1, 2, 2] | |
602 | Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true } |
|
602 | Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true } | |
603 | Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true } |
|
603 | Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true } | |
604 | Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true } |
|
604 | Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true } | |
605 | Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true } |
|
605 | Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true } | |
606 | Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true } |
|
606 | Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true } | |
607 | Signal { |
|
607 | Signal { | |
608 | name: "axisXChanged" |
|
608 | name: "axisXChanged" | |
609 | revision: 1 |
|
609 | revision: 1 | |
610 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
610 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
611 | } |
|
611 | } | |
612 | Signal { |
|
612 | Signal { | |
613 | name: "axisYChanged" |
|
613 | name: "axisYChanged" | |
614 | revision: 1 |
|
614 | revision: 1 | |
615 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
615 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
616 | } |
|
616 | } | |
617 | Signal { |
|
617 | Signal { | |
618 | name: "axisXTopChanged" |
|
618 | name: "axisXTopChanged" | |
619 | revision: 2 |
|
619 | revision: 2 | |
620 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
620 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
621 | } |
|
621 | } | |
622 | Signal { |
|
622 | Signal { | |
623 | name: "axisYRightChanged" |
|
623 | name: "axisYRightChanged" | |
624 | revision: 2 |
|
624 | revision: 2 | |
625 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
625 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
626 | } |
|
626 | } | |
627 | Method { |
|
627 | Method { | |
628 | name: "appendSeriesChildren" |
|
628 | name: "appendSeriesChildren" | |
629 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } |
|
629 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } | |
630 | Parameter { name: "element"; type: "QObject"; isPointer: true } |
|
630 | Parameter { name: "element"; type: "QObject"; isPointer: true } | |
631 | } |
|
631 | } | |
632 | Method { |
|
632 | Method { | |
633 | name: "at" |
|
633 | name: "at" | |
634 | type: "DeclarativeBarSet*" |
|
634 | type: "DeclarativeBarSet*" | |
635 | Parameter { name: "index"; type: "int" } |
|
635 | Parameter { name: "index"; type: "int" } | |
636 | } |
|
636 | } | |
637 | Method { |
|
637 | Method { | |
638 | name: "append" |
|
638 | name: "append" | |
639 | type: "DeclarativeBarSet*" |
|
639 | type: "DeclarativeBarSet*" | |
640 | Parameter { name: "label"; type: "string" } |
|
640 | Parameter { name: "label"; type: "string" } | |
641 | Parameter { name: "values"; type: "QVariantList" } |
|
641 | Parameter { name: "values"; type: "QVariantList" } | |
642 | } |
|
642 | } | |
643 | Method { |
|
643 | Method { | |
644 | name: "insert" |
|
644 | name: "insert" | |
645 | type: "DeclarativeBarSet*" |
|
645 | type: "DeclarativeBarSet*" | |
646 | Parameter { name: "index"; type: "int" } |
|
646 | Parameter { name: "index"; type: "int" } | |
647 | Parameter { name: "label"; type: "string" } |
|
647 | Parameter { name: "label"; type: "string" } | |
648 | Parameter { name: "values"; type: "QVariantList" } |
|
648 | Parameter { name: "values"; type: "QVariantList" } | |
649 | } |
|
649 | } | |
650 | Method { |
|
650 | Method { | |
651 | name: "remove" |
|
651 | name: "remove" | |
652 | type: "bool" |
|
652 | type: "bool" | |
653 | Parameter { name: "barset"; type: "QBarSet"; isPointer: true } |
|
653 | Parameter { name: "barset"; type: "QBarSet"; isPointer: true } | |
654 | } |
|
654 | } | |
655 | Method { name: "clear" } |
|
655 | Method { name: "clear" } | |
656 | } |
|
656 | } | |
657 | Component { |
|
657 | Component { | |
658 | name: "QtCharts::DeclarativeBarSet" |
|
658 | name: "QtCharts::DeclarativeBarSet" | |
659 | prototype: "QtCharts::QBarSet" |
|
659 | prototype: "QtCharts::QBarSet" | |
660 | exports: [ |
|
660 | exports: [ | |
661 | "QtCharts/BarSet 1.0", |
|
661 | "QtCharts/BarSet 1.0", | |
662 | "QtCharts/BarSet 1.1", |
|
662 | "QtCharts/BarSet 1.1", | |
663 | "QtCharts/BarSet 1.4", |
|
663 | "QtCharts/BarSet 1.4", | |
664 | "QtCharts/BarSet 2.0" |
|
664 | "QtCharts/BarSet 2.0" | |
665 | ] |
|
665 | ] | |
666 | exportMetaObjectRevisions: [0, 0, 2, 2] |
|
666 | exportMetaObjectRevisions: [0, 0, 2, 2] | |
667 | Property { name: "values"; type: "QVariantList" } |
|
667 | Property { name: "values"; type: "QVariantList" } | |
668 | Property { name: "borderWidth"; revision: 1; type: "double" } |
|
668 | Property { name: "borderWidth"; revision: 1; type: "double" } | |
669 | Property { name: "count"; type: "int"; isReadonly: true } |
|
669 | Property { name: "count"; type: "int"; isReadonly: true } | |
670 | Property { name: "brushFilename"; revision: 2; type: "string" } |
|
670 | Property { name: "brushFilename"; revision: 2; type: "string" } | |
671 | Signal { |
|
671 | Signal { | |
672 | name: "countChanged" |
|
672 | name: "countChanged" | |
673 | Parameter { name: "count"; type: "int" } |
|
673 | Parameter { name: "count"; type: "int" } | |
674 | } |
|
674 | } | |
675 | Signal { |
|
675 | Signal { | |
676 | name: "borderWidthChanged" |
|
676 | name: "borderWidthChanged" | |
677 | revision: 1 |
|
677 | revision: 1 | |
678 | Parameter { name: "width"; type: "double" } |
|
678 | Parameter { name: "width"; type: "double" } | |
679 | } |
|
679 | } | |
680 | Signal { |
|
680 | Signal { | |
681 | name: "brushFilenameChanged" |
|
681 | name: "brushFilenameChanged" | |
682 | revision: 2 |
|
682 | revision: 2 | |
683 | Parameter { name: "brushFilename"; type: "string" } |
|
683 | Parameter { name: "brushFilename"; type: "string" } | |
684 | } |
|
684 | } | |
685 | Method { |
|
685 | Method { | |
686 | name: "append" |
|
686 | name: "append" | |
687 | Parameter { name: "value"; type: "double" } |
|
687 | Parameter { name: "value"; type: "double" } | |
688 | } |
|
688 | } | |
689 | Method { |
|
689 | Method { | |
690 | name: "remove" |
|
690 | name: "remove" | |
691 | Parameter { name: "index"; type: "int" } |
|
691 | Parameter { name: "index"; type: "int" } | |
692 | Parameter { name: "count"; type: "int" } |
|
692 | Parameter { name: "count"; type: "int" } | |
693 | } |
|
693 | } | |
694 | Method { |
|
694 | Method { | |
695 | name: "remove" |
|
695 | name: "remove" | |
696 | Parameter { name: "index"; type: "int" } |
|
696 | Parameter { name: "index"; type: "int" } | |
697 | } |
|
697 | } | |
698 | Method { |
|
698 | Method { | |
699 | name: "replace" |
|
699 | name: "replace" | |
700 | Parameter { name: "index"; type: "int" } |
|
700 | Parameter { name: "index"; type: "int" } | |
701 | Parameter { name: "value"; type: "double" } |
|
701 | Parameter { name: "value"; type: "double" } | |
702 | } |
|
702 | } | |
703 | Method { |
|
703 | Method { | |
704 | name: "at" |
|
704 | name: "at" | |
705 | type: "double" |
|
705 | type: "double" | |
706 | Parameter { name: "index"; type: "int" } |
|
706 | Parameter { name: "index"; type: "int" } | |
707 | } |
|
707 | } | |
708 | } |
|
708 | } | |
709 | Component { |
|
709 | Component { | |
710 | name: "QtCharts::DeclarativeBoxPlotSeries" |
|
710 | name: "QtCharts::DeclarativeBoxPlotSeries" | |
711 | defaultProperty: "seriesChildren" |
|
711 | defaultProperty: "seriesChildren" | |
712 | prototype: "QtCharts::QBoxPlotSeries" |
|
712 | prototype: "QtCharts::QBoxPlotSeries" | |
713 | exports: [ |
|
713 | exports: [ | |
714 | "QtCharts/BoxPlotSeries 1.3", |
|
714 | "QtCharts/BoxPlotSeries 1.3", | |
715 | "QtCharts/BoxPlotSeries 1.4", |
|
715 | "QtCharts/BoxPlotSeries 1.4", | |
716 | "QtCharts/BoxPlotSeries 2.0" |
|
716 | "QtCharts/BoxPlotSeries 2.0" | |
717 | ] |
|
717 | ] | |
718 | exportMetaObjectRevisions: [0, 1, 1] |
|
718 | exportMetaObjectRevisions: [0, 1, 1] | |
719 | Property { name: "axisX"; type: "QAbstractAxis"; isPointer: true } |
|
719 | Property { name: "axisX"; type: "QAbstractAxis"; isPointer: true } | |
720 | Property { name: "axisY"; type: "QAbstractAxis"; isPointer: true } |
|
720 | Property { name: "axisY"; type: "QAbstractAxis"; isPointer: true } | |
721 | Property { name: "axisXTop"; type: "QAbstractAxis"; isPointer: true } |
|
721 | Property { name: "axisXTop"; type: "QAbstractAxis"; isPointer: true } | |
722 | Property { name: "axisYRight"; type: "QAbstractAxis"; isPointer: true } |
|
722 | Property { name: "axisYRight"; type: "QAbstractAxis"; isPointer: true } | |
723 | Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true } |
|
723 | Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true } | |
724 | Property { name: "brushFilename"; revision: 1; type: "string" } |
|
724 | Property { name: "brushFilename"; revision: 1; type: "string" } | |
725 | Signal { |
|
725 | Signal { | |
726 | name: "axisXChanged" |
|
726 | name: "axisXChanged" | |
727 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
727 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
728 | } |
|
728 | } | |
729 | Signal { |
|
729 | Signal { | |
730 | name: "axisYChanged" |
|
730 | name: "axisYChanged" | |
731 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
731 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
732 | } |
|
732 | } | |
733 | Signal { |
|
733 | Signal { | |
734 | name: "axisXTopChanged" |
|
734 | name: "axisXTopChanged" | |
735 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
735 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
736 | } |
|
736 | } | |
737 | Signal { |
|
737 | Signal { | |
738 | name: "axisYRightChanged" |
|
738 | name: "axisYRightChanged" | |
739 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
739 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
740 | } |
|
740 | } | |
741 | Signal { |
|
741 | Signal { | |
742 | name: "clicked" |
|
742 | name: "clicked" | |
743 | Parameter { name: "boxset"; type: "DeclarativeBoxSet"; isPointer: true } |
|
743 | Parameter { name: "boxset"; type: "DeclarativeBoxSet"; isPointer: true } | |
744 | } |
|
744 | } | |
745 | Signal { |
|
745 | Signal { | |
746 | name: "hovered" |
|
746 | name: "hovered" | |
747 | Parameter { name: "status"; type: "bool" } |
|
747 | Parameter { name: "status"; type: "bool" } | |
748 | Parameter { name: "boxset"; type: "DeclarativeBoxSet"; isPointer: true } |
|
748 | Parameter { name: "boxset"; type: "DeclarativeBoxSet"; isPointer: true } | |
749 | } |
|
749 | } | |
750 | Signal { |
|
750 | Signal { | |
751 | name: "pressed" |
|
751 | name: "pressed" | |
752 | Parameter { name: "boxset"; type: "DeclarativeBoxSet"; isPointer: true } |
|
752 | Parameter { name: "boxset"; type: "DeclarativeBoxSet"; isPointer: true } | |
753 | } |
|
753 | } | |
754 | Signal { |
|
754 | Signal { | |
755 | name: "released" |
|
755 | name: "released" | |
756 | Parameter { name: "boxset"; type: "DeclarativeBoxSet"; isPointer: true } |
|
756 | Parameter { name: "boxset"; type: "DeclarativeBoxSet"; isPointer: true } | |
757 | } |
|
757 | } | |
758 | Signal { |
|
758 | Signal { | |
759 | name: "doubleClicked" |
|
759 | name: "doubleClicked" | |
760 | Parameter { name: "boxset"; type: "DeclarativeBoxSet"; isPointer: true } |
|
760 | Parameter { name: "boxset"; type: "DeclarativeBoxSet"; isPointer: true } | |
761 | } |
|
761 | } | |
762 | Signal { |
|
762 | Signal { | |
763 | name: "brushFilenameChanged" |
|
763 | name: "brushFilenameChanged" | |
764 | revision: 1 |
|
764 | revision: 1 | |
765 | Parameter { name: "brushFilename"; type: "string" } |
|
765 | Parameter { name: "brushFilename"; type: "string" } | |
766 | } |
|
766 | } | |
767 | Method { |
|
767 | Method { | |
768 | name: "appendSeriesChildren" |
|
768 | name: "appendSeriesChildren" | |
769 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } |
|
769 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } | |
770 | Parameter { name: "element"; type: "QObject"; isPointer: true } |
|
770 | Parameter { name: "element"; type: "QObject"; isPointer: true } | |
771 | } |
|
771 | } | |
772 | Method { |
|
772 | Method { | |
773 | name: "onHovered" |
|
773 | name: "onHovered" | |
774 | Parameter { name: "status"; type: "bool" } |
|
774 | Parameter { name: "status"; type: "bool" } | |
775 | Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true } |
|
775 | Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true } | |
776 | } |
|
776 | } | |
777 | Method { |
|
777 | Method { | |
778 | name: "onClicked" |
|
778 | name: "onClicked" | |
779 | Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true } |
|
779 | Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true } | |
780 | } |
|
780 | } | |
781 | Method { |
|
781 | Method { | |
782 | name: "onPressed" |
|
782 | name: "onPressed" | |
783 | Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true } |
|
783 | Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true } | |
784 | } |
|
784 | } | |
785 | Method { |
|
785 | Method { | |
786 | name: "onReleased" |
|
786 | name: "onReleased" | |
787 | Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true } |
|
787 | Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true } | |
788 | } |
|
788 | } | |
789 | Method { |
|
789 | Method { | |
790 | name: "onDoubleClicked" |
|
790 | name: "onDoubleClicked" | |
791 | Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true } |
|
791 | Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true } | |
792 | } |
|
792 | } | |
793 | Method { |
|
793 | Method { | |
794 | name: "at" |
|
794 | name: "at" | |
795 | type: "DeclarativeBoxSet*" |
|
795 | type: "DeclarativeBoxSet*" | |
796 | Parameter { name: "index"; type: "int" } |
|
796 | Parameter { name: "index"; type: "int" } | |
797 | } |
|
797 | } | |
798 | Method { |
|
798 | Method { | |
799 | name: "append" |
|
799 | name: "append" | |
800 | type: "DeclarativeBoxSet*" |
|
800 | type: "DeclarativeBoxSet*" | |
801 | Parameter { name: "label"; type: "string" } |
|
801 | Parameter { name: "label"; type: "string" } | |
802 | Parameter { name: "values"; type: "QVariantList" } |
|
802 | Parameter { name: "values"; type: "QVariantList" } | |
803 | } |
|
803 | } | |
804 | Method { |
|
804 | Method { | |
805 | name: "append" |
|
805 | name: "append" | |
806 | Parameter { name: "box"; type: "DeclarativeBoxSet"; isPointer: true } |
|
806 | Parameter { name: "box"; type: "DeclarativeBoxSet"; isPointer: true } | |
807 | } |
|
807 | } | |
808 | Method { |
|
808 | Method { | |
809 | name: "insert" |
|
809 | name: "insert" | |
810 | type: "DeclarativeBoxSet*" |
|
810 | type: "DeclarativeBoxSet*" | |
811 | Parameter { name: "index"; type: "int" } |
|
811 | Parameter { name: "index"; type: "int" } | |
812 | Parameter { name: "label"; type: "string" } |
|
812 | Parameter { name: "label"; type: "string" } | |
813 | Parameter { name: "values"; type: "QVariantList" } |
|
813 | Parameter { name: "values"; type: "QVariantList" } | |
814 | } |
|
814 | } | |
815 | Method { |
|
815 | Method { | |
816 | name: "remove" |
|
816 | name: "remove" | |
817 | type: "bool" |
|
817 | type: "bool" | |
818 | Parameter { name: "box"; type: "DeclarativeBoxSet"; isPointer: true } |
|
818 | Parameter { name: "box"; type: "DeclarativeBoxSet"; isPointer: true } | |
819 | } |
|
819 | } | |
820 | Method { name: "clear" } |
|
820 | Method { name: "clear" } | |
821 | } |
|
821 | } | |
822 | Component { |
|
822 | Component { | |
823 | name: "QtCharts::DeclarativeBoxSet" |
|
823 | name: "QtCharts::DeclarativeBoxSet" | |
824 | prototype: "QtCharts::QBoxSet" |
|
824 | prototype: "QtCharts::QBoxSet" | |
825 | exports: [ |
|
825 | exports: [ | |
826 | "QtCharts/BoxSet 1.3", |
|
826 | "QtCharts/BoxSet 1.3", | |
827 | "QtCharts/BoxSet 1.4", |
|
827 | "QtCharts/BoxSet 1.4", | |
828 | "QtCharts/BoxSet 2.0" |
|
828 | "QtCharts/BoxSet 2.0" | |
829 | ] |
|
829 | ] | |
830 | exportMetaObjectRevisions: [0, 1, 1] |
|
830 | exportMetaObjectRevisions: [0, 1, 1] | |
831 | Enum { |
|
831 | Enum { | |
832 | name: "ValuePositions" |
|
832 | name: "ValuePositions" | |
833 | values: { |
|
833 | values: { | |
834 | "LowerExtreme": 0, |
|
834 | "LowerExtreme": 0, | |
835 | "LowerQuartile": 1, |
|
835 | "LowerQuartile": 1, | |
836 | "Median": 2, |
|
836 | "Median": 2, | |
837 | "UpperQuartile": 3, |
|
837 | "UpperQuartile": 3, | |
838 | "UpperExtreme": 4 |
|
838 | "UpperExtreme": 4 | |
839 | } |
|
839 | } | |
840 | } |
|
840 | } | |
841 | Property { name: "values"; type: "QVariantList" } |
|
841 | Property { name: "values"; type: "QVariantList" } | |
842 | Property { name: "label"; type: "string" } |
|
842 | Property { name: "label"; type: "string" } | |
843 | Property { name: "count"; type: "int"; isReadonly: true } |
|
843 | Property { name: "count"; type: "int"; isReadonly: true } | |
844 | Property { name: "brushFilename"; revision: 1; type: "string" } |
|
844 | Property { name: "brushFilename"; revision: 1; type: "string" } | |
845 | Signal { name: "changedValues" } |
|
845 | Signal { name: "changedValues" } | |
846 | Signal { |
|
846 | Signal { | |
847 | name: "changedValue" |
|
847 | name: "changedValue" | |
848 | Parameter { name: "index"; type: "int" } |
|
848 | Parameter { name: "index"; type: "int" } | |
849 | } |
|
849 | } | |
850 | Signal { |
|
850 | Signal { | |
851 | name: "brushFilenameChanged" |
|
851 | name: "brushFilenameChanged" | |
852 | revision: 1 |
|
852 | revision: 1 | |
853 | Parameter { name: "brushFilename"; type: "string" } |
|
853 | Parameter { name: "brushFilename"; type: "string" } | |
854 | } |
|
854 | } | |
855 | Method { |
|
855 | Method { | |
856 | name: "append" |
|
856 | name: "append" | |
857 | Parameter { name: "value"; type: "double" } |
|
857 | Parameter { name: "value"; type: "double" } | |
858 | } |
|
858 | } | |
859 | Method { name: "clear" } |
|
859 | Method { name: "clear" } | |
860 | Method { |
|
860 | Method { | |
861 | name: "at" |
|
861 | name: "at" | |
862 | type: "double" |
|
862 | type: "double" | |
863 | Parameter { name: "index"; type: "int" } |
|
863 | Parameter { name: "index"; type: "int" } | |
864 | } |
|
864 | } | |
865 | Method { |
|
865 | Method { | |
866 | name: "setValue" |
|
866 | name: "setValue" | |
867 | Parameter { name: "index"; type: "int" } |
|
867 | Parameter { name: "index"; type: "int" } | |
868 | Parameter { name: "value"; type: "double" } |
|
868 | Parameter { name: "value"; type: "double" } | |
869 | } |
|
869 | } | |
870 | } |
|
870 | } | |
871 | Component { |
|
871 | Component { | |
872 | name: "QtCharts::DeclarativeCategoryAxis" |
|
872 | name: "QtCharts::DeclarativeCategoryAxis" | |
873 | defaultProperty: "axisChildren" |
|
873 | defaultProperty: "axisChildren" | |
874 | prototype: "QtCharts::QCategoryAxis" |
|
874 | prototype: "QtCharts::QCategoryAxis" | |
875 | exports: [ |
|
875 | exports: [ | |
876 | "QtCharts/CategoryAxis 1.1", |
|
876 | "QtCharts/CategoryAxis 1.1", | |
877 | "QtCharts/CategoryAxis 2.0", |
|
877 | "QtCharts/CategoryAxis 2.0", | |
878 | "QtCharts/CategoryAxis 2.1" |
|
878 | "QtCharts/CategoryAxis 2.1" | |
879 | ] |
|
879 | ] | |
880 | exportMetaObjectRevisions: [0, 0, 1] |
|
880 | exportMetaObjectRevisions: [0, 0, 1] | |
881 | Enum { |
|
881 | Enum { | |
882 | name: "AxisLabelsPosition" |
|
882 | name: "AxisLabelsPosition" | |
883 | values: { |
|
883 | values: { | |
884 | "AxisLabelsPositionCenter": 0, |
|
884 | "AxisLabelsPositionCenter": 0, | |
885 | "AxisLabelsPositionOnValue": 1 |
|
885 | "AxisLabelsPositionOnValue": 1 | |
886 | } |
|
886 | } | |
887 | } |
|
887 | } | |
888 | Property { name: "axisChildren"; type: "QObject"; isList: true; isReadonly: true } |
|
888 | Property { name: "axisChildren"; type: "QObject"; isList: true; isReadonly: true } | |
889 | Property { name: "labelsPosition"; revision: 1; type: "AxisLabelsPosition" } |
|
889 | Property { name: "labelsPosition"; revision: 1; type: "AxisLabelsPosition" } | |
890 | Signal { |
|
890 | Signal { | |
891 | name: "labelsPositionChanged" |
|
891 | name: "labelsPositionChanged" | |
892 | revision: 1 |
|
892 | revision: 1 | |
893 | Parameter { name: "position"; type: "AxisLabelsPosition" } |
|
893 | Parameter { name: "position"; type: "AxisLabelsPosition" } | |
894 | } |
|
894 | } | |
895 | Method { |
|
895 | Method { | |
896 | name: "append" |
|
896 | name: "append" | |
897 | Parameter { name: "label"; type: "string" } |
|
897 | Parameter { name: "label"; type: "string" } | |
898 | Parameter { name: "categoryEndValue"; type: "double" } |
|
898 | Parameter { name: "categoryEndValue"; type: "double" } | |
899 | } |
|
899 | } | |
900 | Method { |
|
900 | Method { | |
901 | name: "remove" |
|
901 | name: "remove" | |
902 | Parameter { name: "label"; type: "string" } |
|
902 | Parameter { name: "label"; type: "string" } | |
903 | } |
|
903 | } | |
904 | Method { |
|
904 | Method { | |
905 | name: "replace" |
|
905 | name: "replace" | |
906 | Parameter { name: "oldLabel"; type: "string" } |
|
906 | Parameter { name: "oldLabel"; type: "string" } | |
907 | Parameter { name: "newLabel"; type: "string" } |
|
907 | Parameter { name: "newLabel"; type: "string" } | |
908 | } |
|
908 | } | |
909 | Method { |
|
909 | Method { | |
910 | name: "appendAxisChildren" |
|
910 | name: "appendAxisChildren" | |
911 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } |
|
911 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } | |
912 | Parameter { name: "element"; type: "QObject"; isPointer: true } |
|
912 | Parameter { name: "element"; type: "QObject"; isPointer: true } | |
913 | } |
|
913 | } | |
914 | } |
|
914 | } | |
915 | Component { |
|
915 | Component { | |
916 | name: "QtCharts::DeclarativeCategoryRange" |
|
916 | name: "QtCharts::DeclarativeCategoryRange" | |
917 | prototype: "QObject" |
|
917 | prototype: "QObject" | |
918 | exports: ["QtCharts/CategoryRange 1.1", "QtCharts/CategoryRange 2.0"] |
|
918 | exports: ["QtCharts/CategoryRange 1.1", "QtCharts/CategoryRange 2.0"] | |
919 | exportMetaObjectRevisions: [0, 0] |
|
919 | exportMetaObjectRevisions: [0, 0] | |
920 | Property { name: "endValue"; type: "double" } |
|
920 | Property { name: "endValue"; type: "double" } | |
921 | Property { name: "label"; type: "string" } |
|
921 | Property { name: "label"; type: "string" } | |
922 | } |
|
922 | } | |
923 | Component { |
|
923 | Component { | |
924 | name: "QtCharts::DeclarativeChart" |
|
924 | name: "QtCharts::DeclarativeChart" | |
925 | defaultProperty: "data" |
|
925 | defaultProperty: "data" | |
926 | prototype: "QQuickPaintedItem" |
|
926 | prototype: "QQuickPaintedItem" | |
927 | exports: [ |
|
927 | exports: [ | |
928 | "QtCharts/ChartView 1.0", |
|
928 | "QtCharts/ChartView 1.0", | |
929 | "QtCharts/ChartView 1.1", |
|
929 | "QtCharts/ChartView 1.1", | |
930 | "QtCharts/ChartView 1.2", |
|
930 | "QtCharts/ChartView 1.2", | |
931 | "QtCharts/ChartView 1.3", |
|
931 | "QtCharts/ChartView 1.3", | |
932 | "QtCharts/ChartView 2.0", |
|
932 | "QtCharts/ChartView 2.0", | |
933 | "QtCharts/ChartView 2.1" |
|
933 | "QtCharts/ChartView 2.1" | |
934 | ] |
|
934 | ] | |
935 | exportMetaObjectRevisions: [0, 1, 2, 3, 4, 5] |
|
935 | exportMetaObjectRevisions: [0, 1, 2, 3, 4, 5] | |
936 | Enum { |
|
936 | Enum { | |
937 | name: "Theme" |
|
937 | name: "Theme" | |
938 | values: { |
|
938 | values: { | |
939 | "ChartThemeLight": 0, |
|
939 | "ChartThemeLight": 0, | |
940 | "ChartThemeBlueCerulean": 1, |
|
940 | "ChartThemeBlueCerulean": 1, | |
941 | "ChartThemeDark": 2, |
|
941 | "ChartThemeDark": 2, | |
942 | "ChartThemeBrownSand": 3, |
|
942 | "ChartThemeBrownSand": 3, | |
943 | "ChartThemeBlueNcs": 4, |
|
943 | "ChartThemeBlueNcs": 4, | |
944 | "ChartThemeHighContrast": 5, |
|
944 | "ChartThemeHighContrast": 5, | |
945 | "ChartThemeBlueIcy": 6, |
|
945 | "ChartThemeBlueIcy": 6, | |
946 | "ChartThemeQt": 7 |
|
946 | "ChartThemeQt": 7 | |
947 | } |
|
947 | } | |
948 | } |
|
948 | } | |
949 | Enum { |
|
949 | Enum { | |
950 | name: "Animation" |
|
950 | name: "Animation" | |
951 | values: { |
|
951 | values: { | |
952 | "NoAnimation": 0, |
|
952 | "NoAnimation": 0, | |
953 | "GridAxisAnimations": 1, |
|
953 | "GridAxisAnimations": 1, | |
954 | "SeriesAnimations": 2, |
|
954 | "SeriesAnimations": 2, | |
955 | "AllAnimations": 3 |
|
955 | "AllAnimations": 3 | |
956 | } |
|
956 | } | |
957 | } |
|
957 | } | |
958 | Enum { |
|
958 | Enum { | |
959 | name: "SeriesType" |
|
959 | name: "SeriesType" | |
960 | values: { |
|
960 | values: { | |
961 | "SeriesTypeLine": 0, |
|
961 | "SeriesTypeLine": 0, | |
962 | "SeriesTypeArea": 1, |
|
962 | "SeriesTypeArea": 1, | |
963 | "SeriesTypeBar": 2, |
|
963 | "SeriesTypeBar": 2, | |
964 | "SeriesTypeStackedBar": 3, |
|
964 | "SeriesTypeStackedBar": 3, | |
965 | "SeriesTypePercentBar": 4, |
|
965 | "SeriesTypePercentBar": 4, | |
966 | "SeriesTypeBoxPlot": 5, |
|
966 | "SeriesTypeBoxPlot": 5, | |
967 | "SeriesTypePie": 6, |
|
967 | "SeriesTypePie": 6, | |
968 | "SeriesTypeScatter": 7, |
|
968 | "SeriesTypeScatter": 7, | |
969 | "SeriesTypeSpline": 8, |
|
969 | "SeriesTypeSpline": 8, | |
970 | "SeriesTypeHorizontalBar": 9, |
|
970 | "SeriesTypeHorizontalBar": 9, | |
971 | "SeriesTypeHorizontalStackedBar": 10, |
|
971 | "SeriesTypeHorizontalStackedBar": 10, | |
972 | "SeriesTypeHorizontalPercentBar": 11 |
|
972 | "SeriesTypeHorizontalPercentBar": 11 | |
973 | } |
|
973 | } | |
974 | } |
|
974 | } | |
975 | Property { name: "theme"; type: "Theme" } |
|
975 | Property { name: "theme"; type: "Theme" } | |
976 | Property { name: "animationOptions"; type: "Animation" } |
|
976 | Property { name: "animationOptions"; type: "Animation" } | |
977 | Property { name: "animationDuration"; revision: 5; type: "int" } |
|
977 | Property { name: "animationDuration"; revision: 5; type: "int" } | |
978 | Property { name: "animationEasingCurve"; revision: 5; type: "QEasingCurve" } |
|
978 | Property { name: "animationEasingCurve"; revision: 5; type: "QEasingCurve" } | |
979 | Property { name: "title"; type: "string" } |
|
979 | Property { name: "title"; type: "string" } | |
980 | Property { name: "titleFont"; type: "QFont" } |
|
980 | Property { name: "titleFont"; type: "QFont" } | |
981 | Property { name: "titleColor"; type: "QColor" } |
|
981 | Property { name: "titleColor"; type: "QColor" } | |
982 | Property { name: "legend"; type: "QLegend"; isReadonly: true; isPointer: true } |
|
982 | Property { name: "legend"; type: "QLegend"; isReadonly: true; isPointer: true } | |
983 | Property { name: "count"; type: "int"; isReadonly: true } |
|
983 | Property { name: "count"; type: "int"; isReadonly: true } | |
984 | Property { name: "backgroundColor"; type: "QColor" } |
|
984 | Property { name: "backgroundColor"; type: "QColor" } | |
985 | Property { name: "dropShadowEnabled"; type: "bool" } |
|
985 | Property { name: "dropShadowEnabled"; type: "bool" } | |
986 | Property { name: "backgroundRoundness"; revision: 3; type: "double" } |
|
986 | Property { name: "backgroundRoundness"; revision: 3; type: "double" } | |
987 | Property { |
|
987 | Property { | |
988 | name: "margins" |
|
988 | name: "margins" | |
989 | revision: 2 |
|
989 | revision: 2 | |
990 | type: "DeclarativeMargins" |
|
990 | type: "DeclarativeMargins" | |
991 | isReadonly: true |
|
991 | isReadonly: true | |
992 | isPointer: true |
|
992 | isPointer: true | |
993 | } |
|
993 | } | |
994 | Property { name: "plotArea"; revision: 1; type: "QRectF"; isReadonly: true } |
|
994 | Property { name: "plotArea"; revision: 1; type: "QRectF"; isReadonly: true } | |
995 | Property { name: "plotAreaColor"; revision: 3; type: "QColor" } |
|
995 | Property { name: "plotAreaColor"; revision: 3; type: "QColor" } | |
996 | Property { name: "axes"; revision: 2; type: "QAbstractAxis"; isList: true; isReadonly: true } |
|
996 | Property { name: "axes"; revision: 2; type: "QAbstractAxis"; isList: true; isReadonly: true } | |
997 | Property { name: "localizeNumbers"; revision: 4; type: "bool" } |
|
997 | Property { name: "localizeNumbers"; revision: 4; type: "bool" } | |
998 | Property { name: "locale"; revision: 4; type: "QLocale" } |
|
998 | Property { name: "locale"; revision: 4; type: "QLocale" } | |
999 | Signal { name: "axisLabelsChanged" } |
|
999 | Signal { name: "axisLabelsChanged" } | |
1000 | Signal { |
|
1000 | Signal { | |
1001 | name: "titleColorChanged" |
|
1001 | name: "titleColorChanged" | |
1002 | Parameter { name: "color"; type: "QColor" } |
|
1002 | Parameter { name: "color"; type: "QColor" } | |
1003 | } |
|
1003 | } | |
1004 | Signal { |
|
1004 | Signal { | |
1005 | name: "dropShadowEnabledChanged" |
|
1005 | name: "dropShadowEnabledChanged" | |
1006 | Parameter { name: "enabled"; type: "bool" } |
|
1006 | Parameter { name: "enabled"; type: "bool" } | |
1007 | } |
|
1007 | } | |
1008 | Signal { name: "marginsChanged"; revision: 2 } |
|
1008 | Signal { name: "marginsChanged"; revision: 2 } | |
1009 | Signal { |
|
1009 | Signal { | |
1010 | name: "plotAreaChanged" |
|
1010 | name: "plotAreaChanged" | |
1011 | Parameter { name: "plotArea"; type: "QRectF" } |
|
1011 | Parameter { name: "plotArea"; type: "QRectF" } | |
1012 | } |
|
1012 | } | |
1013 | Signal { |
|
1013 | Signal { | |
1014 | name: "seriesAdded" |
|
1014 | name: "seriesAdded" | |
1015 | Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true } |
|
1015 | Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true } | |
1016 | } |
|
1016 | } | |
1017 | Signal { |
|
1017 | Signal { | |
1018 | name: "seriesRemoved" |
|
1018 | name: "seriesRemoved" | |
1019 | Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true } |
|
1019 | Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true } | |
1020 | } |
|
1020 | } | |
1021 | Signal { name: "plotAreaColorChanged"; revision: 3 } |
|
1021 | Signal { name: "plotAreaColorChanged"; revision: 3 } | |
1022 | Signal { |
|
1022 | Signal { | |
1023 | name: "backgroundRoundnessChanged" |
|
1023 | name: "backgroundRoundnessChanged" | |
1024 | revision: 3 |
|
1024 | revision: 3 | |
1025 | Parameter { name: "diameter"; type: "double" } |
|
1025 | Parameter { name: "diameter"; type: "double" } | |
1026 | } |
|
1026 | } | |
1027 | Signal { name: "localizeNumbersChanged"; revision: 4 } |
|
1027 | Signal { name: "localizeNumbersChanged"; revision: 4 } | |
1028 | Signal { name: "localeChanged"; revision: 4 } |
|
1028 | Signal { name: "localeChanged"; revision: 4 } | |
1029 | Signal { |
|
1029 | Signal { | |
1030 | name: "animationDurationChanged" |
|
1030 | name: "animationDurationChanged" | |
1031 | revision: 5 |
|
1031 | revision: 5 | |
1032 | Parameter { name: "msecs"; type: "int" } |
|
1032 | Parameter { name: "msecs"; type: "int" } | |
1033 | } |
|
1033 | } | |
1034 | Signal { |
|
1034 | Signal { | |
1035 | name: "animationEasingCurveChanged" |
|
1035 | name: "animationEasingCurveChanged" | |
1036 | revision: 5 |
|
1036 | revision: 5 | |
1037 | Parameter { name: "curve"; type: "QEasingCurve" } |
|
1037 | Parameter { name: "curve"; type: "QEasingCurve" } | |
1038 | } |
|
1038 | } | |
1039 | Method { |
|
1039 | Method { | |
1040 | name: "series" |
|
1040 | name: "series" | |
1041 | type: "QAbstractSeries*" |
|
1041 | type: "QAbstractSeries*" | |
1042 | Parameter { name: "index"; type: "int" } |
|
1042 | Parameter { name: "index"; type: "int" } | |
1043 | } |
|
1043 | } | |
1044 | Method { |
|
1044 | Method { | |
1045 | name: "series" |
|
1045 | name: "series" | |
1046 | type: "QAbstractSeries*" |
|
1046 | type: "QAbstractSeries*" | |
1047 | Parameter { name: "seriesName"; type: "string" } |
|
1047 | Parameter { name: "seriesName"; type: "string" } | |
1048 | } |
|
1048 | } | |
1049 | Method { |
|
1049 | Method { | |
1050 | name: "createSeries" |
|
1050 | name: "createSeries" | |
1051 | type: "QAbstractSeries*" |
|
1051 | type: "QAbstractSeries*" | |
1052 | Parameter { name: "type"; type: "int" } |
|
1052 | Parameter { name: "type"; type: "int" } | |
1053 | Parameter { name: "name"; type: "string" } |
|
1053 | Parameter { name: "name"; type: "string" } | |
1054 | Parameter { name: "axisX"; type: "QAbstractAxis"; isPointer: true } |
|
1054 | Parameter { name: "axisX"; type: "QAbstractAxis"; isPointer: true } | |
1055 | Parameter { name: "axisY"; type: "QAbstractAxis"; isPointer: true } |
|
1055 | Parameter { name: "axisY"; type: "QAbstractAxis"; isPointer: true } | |
1056 | } |
|
1056 | } | |
1057 | Method { |
|
1057 | Method { | |
1058 | name: "createSeries" |
|
1058 | name: "createSeries" | |
1059 | type: "QAbstractSeries*" |
|
1059 | type: "QAbstractSeries*" | |
1060 | Parameter { name: "type"; type: "int" } |
|
1060 | Parameter { name: "type"; type: "int" } | |
1061 | Parameter { name: "name"; type: "string" } |
|
1061 | Parameter { name: "name"; type: "string" } | |
1062 | Parameter { name: "axisX"; type: "QAbstractAxis"; isPointer: true } |
|
1062 | Parameter { name: "axisX"; type: "QAbstractAxis"; isPointer: true } | |
1063 | } |
|
1063 | } | |
1064 | Method { |
|
1064 | Method { | |
1065 | name: "createSeries" |
|
1065 | name: "createSeries" | |
1066 | type: "QAbstractSeries*" |
|
1066 | type: "QAbstractSeries*" | |
1067 | Parameter { name: "type"; type: "int" } |
|
1067 | Parameter { name: "type"; type: "int" } | |
1068 | Parameter { name: "name"; type: "string" } |
|
1068 | Parameter { name: "name"; type: "string" } | |
1069 | } |
|
1069 | } | |
1070 | Method { |
|
1070 | Method { | |
1071 | name: "createSeries" |
|
1071 | name: "createSeries" | |
1072 | type: "QAbstractSeries*" |
|
1072 | type: "QAbstractSeries*" | |
1073 | Parameter { name: "type"; type: "int" } |
|
1073 | Parameter { name: "type"; type: "int" } | |
1074 | } |
|
1074 | } | |
1075 | Method { |
|
1075 | Method { | |
1076 | name: "removeSeries" |
|
1076 | name: "removeSeries" | |
1077 | Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true } |
|
1077 | Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true } | |
1078 | } |
|
1078 | } | |
1079 | Method { name: "removeAllSeries" } |
|
1079 | Method { name: "removeAllSeries" } | |
1080 | Method { |
|
1080 | Method { | |
1081 | name: "setAxisX" |
|
1081 | name: "setAxisX" | |
1082 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1082 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1083 | Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true } |
|
1083 | Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true } | |
1084 | } |
|
1084 | } | |
1085 | Method { |
|
1085 | Method { | |
1086 | name: "setAxisX" |
|
1086 | name: "setAxisX" | |
1087 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1087 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1088 | } |
|
1088 | } | |
1089 | Method { |
|
1089 | Method { | |
1090 | name: "setAxisY" |
|
1090 | name: "setAxisY" | |
1091 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1091 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1092 | Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true } |
|
1092 | Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true } | |
1093 | } |
|
1093 | } | |
1094 | Method { |
|
1094 | Method { | |
1095 | name: "setAxisY" |
|
1095 | name: "setAxisY" | |
1096 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1096 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1097 | } |
|
1097 | } | |
1098 | Method { |
|
1098 | Method { | |
1099 | name: "axisX" |
|
1099 | name: "axisX" | |
1100 | type: "QAbstractAxis*" |
|
1100 | type: "QAbstractAxis*" | |
1101 | Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true } |
|
1101 | Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true } | |
1102 | } |
|
1102 | } | |
1103 | Method { name: "axisX"; type: "QAbstractAxis*" } |
|
1103 | Method { name: "axisX"; type: "QAbstractAxis*" } | |
1104 | Method { |
|
1104 | Method { | |
1105 | name: "axisY" |
|
1105 | name: "axisY" | |
1106 | type: "QAbstractAxis*" |
|
1106 | type: "QAbstractAxis*" | |
1107 | Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true } |
|
1107 | Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true } | |
1108 | } |
|
1108 | } | |
1109 | Method { name: "axisY"; type: "QAbstractAxis*" } |
|
1109 | Method { name: "axisY"; type: "QAbstractAxis*" } | |
1110 | Method { |
|
1110 | Method { | |
1111 | name: "zoom" |
|
1111 | name: "zoom" | |
1112 | Parameter { name: "factor"; type: "double" } |
|
1112 | Parameter { name: "factor"; type: "double" } | |
1113 | } |
|
1113 | } | |
1114 | Method { name: "zoomIn"; revision: 5 } |
|
1114 | Method { name: "zoomIn"; revision: 5 } | |
1115 | Method { |
|
1115 | Method { | |
1116 | name: "zoomIn" |
|
1116 | name: "zoomIn" | |
1117 | revision: 5 |
|
1117 | revision: 5 | |
1118 | Parameter { name: "rectangle"; type: "QRectF" } |
|
1118 | Parameter { name: "rectangle"; type: "QRectF" } | |
1119 | } |
|
1119 | } | |
1120 | Method { name: "zoomOut"; revision: 5 } |
|
1120 | Method { name: "zoomOut"; revision: 5 } | |
1121 | Method { name: "zoomReset"; revision: 5 } |
|
1121 | Method { name: "zoomReset"; revision: 5 } | |
1122 | Method { name: "isZoomed"; revision: 5; type: "bool" } |
|
1122 | Method { name: "isZoomed"; revision: 5; type: "bool" } | |
1123 | Method { |
|
1123 | Method { | |
1124 | name: "scrollLeft" |
|
1124 | name: "scrollLeft" | |
1125 | Parameter { name: "pixels"; type: "double" } |
|
1125 | Parameter { name: "pixels"; type: "double" } | |
1126 | } |
|
1126 | } | |
1127 | Method { |
|
1127 | Method { | |
1128 | name: "scrollRight" |
|
1128 | name: "scrollRight" | |
1129 | Parameter { name: "pixels"; type: "double" } |
|
1129 | Parameter { name: "pixels"; type: "double" } | |
1130 | } |
|
1130 | } | |
1131 | Method { |
|
1131 | Method { | |
1132 | name: "scrollUp" |
|
1132 | name: "scrollUp" | |
1133 | Parameter { name: "pixels"; type: "double" } |
|
1133 | Parameter { name: "pixels"; type: "double" } | |
1134 | } |
|
1134 | } | |
1135 | Method { |
|
1135 | Method { | |
1136 | name: "scrollDown" |
|
1136 | name: "scrollDown" | |
1137 | Parameter { name: "pixels"; type: "double" } |
|
1137 | Parameter { name: "pixels"; type: "double" } | |
1138 | } |
|
1138 | } | |
1139 | Method { |
|
1139 | Method { | |
1140 | name: "mapToValue" |
|
1140 | name: "mapToValue" | |
1141 | revision: 5 |
|
1141 | revision: 5 | |
1142 | type: "QPointF" |
|
1142 | type: "QPointF" | |
1143 | Parameter { name: "position"; type: "QPointF" } |
|
1143 | Parameter { name: "position"; type: "QPointF" } | |
1144 | Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true } |
|
1144 | Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true } | |
1145 | } |
|
1145 | } | |
1146 | Method { |
|
1146 | Method { | |
1147 | name: "mapToValue" |
|
1147 | name: "mapToValue" | |
1148 | revision: 5 |
|
1148 | revision: 5 | |
1149 | type: "QPointF" |
|
1149 | type: "QPointF" | |
1150 | Parameter { name: "position"; type: "QPointF" } |
|
1150 | Parameter { name: "position"; type: "QPointF" } | |
1151 | } |
|
1151 | } | |
1152 | Method { |
|
1152 | Method { | |
1153 | name: "mapToPosition" |
|
1153 | name: "mapToPosition" | |
1154 | revision: 5 |
|
1154 | revision: 5 | |
1155 | type: "QPointF" |
|
1155 | type: "QPointF" | |
1156 | Parameter { name: "value"; type: "QPointF" } |
|
1156 | Parameter { name: "value"; type: "QPointF" } | |
1157 | Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true } |
|
1157 | Parameter { name: "series"; type: "QAbstractSeries"; isPointer: true } | |
1158 | } |
|
1158 | } | |
1159 | Method { |
|
1159 | Method { | |
1160 | name: "mapToPosition" |
|
1160 | name: "mapToPosition" | |
1161 | revision: 5 |
|
1161 | revision: 5 | |
1162 | type: "QPointF" |
|
1162 | type: "QPointF" | |
1163 | Parameter { name: "value"; type: "QPointF" } |
|
1163 | Parameter { name: "value"; type: "QPointF" } | |
1164 | } |
|
1164 | } | |
1165 | } |
|
1165 | } | |
1166 | Component { |
|
1166 | Component { | |
1167 | name: "QtCharts::DeclarativeHorizontalBarSeries" |
|
1167 | name: "QtCharts::DeclarativeHorizontalBarSeries" | |
1168 | defaultProperty: "seriesChildren" |
|
1168 | defaultProperty: "seriesChildren" | |
1169 | prototype: "QtCharts::QHorizontalBarSeries" |
|
1169 | prototype: "QtCharts::QHorizontalBarSeries" | |
1170 | exports: [ |
|
1170 | exports: [ | |
1171 | "QtCharts/HorizontalBarSeries 1.1", |
|
1171 | "QtCharts/HorizontalBarSeries 1.1", | |
1172 | "QtCharts/HorizontalBarSeries 1.2", |
|
1172 | "QtCharts/HorizontalBarSeries 1.2", | |
1173 | "QtCharts/HorizontalBarSeries 2.0" |
|
1173 | "QtCharts/HorizontalBarSeries 2.0" | |
1174 | ] |
|
1174 | ] | |
1175 | exportMetaObjectRevisions: [1, 2, 2] |
|
1175 | exportMetaObjectRevisions: [1, 2, 2] | |
1176 | Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true } |
|
1176 | Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true } | |
1177 | Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true } |
|
1177 | Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true } | |
1178 | Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true } |
|
1178 | Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true } | |
1179 | Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true } |
|
1179 | Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true } | |
1180 | Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true } |
|
1180 | Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true } | |
1181 | Signal { |
|
1181 | Signal { | |
1182 | name: "axisXChanged" |
|
1182 | name: "axisXChanged" | |
1183 | revision: 1 |
|
1183 | revision: 1 | |
1184 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1184 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1185 | } |
|
1185 | } | |
1186 | Signal { |
|
1186 | Signal { | |
1187 | name: "axisYChanged" |
|
1187 | name: "axisYChanged" | |
1188 | revision: 1 |
|
1188 | revision: 1 | |
1189 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1189 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1190 | } |
|
1190 | } | |
1191 | Signal { |
|
1191 | Signal { | |
1192 | name: "axisXTopChanged" |
|
1192 | name: "axisXTopChanged" | |
1193 | revision: 2 |
|
1193 | revision: 2 | |
1194 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1194 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1195 | } |
|
1195 | } | |
1196 | Signal { |
|
1196 | Signal { | |
1197 | name: "axisYRightChanged" |
|
1197 | name: "axisYRightChanged" | |
1198 | revision: 2 |
|
1198 | revision: 2 | |
1199 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1199 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1200 | } |
|
1200 | } | |
1201 | Method { |
|
1201 | Method { | |
1202 | name: "appendSeriesChildren" |
|
1202 | name: "appendSeriesChildren" | |
1203 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } |
|
1203 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } | |
1204 | Parameter { name: "element"; type: "QObject"; isPointer: true } |
|
1204 | Parameter { name: "element"; type: "QObject"; isPointer: true } | |
1205 | } |
|
1205 | } | |
1206 | Method { |
|
1206 | Method { | |
1207 | name: "at" |
|
1207 | name: "at" | |
1208 | type: "DeclarativeBarSet*" |
|
1208 | type: "DeclarativeBarSet*" | |
1209 | Parameter { name: "index"; type: "int" } |
|
1209 | Parameter { name: "index"; type: "int" } | |
1210 | } |
|
1210 | } | |
1211 | Method { |
|
1211 | Method { | |
1212 | name: "append" |
|
1212 | name: "append" | |
1213 | type: "DeclarativeBarSet*" |
|
1213 | type: "DeclarativeBarSet*" | |
1214 | Parameter { name: "label"; type: "string" } |
|
1214 | Parameter { name: "label"; type: "string" } | |
1215 | Parameter { name: "values"; type: "QVariantList" } |
|
1215 | Parameter { name: "values"; type: "QVariantList" } | |
1216 | } |
|
1216 | } | |
1217 | Method { |
|
1217 | Method { | |
1218 | name: "insert" |
|
1218 | name: "insert" | |
1219 | type: "DeclarativeBarSet*" |
|
1219 | type: "DeclarativeBarSet*" | |
1220 | Parameter { name: "index"; type: "int" } |
|
1220 | Parameter { name: "index"; type: "int" } | |
1221 | Parameter { name: "label"; type: "string" } |
|
1221 | Parameter { name: "label"; type: "string" } | |
1222 | Parameter { name: "values"; type: "QVariantList" } |
|
1222 | Parameter { name: "values"; type: "QVariantList" } | |
1223 | } |
|
1223 | } | |
1224 | Method { |
|
1224 | Method { | |
1225 | name: "remove" |
|
1225 | name: "remove" | |
1226 | type: "bool" |
|
1226 | type: "bool" | |
1227 | Parameter { name: "barset"; type: "QBarSet"; isPointer: true } |
|
1227 | Parameter { name: "barset"; type: "QBarSet"; isPointer: true } | |
1228 | } |
|
1228 | } | |
1229 | Method { name: "clear" } |
|
1229 | Method { name: "clear" } | |
1230 | } |
|
1230 | } | |
1231 | Component { |
|
1231 | Component { | |
1232 | name: "QtCharts::DeclarativeHorizontalPercentBarSeries" |
|
1232 | name: "QtCharts::DeclarativeHorizontalPercentBarSeries" | |
1233 | defaultProperty: "seriesChildren" |
|
1233 | defaultProperty: "seriesChildren" | |
1234 | prototype: "QtCharts::QHorizontalPercentBarSeries" |
|
1234 | prototype: "QtCharts::QHorizontalPercentBarSeries" | |
1235 | exports: [ |
|
1235 | exports: [ | |
1236 | "QtCharts/HorizontalPercentBarSeries 1.1", |
|
1236 | "QtCharts/HorizontalPercentBarSeries 1.1", | |
1237 | "QtCharts/HorizontalPercentBarSeries 1.2", |
|
1237 | "QtCharts/HorizontalPercentBarSeries 1.2", | |
1238 | "QtCharts/HorizontalPercentBarSeries 2.0" |
|
1238 | "QtCharts/HorizontalPercentBarSeries 2.0" | |
1239 | ] |
|
1239 | ] | |
1240 | exportMetaObjectRevisions: [1, 2, 2] |
|
1240 | exportMetaObjectRevisions: [1, 2, 2] | |
1241 | Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true } |
|
1241 | Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true } | |
1242 | Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true } |
|
1242 | Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true } | |
1243 | Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true } |
|
1243 | Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true } | |
1244 | Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true } |
|
1244 | Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true } | |
1245 | Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true } |
|
1245 | Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true } | |
1246 | Signal { |
|
1246 | Signal { | |
1247 | name: "axisXChanged" |
|
1247 | name: "axisXChanged" | |
1248 | revision: 1 |
|
1248 | revision: 1 | |
1249 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1249 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1250 | } |
|
1250 | } | |
1251 | Signal { |
|
1251 | Signal { | |
1252 | name: "axisYChanged" |
|
1252 | name: "axisYChanged" | |
1253 | revision: 1 |
|
1253 | revision: 1 | |
1254 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1254 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1255 | } |
|
1255 | } | |
1256 | Signal { |
|
1256 | Signal { | |
1257 | name: "axisXTopChanged" |
|
1257 | name: "axisXTopChanged" | |
1258 | revision: 2 |
|
1258 | revision: 2 | |
1259 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1259 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1260 | } |
|
1260 | } | |
1261 | Signal { |
|
1261 | Signal { | |
1262 | name: "axisYRightChanged" |
|
1262 | name: "axisYRightChanged" | |
1263 | revision: 2 |
|
1263 | revision: 2 | |
1264 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1264 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1265 | } |
|
1265 | } | |
1266 | Method { |
|
1266 | Method { | |
1267 | name: "appendSeriesChildren" |
|
1267 | name: "appendSeriesChildren" | |
1268 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } |
|
1268 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } | |
1269 | Parameter { name: "element"; type: "QObject"; isPointer: true } |
|
1269 | Parameter { name: "element"; type: "QObject"; isPointer: true } | |
1270 | } |
|
1270 | } | |
1271 | Method { |
|
1271 | Method { | |
1272 | name: "at" |
|
1272 | name: "at" | |
1273 | type: "DeclarativeBarSet*" |
|
1273 | type: "DeclarativeBarSet*" | |
1274 | Parameter { name: "index"; type: "int" } |
|
1274 | Parameter { name: "index"; type: "int" } | |
1275 | } |
|
1275 | } | |
1276 | Method { |
|
1276 | Method { | |
1277 | name: "append" |
|
1277 | name: "append" | |
1278 | type: "DeclarativeBarSet*" |
|
1278 | type: "DeclarativeBarSet*" | |
1279 | Parameter { name: "label"; type: "string" } |
|
1279 | Parameter { name: "label"; type: "string" } | |
1280 | Parameter { name: "values"; type: "QVariantList" } |
|
1280 | Parameter { name: "values"; type: "QVariantList" } | |
1281 | } |
|
1281 | } | |
1282 | Method { |
|
1282 | Method { | |
1283 | name: "insert" |
|
1283 | name: "insert" | |
1284 | type: "DeclarativeBarSet*" |
|
1284 | type: "DeclarativeBarSet*" | |
1285 | Parameter { name: "index"; type: "int" } |
|
1285 | Parameter { name: "index"; type: "int" } | |
1286 | Parameter { name: "label"; type: "string" } |
|
1286 | Parameter { name: "label"; type: "string" } | |
1287 | Parameter { name: "values"; type: "QVariantList" } |
|
1287 | Parameter { name: "values"; type: "QVariantList" } | |
1288 | } |
|
1288 | } | |
1289 | Method { |
|
1289 | Method { | |
1290 | name: "remove" |
|
1290 | name: "remove" | |
1291 | type: "bool" |
|
1291 | type: "bool" | |
1292 | Parameter { name: "barset"; type: "QBarSet"; isPointer: true } |
|
1292 | Parameter { name: "barset"; type: "QBarSet"; isPointer: true } | |
1293 | } |
|
1293 | } | |
1294 | Method { name: "clear" } |
|
1294 | Method { name: "clear" } | |
1295 | } |
|
1295 | } | |
1296 | Component { |
|
1296 | Component { | |
1297 | name: "QtCharts::DeclarativeHorizontalStackedBarSeries" |
|
1297 | name: "QtCharts::DeclarativeHorizontalStackedBarSeries" | |
1298 | defaultProperty: "seriesChildren" |
|
1298 | defaultProperty: "seriesChildren" | |
1299 | prototype: "QtCharts::QHorizontalStackedBarSeries" |
|
1299 | prototype: "QtCharts::QHorizontalStackedBarSeries" | |
1300 | exports: [ |
|
1300 | exports: [ | |
1301 | "QtCharts/HorizontalStackedBarSeries 1.1", |
|
1301 | "QtCharts/HorizontalStackedBarSeries 1.1", | |
1302 | "QtCharts/HorizontalStackedBarSeries 1.2", |
|
1302 | "QtCharts/HorizontalStackedBarSeries 1.2", | |
1303 | "QtCharts/HorizontalStackedBarSeries 2.0" |
|
1303 | "QtCharts/HorizontalStackedBarSeries 2.0" | |
1304 | ] |
|
1304 | ] | |
1305 | exportMetaObjectRevisions: [1, 2, 2] |
|
1305 | exportMetaObjectRevisions: [1, 2, 2] | |
1306 | Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true } |
|
1306 | Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true } | |
1307 | Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true } |
|
1307 | Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true } | |
1308 | Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true } |
|
1308 | Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true } | |
1309 | Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true } |
|
1309 | Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true } | |
1310 | Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true } |
|
1310 | Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true } | |
1311 | Signal { |
|
1311 | Signal { | |
1312 | name: "axisXChanged" |
|
1312 | name: "axisXChanged" | |
1313 | revision: 1 |
|
1313 | revision: 1 | |
1314 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1314 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1315 | } |
|
1315 | } | |
1316 | Signal { |
|
1316 | Signal { | |
1317 | name: "axisYChanged" |
|
1317 | name: "axisYChanged" | |
1318 | revision: 1 |
|
1318 | revision: 1 | |
1319 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1319 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1320 | } |
|
1320 | } | |
1321 | Signal { |
|
1321 | Signal { | |
1322 | name: "axisXTopChanged" |
|
1322 | name: "axisXTopChanged" | |
1323 | revision: 2 |
|
1323 | revision: 2 | |
1324 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1324 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1325 | } |
|
1325 | } | |
1326 | Signal { |
|
1326 | Signal { | |
1327 | name: "axisYRightChanged" |
|
1327 | name: "axisYRightChanged" | |
1328 | revision: 2 |
|
1328 | revision: 2 | |
1329 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1329 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1330 | } |
|
1330 | } | |
1331 | Method { |
|
1331 | Method { | |
1332 | name: "appendSeriesChildren" |
|
1332 | name: "appendSeriesChildren" | |
1333 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } |
|
1333 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } | |
1334 | Parameter { name: "element"; type: "QObject"; isPointer: true } |
|
1334 | Parameter { name: "element"; type: "QObject"; isPointer: true } | |
1335 | } |
|
1335 | } | |
1336 | Method { |
|
1336 | Method { | |
1337 | name: "at" |
|
1337 | name: "at" | |
1338 | type: "DeclarativeBarSet*" |
|
1338 | type: "DeclarativeBarSet*" | |
1339 | Parameter { name: "index"; type: "int" } |
|
1339 | Parameter { name: "index"; type: "int" } | |
1340 | } |
|
1340 | } | |
1341 | Method { |
|
1341 | Method { | |
1342 | name: "append" |
|
1342 | name: "append" | |
1343 | type: "DeclarativeBarSet*" |
|
1343 | type: "DeclarativeBarSet*" | |
1344 | Parameter { name: "label"; type: "string" } |
|
1344 | Parameter { name: "label"; type: "string" } | |
1345 | Parameter { name: "values"; type: "QVariantList" } |
|
1345 | Parameter { name: "values"; type: "QVariantList" } | |
1346 | } |
|
1346 | } | |
1347 | Method { |
|
1347 | Method { | |
1348 | name: "insert" |
|
1348 | name: "insert" | |
1349 | type: "DeclarativeBarSet*" |
|
1349 | type: "DeclarativeBarSet*" | |
1350 | Parameter { name: "index"; type: "int" } |
|
1350 | Parameter { name: "index"; type: "int" } | |
1351 | Parameter { name: "label"; type: "string" } |
|
1351 | Parameter { name: "label"; type: "string" } | |
1352 | Parameter { name: "values"; type: "QVariantList" } |
|
1352 | Parameter { name: "values"; type: "QVariantList" } | |
1353 | } |
|
1353 | } | |
1354 | Method { |
|
1354 | Method { | |
1355 | name: "remove" |
|
1355 | name: "remove" | |
1356 | type: "bool" |
|
1356 | type: "bool" | |
1357 | Parameter { name: "barset"; type: "QBarSet"; isPointer: true } |
|
1357 | Parameter { name: "barset"; type: "QBarSet"; isPointer: true } | |
1358 | } |
|
1358 | } | |
1359 | Method { name: "clear" } |
|
1359 | Method { name: "clear" } | |
1360 | } |
|
1360 | } | |
1361 | Component { |
|
1361 | Component { | |
1362 | name: "QtCharts::DeclarativeLineSeries" |
|
1362 | name: "QtCharts::DeclarativeLineSeries" | |
1363 | defaultProperty: "declarativeChildren" |
|
1363 | defaultProperty: "declarativeChildren" | |
1364 | prototype: "QtCharts::QLineSeries" |
|
1364 | prototype: "QtCharts::QLineSeries" | |
1365 | exports: [ |
|
1365 | exports: [ | |
1366 | "QtCharts/LineSeries 1.0", |
|
1366 | "QtCharts/LineSeries 1.0", | |
1367 | "QtCharts/LineSeries 1.1", |
|
1367 | "QtCharts/LineSeries 1.1", | |
1368 | "QtCharts/LineSeries 1.2", |
|
1368 | "QtCharts/LineSeries 1.2", | |
1369 | "QtCharts/LineSeries 1.3", |
|
1369 | "QtCharts/LineSeries 1.3", | |
1370 | "QtCharts/LineSeries 2.0", |
|
1370 | "QtCharts/LineSeries 2.0", | |
1371 | "QtCharts/LineSeries 2.1" |
|
1371 | "QtCharts/LineSeries 2.1" | |
1372 | ] |
|
1372 | ] | |
1373 | exportMetaObjectRevisions: [0, 1, 2, 3, 3, 4] |
|
1373 | exportMetaObjectRevisions: [0, 1, 2, 3, 3, 4] | |
1374 | Property { name: "count"; type: "int"; isReadonly: true } |
|
1374 | Property { name: "count"; type: "int"; isReadonly: true } | |
1375 | Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true } |
|
1375 | Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true } | |
1376 | Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true } |
|
1376 | Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true } | |
1377 | Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true } |
|
1377 | Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true } | |
1378 | Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true } |
|
1378 | Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true } | |
1379 | Property { name: "axisAngular"; revision: 3; type: "QAbstractAxis"; isPointer: true } |
|
1379 | Property { name: "axisAngular"; revision: 3; type: "QAbstractAxis"; isPointer: true } | |
1380 | Property { name: "axisRadial"; revision: 3; type: "QAbstractAxis"; isPointer: true } |
|
1380 | Property { name: "axisRadial"; revision: 3; type: "QAbstractAxis"; isPointer: true } | |
1381 | Property { name: "width"; revision: 1; type: "double" } |
|
1381 | Property { name: "width"; revision: 1; type: "double" } | |
1382 | Property { name: "style"; revision: 1; type: "Qt::PenStyle" } |
|
1382 | Property { name: "style"; revision: 1; type: "Qt::PenStyle" } | |
1383 | Property { name: "capStyle"; revision: 1; type: "Qt::PenCapStyle" } |
|
1383 | Property { name: "capStyle"; revision: 1; type: "Qt::PenCapStyle" } | |
1384 | Property { name: "declarativeChildren"; type: "QObject"; isList: true; isReadonly: true } |
|
1384 | Property { name: "declarativeChildren"; type: "QObject"; isList: true; isReadonly: true } | |
1385 | Signal { |
|
1385 | Signal { | |
1386 | name: "countChanged" |
|
1386 | name: "countChanged" | |
1387 | Parameter { name: "count"; type: "int" } |
|
1387 | Parameter { name: "count"; type: "int" } | |
1388 | } |
|
1388 | } | |
1389 | Signal { |
|
1389 | Signal { | |
1390 | name: "axisXChanged" |
|
1390 | name: "axisXChanged" | |
1391 | revision: 1 |
|
1391 | revision: 1 | |
1392 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1392 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1393 | } |
|
1393 | } | |
1394 | Signal { |
|
1394 | Signal { | |
1395 | name: "axisYChanged" |
|
1395 | name: "axisYChanged" | |
1396 | revision: 1 |
|
1396 | revision: 1 | |
1397 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1397 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1398 | } |
|
1398 | } | |
1399 | Signal { |
|
1399 | Signal { | |
1400 | name: "axisXTopChanged" |
|
1400 | name: "axisXTopChanged" | |
1401 | revision: 2 |
|
1401 | revision: 2 | |
1402 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1402 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1403 | } |
|
1403 | } | |
1404 | Signal { |
|
1404 | Signal { | |
1405 | name: "axisYRightChanged" |
|
1405 | name: "axisYRightChanged" | |
1406 | revision: 2 |
|
1406 | revision: 2 | |
1407 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1407 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1408 | } |
|
1408 | } | |
1409 | Signal { |
|
1409 | Signal { | |
1410 | name: "axisAngularChanged" |
|
1410 | name: "axisAngularChanged" | |
1411 | revision: 3 |
|
1411 | revision: 3 | |
1412 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1412 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1413 | } |
|
1413 | } | |
1414 | Signal { |
|
1414 | Signal { | |
1415 | name: "axisRadialChanged" |
|
1415 | name: "axisRadialChanged" | |
1416 | revision: 3 |
|
1416 | revision: 3 | |
1417 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1417 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1418 | } |
|
1418 | } | |
1419 | Signal { |
|
1419 | Signal { | |
1420 | name: "widthChanged" |
|
1420 | name: "widthChanged" | |
1421 | revision: 1 |
|
1421 | revision: 1 | |
1422 | Parameter { name: "width"; type: "double" } |
|
1422 | Parameter { name: "width"; type: "double" } | |
1423 | } |
|
1423 | } | |
1424 | Signal { |
|
1424 | Signal { | |
1425 | name: "styleChanged" |
|
1425 | name: "styleChanged" | |
1426 | revision: 1 |
|
1426 | revision: 1 | |
1427 | Parameter { name: "style"; type: "Qt::PenStyle" } |
|
1427 | Parameter { name: "style"; type: "Qt::PenStyle" } | |
1428 | } |
|
1428 | } | |
1429 | Signal { |
|
1429 | Signal { | |
1430 | name: "capStyleChanged" |
|
1430 | name: "capStyleChanged" | |
1431 | revision: 1 |
|
1431 | revision: 1 | |
1432 | Parameter { name: "capStyle"; type: "Qt::PenCapStyle" } |
|
1432 | Parameter { name: "capStyle"; type: "Qt::PenCapStyle" } | |
1433 | } |
|
1433 | } | |
1434 | Method { |
|
1434 | Method { | |
1435 | name: "appendDeclarativeChildren" |
|
1435 | name: "appendDeclarativeChildren" | |
1436 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } |
|
1436 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } | |
1437 | Parameter { name: "element"; type: "QObject"; isPointer: true } |
|
1437 | Parameter { name: "element"; type: "QObject"; isPointer: true } | |
1438 | } |
|
1438 | } | |
1439 | Method { |
|
1439 | Method { | |
1440 | name: "handleCountChanged" |
|
1440 | name: "handleCountChanged" | |
1441 | Parameter { name: "index"; type: "int" } |
|
1441 | Parameter { name: "index"; type: "int" } | |
1442 | } |
|
1442 | } | |
1443 | Method { |
|
1443 | Method { | |
1444 | name: "append" |
|
1444 | name: "append" | |
1445 | Parameter { name: "x"; type: "double" } |
|
1445 | Parameter { name: "x"; type: "double" } | |
1446 | Parameter { name: "y"; type: "double" } |
|
1446 | Parameter { name: "y"; type: "double" } | |
1447 | } |
|
1447 | } | |
1448 | Method { |
|
1448 | Method { | |
1449 | name: "replace" |
|
1449 | name: "replace" | |
1450 | Parameter { name: "oldX"; type: "double" } |
|
1450 | Parameter { name: "oldX"; type: "double" } | |
1451 | Parameter { name: "oldY"; type: "double" } |
|
1451 | Parameter { name: "oldY"; type: "double" } | |
1452 | Parameter { name: "newX"; type: "double" } |
|
1452 | Parameter { name: "newX"; type: "double" } | |
1453 | Parameter { name: "newY"; type: "double" } |
|
1453 | Parameter { name: "newY"; type: "double" } | |
1454 | } |
|
1454 | } | |
1455 | Method { |
|
1455 | Method { | |
1456 | name: "replace" |
|
1456 | name: "replace" | |
1457 | revision: 3 |
|
1457 | revision: 3 | |
1458 | Parameter { name: "index"; type: "int" } |
|
1458 | Parameter { name: "index"; type: "int" } | |
1459 | Parameter { name: "newX"; type: "double" } |
|
1459 | Parameter { name: "newX"; type: "double" } | |
1460 | Parameter { name: "newY"; type: "double" } |
|
1460 | Parameter { name: "newY"; type: "double" } | |
1461 | } |
|
1461 | } | |
1462 | Method { |
|
1462 | Method { | |
1463 | name: "remove" |
|
1463 | name: "remove" | |
1464 | Parameter { name: "x"; type: "double" } |
|
1464 | Parameter { name: "x"; type: "double" } | |
1465 | Parameter { name: "y"; type: "double" } |
|
1465 | Parameter { name: "y"; type: "double" } | |
1466 | } |
|
1466 | } | |
1467 | Method { |
|
1467 | Method { | |
1468 | name: "remove" |
|
1468 | name: "remove" | |
1469 | revision: 3 |
|
1469 | revision: 3 | |
1470 | Parameter { name: "index"; type: "int" } |
|
1470 | Parameter { name: "index"; type: "int" } | |
1471 | } |
|
1471 | } | |
1472 | Method { |
|
1472 | Method { | |
1473 | name: "removePoints" |
|
1473 | name: "removePoints" | |
1474 | revision: 4 |
|
1474 | revision: 4 | |
1475 | Parameter { name: "index"; type: "int" } |
|
1475 | Parameter { name: "index"; type: "int" } | |
1476 | Parameter { name: "count"; type: "int" } |
|
1476 | Parameter { name: "count"; type: "int" } | |
1477 | } |
|
1477 | } | |
1478 | Method { |
|
1478 | Method { | |
1479 | name: "insert" |
|
1479 | name: "insert" | |
1480 | Parameter { name: "index"; type: "int" } |
|
1480 | Parameter { name: "index"; type: "int" } | |
1481 | Parameter { name: "x"; type: "double" } |
|
1481 | Parameter { name: "x"; type: "double" } | |
1482 | Parameter { name: "y"; type: "double" } |
|
1482 | Parameter { name: "y"; type: "double" } | |
1483 | } |
|
1483 | } | |
1484 | Method { name: "clear" } |
|
1484 | Method { name: "clear" } | |
1485 | Method { |
|
1485 | Method { | |
1486 | name: "at" |
|
1486 | name: "at" | |
1487 | type: "QPointF" |
|
1487 | type: "QPointF" | |
1488 | Parameter { name: "index"; type: "int" } |
|
1488 | Parameter { name: "index"; type: "int" } | |
1489 | } |
|
1489 | } | |
1490 | } |
|
1490 | } | |
1491 | Component { |
|
1491 | Component { | |
1492 | name: "QtCharts::DeclarativeMargins" |
|
1492 | name: "QtCharts::DeclarativeMargins" | |
1493 | prototype: "QObject" |
|
1493 | prototype: "QObject" | |
1494 | exports: ["QtCharts/Margins 1.1", "QtCharts/Margins 2.0"] |
|
1494 | exports: ["QtCharts/Margins 1.1", "QtCharts/Margins 2.0"] | |
1495 | isCreatable: false |
|
1495 | isCreatable: false | |
1496 | exportMetaObjectRevisions: [0, 0] |
|
1496 | exportMetaObjectRevisions: [0, 0] | |
1497 | Property { name: "top"; type: "int" } |
|
1497 | Property { name: "top"; type: "int" } | |
1498 | Property { name: "bottom"; type: "int" } |
|
1498 | Property { name: "bottom"; type: "int" } | |
1499 | Property { name: "left"; type: "int" } |
|
1499 | Property { name: "left"; type: "int" } | |
1500 | Property { name: "right"; type: "int" } |
|
1500 | Property { name: "right"; type: "int" } | |
1501 | Signal { |
|
1501 | Signal { | |
1502 | name: "topChanged" |
|
1502 | name: "topChanged" | |
1503 | Parameter { name: "top"; type: "int" } |
|
1503 | Parameter { name: "top"; type: "int" } | |
1504 | Parameter { name: "bottom"; type: "int" } |
|
1504 | Parameter { name: "bottom"; type: "int" } | |
1505 | Parameter { name: "left"; type: "int" } |
|
1505 | Parameter { name: "left"; type: "int" } | |
1506 | Parameter { name: "right"; type: "int" } |
|
1506 | Parameter { name: "right"; type: "int" } | |
1507 | } |
|
1507 | } | |
1508 | Signal { |
|
1508 | Signal { | |
1509 | name: "bottomChanged" |
|
1509 | name: "bottomChanged" | |
1510 | Parameter { name: "top"; type: "int" } |
|
1510 | Parameter { name: "top"; type: "int" } | |
1511 | Parameter { name: "bottom"; type: "int" } |
|
1511 | Parameter { name: "bottom"; type: "int" } | |
1512 | Parameter { name: "left"; type: "int" } |
|
1512 | Parameter { name: "left"; type: "int" } | |
1513 | Parameter { name: "right"; type: "int" } |
|
1513 | Parameter { name: "right"; type: "int" } | |
1514 | } |
|
1514 | } | |
1515 | Signal { |
|
1515 | Signal { | |
1516 | name: "leftChanged" |
|
1516 | name: "leftChanged" | |
1517 | Parameter { name: "top"; type: "int" } |
|
1517 | Parameter { name: "top"; type: "int" } | |
1518 | Parameter { name: "bottom"; type: "int" } |
|
1518 | Parameter { name: "bottom"; type: "int" } | |
1519 | Parameter { name: "left"; type: "int" } |
|
1519 | Parameter { name: "left"; type: "int" } | |
1520 | Parameter { name: "right"; type: "int" } |
|
1520 | Parameter { name: "right"; type: "int" } | |
1521 | } |
|
1521 | } | |
1522 | Signal { |
|
1522 | Signal { | |
1523 | name: "rightChanged" |
|
1523 | name: "rightChanged" | |
1524 | Parameter { name: "top"; type: "int" } |
|
1524 | Parameter { name: "top"; type: "int" } | |
1525 | Parameter { name: "bottom"; type: "int" } |
|
1525 | Parameter { name: "bottom"; type: "int" } | |
1526 | Parameter { name: "left"; type: "int" } |
|
1526 | Parameter { name: "left"; type: "int" } | |
1527 | Parameter { name: "right"; type: "int" } |
|
1527 | Parameter { name: "right"; type: "int" } | |
1528 | } |
|
1528 | } | |
1529 | } |
|
1529 | } | |
1530 | Component { |
|
1530 | Component { | |
1531 | name: "QtCharts::DeclarativePercentBarSeries" |
|
1531 | name: "QtCharts::DeclarativePercentBarSeries" | |
1532 | defaultProperty: "seriesChildren" |
|
1532 | defaultProperty: "seriesChildren" | |
1533 | prototype: "QtCharts::QPercentBarSeries" |
|
1533 | prototype: "QtCharts::QPercentBarSeries" | |
1534 | exports: [ |
|
1534 | exports: [ | |
1535 | "QtCharts/PercentBarSeries 1.0", |
|
1535 | "QtCharts/PercentBarSeries 1.0", | |
1536 | "QtCharts/PercentBarSeries 1.1", |
|
1536 | "QtCharts/PercentBarSeries 1.1", | |
1537 | "QtCharts/PercentBarSeries 1.2", |
|
1537 | "QtCharts/PercentBarSeries 1.2", | |
1538 | "QtCharts/PercentBarSeries 2.0" |
|
1538 | "QtCharts/PercentBarSeries 2.0" | |
1539 | ] |
|
1539 | ] | |
1540 | exportMetaObjectRevisions: [0, 1, 2, 2] |
|
1540 | exportMetaObjectRevisions: [0, 1, 2, 2] | |
1541 | Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true } |
|
1541 | Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true } | |
1542 | Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true } |
|
1542 | Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true } | |
1543 | Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true } |
|
1543 | Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true } | |
1544 | Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true } |
|
1544 | Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true } | |
1545 | Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true } |
|
1545 | Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true } | |
1546 | Signal { |
|
1546 | Signal { | |
1547 | name: "axisXChanged" |
|
1547 | name: "axisXChanged" | |
1548 | revision: 1 |
|
1548 | revision: 1 | |
1549 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1549 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1550 | } |
|
1550 | } | |
1551 | Signal { |
|
1551 | Signal { | |
1552 | name: "axisYChanged" |
|
1552 | name: "axisYChanged" | |
1553 | revision: 1 |
|
1553 | revision: 1 | |
1554 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1554 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1555 | } |
|
1555 | } | |
1556 | Signal { |
|
1556 | Signal { | |
1557 | name: "axisXTopChanged" |
|
1557 | name: "axisXTopChanged" | |
1558 | revision: 2 |
|
1558 | revision: 2 | |
1559 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1559 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1560 | } |
|
1560 | } | |
1561 | Signal { |
|
1561 | Signal { | |
1562 | name: "axisYRightChanged" |
|
1562 | name: "axisYRightChanged" | |
1563 | revision: 2 |
|
1563 | revision: 2 | |
1564 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1564 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1565 | } |
|
1565 | } | |
1566 | Method { |
|
1566 | Method { | |
1567 | name: "appendSeriesChildren" |
|
1567 | name: "appendSeriesChildren" | |
1568 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } |
|
1568 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } | |
1569 | Parameter { name: "element"; type: "QObject"; isPointer: true } |
|
1569 | Parameter { name: "element"; type: "QObject"; isPointer: true } | |
1570 | } |
|
1570 | } | |
1571 | Method { |
|
1571 | Method { | |
1572 | name: "at" |
|
1572 | name: "at" | |
1573 | type: "DeclarativeBarSet*" |
|
1573 | type: "DeclarativeBarSet*" | |
1574 | Parameter { name: "index"; type: "int" } |
|
1574 | Parameter { name: "index"; type: "int" } | |
1575 | } |
|
1575 | } | |
1576 | Method { |
|
1576 | Method { | |
1577 | name: "append" |
|
1577 | name: "append" | |
1578 | type: "DeclarativeBarSet*" |
|
1578 | type: "DeclarativeBarSet*" | |
1579 | Parameter { name: "label"; type: "string" } |
|
1579 | Parameter { name: "label"; type: "string" } | |
1580 | Parameter { name: "values"; type: "QVariantList" } |
|
1580 | Parameter { name: "values"; type: "QVariantList" } | |
1581 | } |
|
1581 | } | |
1582 | Method { |
|
1582 | Method { | |
1583 | name: "insert" |
|
1583 | name: "insert" | |
1584 | type: "DeclarativeBarSet*" |
|
1584 | type: "DeclarativeBarSet*" | |
1585 | Parameter { name: "index"; type: "int" } |
|
1585 | Parameter { name: "index"; type: "int" } | |
1586 | Parameter { name: "label"; type: "string" } |
|
1586 | Parameter { name: "label"; type: "string" } | |
1587 | Parameter { name: "values"; type: "QVariantList" } |
|
1587 | Parameter { name: "values"; type: "QVariantList" } | |
1588 | } |
|
1588 | } | |
1589 | Method { |
|
1589 | Method { | |
1590 | name: "remove" |
|
1590 | name: "remove" | |
1591 | type: "bool" |
|
1591 | type: "bool" | |
1592 | Parameter { name: "barset"; type: "QBarSet"; isPointer: true } |
|
1592 | Parameter { name: "barset"; type: "QBarSet"; isPointer: true } | |
1593 | } |
|
1593 | } | |
1594 | Method { name: "clear" } |
|
1594 | Method { name: "clear" } | |
1595 | } |
|
1595 | } | |
1596 | Component { |
|
1596 | Component { | |
1597 | name: "QtCharts::DeclarativePieSeries" |
|
1597 | name: "QtCharts::DeclarativePieSeries" | |
1598 | defaultProperty: "seriesChildren" |
|
1598 | defaultProperty: "seriesChildren" | |
1599 | prototype: "QtCharts::QPieSeries" |
|
1599 | prototype: "QtCharts::QPieSeries" | |
1600 | exports: [ |
|
1600 | exports: [ | |
1601 | "QtCharts/PieSeries 1.0", |
|
1601 | "QtCharts/PieSeries 1.0", | |
1602 | "QtCharts/PieSeries 1.1", |
|
1602 | "QtCharts/PieSeries 1.1", | |
1603 | "QtCharts/PieSeries 2.0" |
|
1603 | "QtCharts/PieSeries 2.0" | |
1604 | ] |
|
1604 | ] | |
1605 | exportMetaObjectRevisions: [0, 0, 0] |
|
1605 | exportMetaObjectRevisions: [0, 0, 0] | |
1606 | Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true } |
|
1606 | Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true } | |
1607 | Signal { |
|
1607 | Signal { | |
1608 | name: "sliceAdded" |
|
1608 | name: "sliceAdded" | |
1609 | Parameter { name: "slice"; type: "QPieSlice"; isPointer: true } |
|
1609 | Parameter { name: "slice"; type: "QPieSlice"; isPointer: true } | |
1610 | } |
|
1610 | } | |
1611 | Signal { |
|
1611 | Signal { | |
1612 | name: "sliceRemoved" |
|
1612 | name: "sliceRemoved" | |
1613 | Parameter { name: "slice"; type: "QPieSlice"; isPointer: true } |
|
1613 | Parameter { name: "slice"; type: "QPieSlice"; isPointer: true } | |
1614 | } |
|
1614 | } | |
1615 | Method { |
|
1615 | Method { | |
1616 | name: "appendSeriesChildren" |
|
1616 | name: "appendSeriesChildren" | |
1617 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } |
|
1617 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } | |
1618 | Parameter { name: "element"; type: "QObject"; isPointer: true } |
|
1618 | Parameter { name: "element"; type: "QObject"; isPointer: true } | |
1619 | } |
|
1619 | } | |
1620 | Method { |
|
1620 | Method { | |
1621 | name: "handleAdded" |
|
1621 | name: "handleAdded" | |
1622 | Parameter { name: "slices"; type: "QList<QPieSlice*>" } |
|
1622 | Parameter { name: "slices"; type: "QList<QPieSlice*>" } | |
1623 | } |
|
1623 | } | |
1624 | Method { |
|
1624 | Method { | |
1625 | name: "handleRemoved" |
|
1625 | name: "handleRemoved" | |
1626 | Parameter { name: "slices"; type: "QList<QPieSlice*>" } |
|
1626 | Parameter { name: "slices"; type: "QList<QPieSlice*>" } | |
1627 | } |
|
1627 | } | |
1628 | Method { |
|
1628 | Method { | |
1629 | name: "at" |
|
1629 | name: "at" | |
1630 | type: "QPieSlice*" |
|
1630 | type: "QPieSlice*" | |
1631 | Parameter { name: "index"; type: "int" } |
|
1631 | Parameter { name: "index"; type: "int" } | |
1632 | } |
|
1632 | } | |
1633 | Method { |
|
1633 | Method { | |
1634 | name: "find" |
|
1634 | name: "find" | |
1635 | type: "QPieSlice*" |
|
1635 | type: "QPieSlice*" | |
1636 | Parameter { name: "label"; type: "string" } |
|
1636 | Parameter { name: "label"; type: "string" } | |
1637 | } |
|
1637 | } | |
1638 | Method { |
|
1638 | Method { | |
1639 | name: "append" |
|
1639 | name: "append" | |
1640 | type: "DeclarativePieSlice*" |
|
1640 | type: "DeclarativePieSlice*" | |
1641 | Parameter { name: "label"; type: "string" } |
|
1641 | Parameter { name: "label"; type: "string" } | |
1642 | Parameter { name: "value"; type: "double" } |
|
1642 | Parameter { name: "value"; type: "double" } | |
1643 | } |
|
1643 | } | |
1644 | Method { |
|
1644 | Method { | |
1645 | name: "remove" |
|
1645 | name: "remove" | |
1646 | type: "bool" |
|
1646 | type: "bool" | |
1647 | Parameter { name: "slice"; type: "QPieSlice"; isPointer: true } |
|
1647 | Parameter { name: "slice"; type: "QPieSlice"; isPointer: true } | |
1648 | } |
|
1648 | } | |
1649 | Method { name: "clear" } |
|
1649 | Method { name: "clear" } | |
1650 | } |
|
1650 | } | |
1651 | Component { |
|
1651 | Component { | |
1652 | name: "QtCharts::DeclarativePieSlice" |
|
1652 | name: "QtCharts::DeclarativePieSlice" | |
1653 | prototype: "QtCharts::QPieSlice" |
|
1653 | prototype: "QtCharts::QPieSlice" | |
1654 | exports: ["QtCharts/PieSlice 1.4", "QtCharts/PieSlice 2.0"] |
|
1654 | exports: ["QtCharts/PieSlice 1.4", "QtCharts/PieSlice 2.0"] | |
1655 | exportMetaObjectRevisions: [0, 0] |
|
1655 | exportMetaObjectRevisions: [0, 0] | |
1656 | Property { name: "brushFilename"; type: "string" } |
|
1656 | Property { name: "brushFilename"; type: "string" } | |
1657 | Signal { |
|
1657 | Signal { | |
1658 | name: "brushFilenameChanged" |
|
1658 | name: "brushFilenameChanged" | |
1659 | Parameter { name: "brushFilename"; type: "string" } |
|
1659 | Parameter { name: "brushFilename"; type: "string" } | |
1660 | } |
|
1660 | } | |
1661 | } |
|
1661 | } | |
1662 | Component { |
|
1662 | Component { | |
1663 | name: "QtCharts::DeclarativePolarChart" |
|
1663 | name: "QtCharts::DeclarativePolarChart" | |
1664 | defaultProperty: "data" |
|
1664 | defaultProperty: "data" | |
1665 | prototype: "QtCharts::DeclarativeChart" |
|
1665 | prototype: "QtCharts::DeclarativeChart" | |
1666 | exports: [ |
|
1666 | exports: [ | |
1667 | "QtCharts/PolarChartView 1.3", |
|
1667 | "QtCharts/PolarChartView 1.3", | |
1668 | "QtCharts/PolarChartView 2.0" |
|
1668 | "QtCharts/PolarChartView 2.0" | |
1669 | ] |
|
1669 | ] | |
1670 | exportMetaObjectRevisions: [1, 1] |
|
1670 | exportMetaObjectRevisions: [1, 1] | |
1671 | } |
|
1671 | } | |
1672 | Component { |
|
1672 | Component { | |
1673 | name: "QtCharts::DeclarativeScatterSeries" |
|
1673 | name: "QtCharts::DeclarativeScatterSeries" | |
1674 | defaultProperty: "declarativeChildren" |
|
1674 | defaultProperty: "declarativeChildren" | |
1675 | prototype: "QtCharts::QScatterSeries" |
|
1675 | prototype: "QtCharts::QScatterSeries" | |
1676 | exports: [ |
|
1676 | exports: [ | |
1677 | "QtCharts/ScatterSeries 1.0", |
|
1677 | "QtCharts/ScatterSeries 1.0", | |
1678 | "QtCharts/ScatterSeries 1.1", |
|
1678 | "QtCharts/ScatterSeries 1.1", | |
1679 | "QtCharts/ScatterSeries 1.2", |
|
1679 | "QtCharts/ScatterSeries 1.2", | |
1680 | "QtCharts/ScatterSeries 1.3", |
|
1680 | "QtCharts/ScatterSeries 1.3", | |
1681 | "QtCharts/ScatterSeries 1.4", |
|
1681 | "QtCharts/ScatterSeries 1.4", | |
1682 | "QtCharts/ScatterSeries 2.0", |
|
1682 | "QtCharts/ScatterSeries 2.0", | |
1683 | "QtCharts/ScatterSeries 2.1" |
|
1683 | "QtCharts/ScatterSeries 2.1" | |
1684 | ] |
|
1684 | ] | |
1685 | exportMetaObjectRevisions: [0, 1, 2, 3, 4, 4, 5] |
|
1685 | exportMetaObjectRevisions: [0, 1, 2, 3, 4, 4, 5] | |
1686 | Property { name: "count"; type: "int"; isReadonly: true } |
|
1686 | Property { name: "count"; type: "int"; isReadonly: true } | |
1687 | Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true } |
|
1687 | Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true } | |
1688 | Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true } |
|
1688 | Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true } | |
1689 | Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true } |
|
1689 | Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true } | |
1690 | Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true } |
|
1690 | Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true } | |
1691 | Property { name: "axisAngular"; revision: 3; type: "QAbstractAxis"; isPointer: true } |
|
1691 | Property { name: "axisAngular"; revision: 3; type: "QAbstractAxis"; isPointer: true } | |
1692 | Property { name: "axisRadial"; revision: 3; type: "QAbstractAxis"; isPointer: true } |
|
1692 | Property { name: "axisRadial"; revision: 3; type: "QAbstractAxis"; isPointer: true } | |
1693 | Property { name: "borderWidth"; revision: 1; type: "double" } |
|
1693 | Property { name: "borderWidth"; revision: 1; type: "double" } | |
1694 | Property { name: "declarativeChildren"; type: "QObject"; isList: true; isReadonly: true } |
|
1694 | Property { name: "declarativeChildren"; type: "QObject"; isList: true; isReadonly: true } | |
1695 | Property { name: "brushFilename"; revision: 4; type: "string" } |
|
1695 | Property { name: "brushFilename"; revision: 4; type: "string" } | |
1696 | Property { name: "brush"; revision: 4; type: "QBrush" } |
|
1696 | Property { name: "brush"; revision: 4; type: "QBrush" } | |
1697 | Signal { |
|
1697 | Signal { | |
1698 | name: "countChanged" |
|
1698 | name: "countChanged" | |
1699 | Parameter { name: "count"; type: "int" } |
|
1699 | Parameter { name: "count"; type: "int" } | |
1700 | } |
|
1700 | } | |
1701 | Signal { |
|
1701 | Signal { | |
1702 | name: "axisXChanged" |
|
1702 | name: "axisXChanged" | |
1703 | revision: 1 |
|
1703 | revision: 1 | |
1704 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1704 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1705 | } |
|
1705 | } | |
1706 | Signal { |
|
1706 | Signal { | |
1707 | name: "axisYChanged" |
|
1707 | name: "axisYChanged" | |
1708 | revision: 1 |
|
1708 | revision: 1 | |
1709 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1709 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1710 | } |
|
1710 | } | |
1711 | Signal { |
|
1711 | Signal { | |
1712 | name: "borderWidthChanged" |
|
1712 | name: "borderWidthChanged" | |
1713 | revision: 1 |
|
1713 | revision: 1 | |
1714 | Parameter { name: "width"; type: "double" } |
|
1714 | Parameter { name: "width"; type: "double" } | |
1715 | } |
|
1715 | } | |
1716 | Signal { |
|
1716 | Signal { | |
1717 | name: "axisXTopChanged" |
|
1717 | name: "axisXTopChanged" | |
1718 | revision: 2 |
|
1718 | revision: 2 | |
1719 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1719 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1720 | } |
|
1720 | } | |
1721 | Signal { |
|
1721 | Signal { | |
1722 | name: "axisYRightChanged" |
|
1722 | name: "axisYRightChanged" | |
1723 | revision: 2 |
|
1723 | revision: 2 | |
1724 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1724 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1725 | } |
|
1725 | } | |
1726 | Signal { |
|
1726 | Signal { | |
1727 | name: "axisAngularChanged" |
|
1727 | name: "axisAngularChanged" | |
1728 | revision: 3 |
|
1728 | revision: 3 | |
1729 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1729 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1730 | } |
|
1730 | } | |
1731 | Signal { |
|
1731 | Signal { | |
1732 | name: "axisRadialChanged" |
|
1732 | name: "axisRadialChanged" | |
1733 | revision: 3 |
|
1733 | revision: 3 | |
1734 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1734 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1735 | } |
|
1735 | } | |
1736 | Signal { |
|
1736 | Signal { | |
1737 | name: "brushFilenameChanged" |
|
1737 | name: "brushFilenameChanged" | |
1738 | revision: 4 |
|
1738 | revision: 4 | |
1739 | Parameter { name: "brushFilename"; type: "string" } |
|
1739 | Parameter { name: "brushFilename"; type: "string" } | |
1740 | } |
|
1740 | } | |
1741 | Signal { name: "brushChanged"; revision: 4 } |
|
1741 | Signal { name: "brushChanged"; revision: 4 } | |
1742 | Method { |
|
1742 | Method { | |
1743 | name: "appendDeclarativeChildren" |
|
1743 | name: "appendDeclarativeChildren" | |
1744 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } |
|
1744 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } | |
1745 | Parameter { name: "element"; type: "QObject"; isPointer: true } |
|
1745 | Parameter { name: "element"; type: "QObject"; isPointer: true } | |
1746 | } |
|
1746 | } | |
1747 | Method { |
|
1747 | Method { | |
1748 | name: "handleCountChanged" |
|
1748 | name: "handleCountChanged" | |
1749 | Parameter { name: "index"; type: "int" } |
|
1749 | Parameter { name: "index"; type: "int" } | |
1750 | } |
|
1750 | } | |
1751 | Method { |
|
1751 | Method { | |
1752 | name: "append" |
|
1752 | name: "append" | |
1753 | Parameter { name: "x"; type: "double" } |
|
1753 | Parameter { name: "x"; type: "double" } | |
1754 | Parameter { name: "y"; type: "double" } |
|
1754 | Parameter { name: "y"; type: "double" } | |
1755 | } |
|
1755 | } | |
1756 | Method { |
|
1756 | Method { | |
1757 | name: "replace" |
|
1757 | name: "replace" | |
1758 | Parameter { name: "oldX"; type: "double" } |
|
1758 | Parameter { name: "oldX"; type: "double" } | |
1759 | Parameter { name: "oldY"; type: "double" } |
|
1759 | Parameter { name: "oldY"; type: "double" } | |
1760 | Parameter { name: "newX"; type: "double" } |
|
1760 | Parameter { name: "newX"; type: "double" } | |
1761 | Parameter { name: "newY"; type: "double" } |
|
1761 | Parameter { name: "newY"; type: "double" } | |
1762 | } |
|
1762 | } | |
1763 | Method { |
|
1763 | Method { | |
1764 | name: "replace" |
|
1764 | name: "replace" | |
1765 | revision: 3 |
|
1765 | revision: 3 | |
1766 | Parameter { name: "index"; type: "int" } |
|
1766 | Parameter { name: "index"; type: "int" } | |
1767 | Parameter { name: "newX"; type: "double" } |
|
1767 | Parameter { name: "newX"; type: "double" } | |
1768 | Parameter { name: "newY"; type: "double" } |
|
1768 | Parameter { name: "newY"; type: "double" } | |
1769 | } |
|
1769 | } | |
1770 | Method { |
|
1770 | Method { | |
1771 | name: "remove" |
|
1771 | name: "remove" | |
1772 | Parameter { name: "x"; type: "double" } |
|
1772 | Parameter { name: "x"; type: "double" } | |
1773 | Parameter { name: "y"; type: "double" } |
|
1773 | Parameter { name: "y"; type: "double" } | |
1774 | } |
|
1774 | } | |
1775 | Method { |
|
1775 | Method { | |
1776 | name: "remove" |
|
1776 | name: "remove" | |
1777 | revision: 3 |
|
1777 | revision: 3 | |
1778 | Parameter { name: "index"; type: "int" } |
|
1778 | Parameter { name: "index"; type: "int" } | |
1779 | } |
|
1779 | } | |
1780 | Method { |
|
1780 | Method { | |
1781 | name: "removePoints" |
|
1781 | name: "removePoints" | |
1782 | revision: 5 |
|
1782 | revision: 5 | |
1783 | Parameter { name: "index"; type: "int" } |
|
1783 | Parameter { name: "index"; type: "int" } | |
1784 | Parameter { name: "count"; type: "int" } |
|
1784 | Parameter { name: "count"; type: "int" } | |
1785 | } |
|
1785 | } | |
1786 | Method { |
|
1786 | Method { | |
1787 | name: "insert" |
|
1787 | name: "insert" | |
1788 | Parameter { name: "index"; type: "int" } |
|
1788 | Parameter { name: "index"; type: "int" } | |
1789 | Parameter { name: "x"; type: "double" } |
|
1789 | Parameter { name: "x"; type: "double" } | |
1790 | Parameter { name: "y"; type: "double" } |
|
1790 | Parameter { name: "y"; type: "double" } | |
1791 | } |
|
1791 | } | |
1792 | Method { name: "clear" } |
|
1792 | Method { name: "clear" } | |
1793 | Method { |
|
1793 | Method { | |
1794 | name: "at" |
|
1794 | name: "at" | |
1795 | type: "QPointF" |
|
1795 | type: "QPointF" | |
1796 | Parameter { name: "index"; type: "int" } |
|
1796 | Parameter { name: "index"; type: "int" } | |
1797 | } |
|
1797 | } | |
1798 | } |
|
1798 | } | |
1799 | Component { |
|
1799 | Component { | |
1800 | name: "QtCharts::DeclarativeSplineSeries" |
|
1800 | name: "QtCharts::DeclarativeSplineSeries" | |
1801 | defaultProperty: "declarativeChildren" |
|
1801 | defaultProperty: "declarativeChildren" | |
1802 | prototype: "QtCharts::QSplineSeries" |
|
1802 | prototype: "QtCharts::QSplineSeries" | |
1803 | exports: [ |
|
1803 | exports: [ | |
1804 | "QtCharts/SplineSeries 1.0", |
|
1804 | "QtCharts/SplineSeries 1.0", | |
1805 | "QtCharts/SplineSeries 1.1", |
|
1805 | "QtCharts/SplineSeries 1.1", | |
1806 | "QtCharts/SplineSeries 1.2", |
|
1806 | "QtCharts/SplineSeries 1.2", | |
1807 | "QtCharts/SplineSeries 1.3", |
|
1807 | "QtCharts/SplineSeries 1.3", | |
1808 | "QtCharts/SplineSeries 2.0", |
|
1808 | "QtCharts/SplineSeries 2.0", | |
1809 | "QtCharts/SplineSeries 2.1" |
|
1809 | "QtCharts/SplineSeries 2.1" | |
1810 | ] |
|
1810 | ] | |
1811 | exportMetaObjectRevisions: [0, 1, 2, 3, 3, 4] |
|
1811 | exportMetaObjectRevisions: [0, 1, 2, 3, 3, 4] | |
1812 | Property { name: "count"; type: "int"; isReadonly: true } |
|
1812 | Property { name: "count"; type: "int"; isReadonly: true } | |
1813 | Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true } |
|
1813 | Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true } | |
1814 | Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true } |
|
1814 | Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true } | |
1815 | Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true } |
|
1815 | Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true } | |
1816 | Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true } |
|
1816 | Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true } | |
1817 | Property { name: "axisAngular"; revision: 3; type: "QAbstractAxis"; isPointer: true } |
|
1817 | Property { name: "axisAngular"; revision: 3; type: "QAbstractAxis"; isPointer: true } | |
1818 | Property { name: "axisRadial"; revision: 3; type: "QAbstractAxis"; isPointer: true } |
|
1818 | Property { name: "axisRadial"; revision: 3; type: "QAbstractAxis"; isPointer: true } | |
1819 | Property { name: "width"; revision: 1; type: "double" } |
|
1819 | Property { name: "width"; revision: 1; type: "double" } | |
1820 | Property { name: "style"; revision: 1; type: "Qt::PenStyle" } |
|
1820 | Property { name: "style"; revision: 1; type: "Qt::PenStyle" } | |
1821 | Property { name: "capStyle"; revision: 1; type: "Qt::PenCapStyle" } |
|
1821 | Property { name: "capStyle"; revision: 1; type: "Qt::PenCapStyle" } | |
1822 | Property { name: "declarativeChildren"; type: "QObject"; isList: true; isReadonly: true } |
|
1822 | Property { name: "declarativeChildren"; type: "QObject"; isList: true; isReadonly: true } | |
1823 | Signal { |
|
1823 | Signal { | |
1824 | name: "countChanged" |
|
1824 | name: "countChanged" | |
1825 | Parameter { name: "count"; type: "int" } |
|
1825 | Parameter { name: "count"; type: "int" } | |
1826 | } |
|
1826 | } | |
1827 | Signal { |
|
1827 | Signal { | |
1828 | name: "axisXChanged" |
|
1828 | name: "axisXChanged" | |
1829 | revision: 1 |
|
1829 | revision: 1 | |
1830 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1830 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1831 | } |
|
1831 | } | |
1832 | Signal { |
|
1832 | Signal { | |
1833 | name: "axisYChanged" |
|
1833 | name: "axisYChanged" | |
1834 | revision: 1 |
|
1834 | revision: 1 | |
1835 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1835 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1836 | } |
|
1836 | } | |
1837 | Signal { |
|
1837 | Signal { | |
1838 | name: "axisXTopChanged" |
|
1838 | name: "axisXTopChanged" | |
1839 | revision: 2 |
|
1839 | revision: 2 | |
1840 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1840 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1841 | } |
|
1841 | } | |
1842 | Signal { |
|
1842 | Signal { | |
1843 | name: "axisYRightChanged" |
|
1843 | name: "axisYRightChanged" | |
1844 | revision: 2 |
|
1844 | revision: 2 | |
1845 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1845 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1846 | } |
|
1846 | } | |
1847 | Signal { |
|
1847 | Signal { | |
1848 | name: "axisAngularChanged" |
|
1848 | name: "axisAngularChanged" | |
1849 | revision: 3 |
|
1849 | revision: 3 | |
1850 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1850 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1851 | } |
|
1851 | } | |
1852 | Signal { |
|
1852 | Signal { | |
1853 | name: "axisRadialChanged" |
|
1853 | name: "axisRadialChanged" | |
1854 | revision: 3 |
|
1854 | revision: 3 | |
1855 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1855 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1856 | } |
|
1856 | } | |
1857 | Signal { |
|
1857 | Signal { | |
1858 | name: "widthChanged" |
|
1858 | name: "widthChanged" | |
1859 | revision: 1 |
|
1859 | revision: 1 | |
1860 | Parameter { name: "width"; type: "double" } |
|
1860 | Parameter { name: "width"; type: "double" } | |
1861 | } |
|
1861 | } | |
1862 | Signal { |
|
1862 | Signal { | |
1863 | name: "styleChanged" |
|
1863 | name: "styleChanged" | |
1864 | revision: 1 |
|
1864 | revision: 1 | |
1865 | Parameter { name: "style"; type: "Qt::PenStyle" } |
|
1865 | Parameter { name: "style"; type: "Qt::PenStyle" } | |
1866 | } |
|
1866 | } | |
1867 | Signal { |
|
1867 | Signal { | |
1868 | name: "capStyleChanged" |
|
1868 | name: "capStyleChanged" | |
1869 | revision: 1 |
|
1869 | revision: 1 | |
1870 | Parameter { name: "capStyle"; type: "Qt::PenCapStyle" } |
|
1870 | Parameter { name: "capStyle"; type: "Qt::PenCapStyle" } | |
1871 | } |
|
1871 | } | |
1872 | Method { |
|
1872 | Method { | |
1873 | name: "appendDeclarativeChildren" |
|
1873 | name: "appendDeclarativeChildren" | |
1874 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } |
|
1874 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } | |
1875 | Parameter { name: "element"; type: "QObject"; isPointer: true } |
|
1875 | Parameter { name: "element"; type: "QObject"; isPointer: true } | |
1876 | } |
|
1876 | } | |
1877 | Method { |
|
1877 | Method { | |
1878 | name: "handleCountChanged" |
|
1878 | name: "handleCountChanged" | |
1879 | Parameter { name: "index"; type: "int" } |
|
1879 | Parameter { name: "index"; type: "int" } | |
1880 | } |
|
1880 | } | |
1881 | Method { |
|
1881 | Method { | |
1882 | name: "append" |
|
1882 | name: "append" | |
1883 | Parameter { name: "x"; type: "double" } |
|
1883 | Parameter { name: "x"; type: "double" } | |
1884 | Parameter { name: "y"; type: "double" } |
|
1884 | Parameter { name: "y"; type: "double" } | |
1885 | } |
|
1885 | } | |
1886 | Method { |
|
1886 | Method { | |
1887 | name: "replace" |
|
1887 | name: "replace" | |
1888 | Parameter { name: "oldX"; type: "double" } |
|
1888 | Parameter { name: "oldX"; type: "double" } | |
1889 | Parameter { name: "oldY"; type: "double" } |
|
1889 | Parameter { name: "oldY"; type: "double" } | |
1890 | Parameter { name: "newX"; type: "double" } |
|
1890 | Parameter { name: "newX"; type: "double" } | |
1891 | Parameter { name: "newY"; type: "double" } |
|
1891 | Parameter { name: "newY"; type: "double" } | |
1892 | } |
|
1892 | } | |
1893 | Method { |
|
1893 | Method { | |
1894 | name: "replace" |
|
1894 | name: "replace" | |
1895 | revision: 3 |
|
1895 | revision: 3 | |
1896 | Parameter { name: "index"; type: "int" } |
|
1896 | Parameter { name: "index"; type: "int" } | |
1897 | Parameter { name: "newX"; type: "double" } |
|
1897 | Parameter { name: "newX"; type: "double" } | |
1898 | Parameter { name: "newY"; type: "double" } |
|
1898 | Parameter { name: "newY"; type: "double" } | |
1899 | } |
|
1899 | } | |
1900 | Method { |
|
1900 | Method { | |
1901 | name: "remove" |
|
1901 | name: "remove" | |
1902 | Parameter { name: "x"; type: "double" } |
|
1902 | Parameter { name: "x"; type: "double" } | |
1903 | Parameter { name: "y"; type: "double" } |
|
1903 | Parameter { name: "y"; type: "double" } | |
1904 | } |
|
1904 | } | |
1905 | Method { |
|
1905 | Method { | |
1906 | name: "remove" |
|
1906 | name: "remove" | |
1907 | revision: 3 |
|
1907 | revision: 3 | |
1908 | Parameter { name: "index"; type: "int" } |
|
1908 | Parameter { name: "index"; type: "int" } | |
1909 | } |
|
1909 | } | |
1910 | Method { |
|
1910 | Method { | |
1911 | name: "removePoints" |
|
1911 | name: "removePoints" | |
1912 | revision: 4 |
|
1912 | revision: 4 | |
1913 | Parameter { name: "index"; type: "int" } |
|
1913 | Parameter { name: "index"; type: "int" } | |
1914 | Parameter { name: "count"; type: "int" } |
|
1914 | Parameter { name: "count"; type: "int" } | |
1915 | } |
|
1915 | } | |
1916 | Method { |
|
1916 | Method { | |
1917 | name: "insert" |
|
1917 | name: "insert" | |
1918 | Parameter { name: "index"; type: "int" } |
|
1918 | Parameter { name: "index"; type: "int" } | |
1919 | Parameter { name: "x"; type: "double" } |
|
1919 | Parameter { name: "x"; type: "double" } | |
1920 | Parameter { name: "y"; type: "double" } |
|
1920 | Parameter { name: "y"; type: "double" } | |
1921 | } |
|
1921 | } | |
1922 | Method { name: "clear" } |
|
1922 | Method { name: "clear" } | |
1923 | Method { |
|
1923 | Method { | |
1924 | name: "at" |
|
1924 | name: "at" | |
1925 | type: "QPointF" |
|
1925 | type: "QPointF" | |
1926 | Parameter { name: "index"; type: "int" } |
|
1926 | Parameter { name: "index"; type: "int" } | |
1927 | } |
|
1927 | } | |
1928 | } |
|
1928 | } | |
1929 | Component { |
|
1929 | Component { | |
1930 | name: "QtCharts::DeclarativeStackedBarSeries" |
|
1930 | name: "QtCharts::DeclarativeStackedBarSeries" | |
1931 | defaultProperty: "seriesChildren" |
|
1931 | defaultProperty: "seriesChildren" | |
1932 | prototype: "QtCharts::QStackedBarSeries" |
|
1932 | prototype: "QtCharts::QStackedBarSeries" | |
1933 | exports: [ |
|
1933 | exports: [ | |
1934 | "QtCharts/StackedBarSeries 1.0", |
|
1934 | "QtCharts/StackedBarSeries 1.0", | |
1935 | "QtCharts/StackedBarSeries 1.1", |
|
1935 | "QtCharts/StackedBarSeries 1.1", | |
1936 | "QtCharts/StackedBarSeries 1.2", |
|
1936 | "QtCharts/StackedBarSeries 1.2", | |
1937 | "QtCharts/StackedBarSeries 2.0" |
|
1937 | "QtCharts/StackedBarSeries 2.0" | |
1938 | ] |
|
1938 | ] | |
1939 | exportMetaObjectRevisions: [0, 1, 2, 2] |
|
1939 | exportMetaObjectRevisions: [0, 1, 2, 2] | |
1940 | Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true } |
|
1940 | Property { name: "axisX"; revision: 1; type: "QAbstractAxis"; isPointer: true } | |
1941 | Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true } |
|
1941 | Property { name: "axisY"; revision: 1; type: "QAbstractAxis"; isPointer: true } | |
1942 | Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true } |
|
1942 | Property { name: "axisXTop"; revision: 2; type: "QAbstractAxis"; isPointer: true } | |
1943 | Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true } |
|
1943 | Property { name: "axisYRight"; revision: 2; type: "QAbstractAxis"; isPointer: true } | |
1944 | Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true } |
|
1944 | Property { name: "seriesChildren"; type: "QObject"; isList: true; isReadonly: true } | |
1945 | Signal { |
|
1945 | Signal { | |
1946 | name: "axisXChanged" |
|
1946 | name: "axisXChanged" | |
1947 | revision: 1 |
|
1947 | revision: 1 | |
1948 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1948 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1949 | } |
|
1949 | } | |
1950 | Signal { |
|
1950 | Signal { | |
1951 | name: "axisYChanged" |
|
1951 | name: "axisYChanged" | |
1952 | revision: 1 |
|
1952 | revision: 1 | |
1953 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1953 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1954 | } |
|
1954 | } | |
1955 | Signal { |
|
1955 | Signal { | |
1956 | name: "axisXTopChanged" |
|
1956 | name: "axisXTopChanged" | |
1957 | revision: 2 |
|
1957 | revision: 2 | |
1958 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1958 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1959 | } |
|
1959 | } | |
1960 | Signal { |
|
1960 | Signal { | |
1961 | name: "axisYRightChanged" |
|
1961 | name: "axisYRightChanged" | |
1962 | revision: 2 |
|
1962 | revision: 2 | |
1963 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } |
|
1963 | Parameter { name: "axis"; type: "QAbstractAxis"; isPointer: true } | |
1964 | } |
|
1964 | } | |
1965 | Method { |
|
1965 | Method { | |
1966 | name: "appendSeriesChildren" |
|
1966 | name: "appendSeriesChildren" | |
1967 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } |
|
1967 | Parameter { name: "list"; type: "QObject"; isList: true; isPointer: true } | |
1968 | Parameter { name: "element"; type: "QObject"; isPointer: true } |
|
1968 | Parameter { name: "element"; type: "QObject"; isPointer: true } | |
1969 | } |
|
1969 | } | |
1970 | Method { |
|
1970 | Method { | |
1971 | name: "at" |
|
1971 | name: "at" | |
1972 | type: "DeclarativeBarSet*" |
|
1972 | type: "DeclarativeBarSet*" | |
1973 | Parameter { name: "index"; type: "int" } |
|
1973 | Parameter { name: "index"; type: "int" } | |
1974 | } |
|
1974 | } | |
1975 | Method { |
|
1975 | Method { | |
1976 | name: "append" |
|
1976 | name: "append" | |
1977 | type: "DeclarativeBarSet*" |
|
1977 | type: "DeclarativeBarSet*" | |
1978 | Parameter { name: "label"; type: "string" } |
|
1978 | Parameter { name: "label"; type: "string" } | |
1979 | Parameter { name: "values"; type: "QVariantList" } |
|
1979 | Parameter { name: "values"; type: "QVariantList" } | |
1980 | } |
|
1980 | } | |
1981 | Method { |
|
1981 | Method { | |
1982 | name: "insert" |
|
1982 | name: "insert" | |
1983 | type: "DeclarativeBarSet*" |
|
1983 | type: "DeclarativeBarSet*" | |
1984 | Parameter { name: "index"; type: "int" } |
|
1984 | Parameter { name: "index"; type: "int" } | |
1985 | Parameter { name: "label"; type: "string" } |
|
1985 | Parameter { name: "label"; type: "string" } | |
1986 | Parameter { name: "values"; type: "QVariantList" } |
|
1986 | Parameter { name: "values"; type: "QVariantList" } | |
1987 | } |
|
1987 | } | |
1988 | Method { |
|
1988 | Method { | |
1989 | name: "remove" |
|
1989 | name: "remove" | |
1990 | type: "bool" |
|
1990 | type: "bool" | |
1991 | Parameter { name: "barset"; type: "QBarSet"; isPointer: true } |
|
1991 | Parameter { name: "barset"; type: "QBarSet"; isPointer: true } | |
1992 | } |
|
1992 | } | |
1993 | Method { name: "clear" } |
|
1993 | Method { name: "clear" } | |
1994 | } |
|
1994 | } | |
1995 | Component { |
|
1995 | Component { | |
1996 | name: "QtCharts::DeclarativeXYPoint" |
|
1996 | name: "QtCharts::DeclarativeXYPoint" | |
1997 | prototype: "QObject" |
|
1997 | prototype: "QObject" | |
1998 | exports: ["QtCharts/XYPoint 1.0", "QtCharts/XYPoint 2.0"] |
|
1998 | exports: ["QtCharts/XYPoint 1.0", "QtCharts/XYPoint 2.0"] | |
1999 | exportMetaObjectRevisions: [0, 0] |
|
1999 | exportMetaObjectRevisions: [0, 0] | |
2000 | Property { name: "x"; type: "double" } |
|
2000 | Property { name: "x"; type: "double" } | |
2001 | Property { name: "y"; type: "double" } |
|
2001 | Property { name: "y"; type: "double" } | |
2002 | } |
|
2002 | } | |
2003 | Component { |
|
2003 | Component { | |
2004 | name: "QtCharts::LegendScroller" |
|
2004 | name: "QtCharts::LegendScroller" | |
2005 | defaultProperty: "children" |
|
2005 | defaultProperty: "children" | |
2006 | prototype: "QtCharts::QLegend" |
|
2006 | prototype: "QtCharts::QLegend" | |
2007 | } |
|
2007 | } | |
2008 | Component { |
|
2008 | Component { | |
2009 | name: "QtCharts::QAbstractAxis" |
|
2009 | name: "QtCharts::QAbstractAxis" | |
2010 | prototype: "QObject" |
|
2010 | prototype: "QObject" | |
2011 | exports: [ |
|
2011 | exports: [ | |
2012 | "QtCharts/AbstractAxis 1.0", |
|
2012 | "QtCharts/AbstractAxis 1.0", | |
2013 | "QtCharts/AbstractAxis 2.0", |
|
2013 | "QtCharts/AbstractAxis 2.0", | |
2014 | "QtCharts/AbstractAxis 2.1" |
|
2014 | "QtCharts/AbstractAxis 2.1" | |
2015 | ] |
|
2015 | ] | |
2016 | isCreatable: false |
|
2016 | isCreatable: false | |
2017 | exportMetaObjectRevisions: [0, 0, 0] |
|
2017 | exportMetaObjectRevisions: [0, 0, 0] | |
2018 | Property { name: "visible"; type: "bool" } |
|
2018 | Property { name: "visible"; type: "bool" } | |
2019 | Property { name: "lineVisible"; type: "bool" } |
|
2019 | Property { name: "lineVisible"; type: "bool" } | |
2020 | Property { name: "linePen"; type: "QPen" } |
|
2020 | Property { name: "linePen"; type: "QPen" } | |
2021 | Property { name: "color"; type: "QColor" } |
|
2021 | Property { name: "color"; type: "QColor" } | |
2022 | Property { name: "labelsVisible"; type: "bool" } |
|
2022 | Property { name: "labelsVisible"; type: "bool" } | |
2023 | Property { name: "labelsBrush"; type: "QBrush" } |
|
2023 | Property { name: "labelsBrush"; type: "QBrush" } | |
2024 | Property { name: "labelsAngle"; type: "int" } |
|
2024 | Property { name: "labelsAngle"; type: "int" } | |
2025 | Property { name: "labelsFont"; type: "QFont" } |
|
2025 | Property { name: "labelsFont"; type: "QFont" } | |
2026 | Property { name: "labelsColor"; type: "QColor" } |
|
2026 | Property { name: "labelsColor"; type: "QColor" } | |
2027 | Property { name: "gridVisible"; type: "bool" } |
|
2027 | Property { name: "gridVisible"; type: "bool" } | |
2028 | Property { name: "gridLinePen"; type: "QPen" } |
|
2028 | Property { name: "gridLinePen"; type: "QPen" } | |
2029 | Property { name: "minorGridVisible"; type: "bool" } |
|
2029 | Property { name: "minorGridVisible"; type: "bool" } | |
2030 | Property { name: "minorGridLinePen"; type: "QPen" } |
|
2030 | Property { name: "minorGridLinePen"; type: "QPen" } | |
2031 | Property { name: "gridLineColor"; type: "QColor" } |
|
2031 | Property { name: "gridLineColor"; type: "QColor" } | |
2032 | Property { name: "minorGridLineColor"; type: "QColor" } |
|
2032 | Property { name: "minorGridLineColor"; type: "QColor" } | |
2033 | Property { name: "shadesVisible"; type: "bool" } |
|
2033 | Property { name: "shadesVisible"; type: "bool" } | |
2034 | Property { name: "shadesColor"; type: "QColor" } |
|
2034 | Property { name: "shadesColor"; type: "QColor" } | |
2035 | Property { name: "shadesBorderColor"; type: "QColor" } |
|
2035 | Property { name: "shadesBorderColor"; type: "QColor" } | |
2036 | Property { name: "shadesPen"; type: "QPen" } |
|
2036 | Property { name: "shadesPen"; type: "QPen" } | |
2037 | Property { name: "shadesBrush"; type: "QBrush" } |
|
2037 | Property { name: "shadesBrush"; type: "QBrush" } | |
2038 | Property { name: "titleText"; type: "string" } |
|
2038 | Property { name: "titleText"; type: "string" } | |
2039 | Property { name: "titleBrush"; type: "QBrush" } |
|
2039 | Property { name: "titleBrush"; type: "QBrush" } | |
2040 | Property { name: "titleVisible"; type: "bool" } |
|
2040 | Property { name: "titleVisible"; type: "bool" } | |
2041 | Property { name: "titleFont"; type: "QFont" } |
|
2041 | Property { name: "titleFont"; type: "QFont" } | |
2042 | Property { name: "orientation"; type: "Qt::Orientation"; isReadonly: true } |
|
2042 | Property { name: "orientation"; type: "Qt::Orientation"; isReadonly: true } | |
2043 | Property { name: "alignment"; type: "Qt::Alignment"; isReadonly: true } |
|
2043 | Property { name: "alignment"; type: "Qt::Alignment"; isReadonly: true } | |
2044 | Property { name: "reverse"; type: "bool" } |
|
2044 | Property { name: "reverse"; type: "bool" } | |
2045 | Signal { |
|
2045 | Signal { | |
2046 | name: "visibleChanged" |
|
2046 | name: "visibleChanged" | |
2047 | Parameter { name: "visible"; type: "bool" } |
|
2047 | Parameter { name: "visible"; type: "bool" } | |
2048 | } |
|
2048 | } | |
2049 | Signal { |
|
2049 | Signal { | |
2050 | name: "linePenChanged" |
|
2050 | name: "linePenChanged" | |
2051 | Parameter { name: "pen"; type: "QPen" } |
|
2051 | Parameter { name: "pen"; type: "QPen" } | |
2052 | } |
|
2052 | } | |
2053 | Signal { |
|
2053 | Signal { | |
2054 | name: "lineVisibleChanged" |
|
2054 | name: "lineVisibleChanged" | |
2055 | Parameter { name: "visible"; type: "bool" } |
|
2055 | Parameter { name: "visible"; type: "bool" } | |
2056 | } |
|
2056 | } | |
2057 | Signal { |
|
2057 | Signal { | |
2058 | name: "labelsVisibleChanged" |
|
2058 | name: "labelsVisibleChanged" | |
2059 | Parameter { name: "visible"; type: "bool" } |
|
2059 | Parameter { name: "visible"; type: "bool" } | |
2060 | } |
|
2060 | } | |
2061 | Signal { |
|
2061 | Signal { | |
2062 | name: "labelsBrushChanged" |
|
2062 | name: "labelsBrushChanged" | |
2063 | Parameter { name: "brush"; type: "QBrush" } |
|
2063 | Parameter { name: "brush"; type: "QBrush" } | |
2064 | } |
|
2064 | } | |
2065 | Signal { |
|
2065 | Signal { | |
2066 | name: "labelsFontChanged" |
|
2066 | name: "labelsFontChanged" | |
2067 | Parameter { name: "pen"; type: "QFont" } |
|
2067 | Parameter { name: "pen"; type: "QFont" } | |
2068 | } |
|
2068 | } | |
2069 | Signal { |
|
2069 | Signal { | |
2070 | name: "labelsAngleChanged" |
|
2070 | name: "labelsAngleChanged" | |
2071 | Parameter { name: "angle"; type: "int" } |
|
2071 | Parameter { name: "angle"; type: "int" } | |
2072 | } |
|
2072 | } | |
2073 | Signal { |
|
2073 | Signal { | |
2074 | name: "gridLinePenChanged" |
|
2074 | name: "gridLinePenChanged" | |
2075 | Parameter { name: "pen"; type: "QPen" } |
|
2075 | Parameter { name: "pen"; type: "QPen" } | |
2076 | } |
|
2076 | } | |
2077 | Signal { |
|
2077 | Signal { | |
2078 | name: "gridVisibleChanged" |
|
2078 | name: "gridVisibleChanged" | |
2079 | Parameter { name: "visible"; type: "bool" } |
|
2079 | Parameter { name: "visible"; type: "bool" } | |
2080 | } |
|
2080 | } | |
2081 | Signal { |
|
2081 | Signal { | |
2082 | name: "minorGridVisibleChanged" |
|
2082 | name: "minorGridVisibleChanged" | |
2083 | Parameter { name: "visible"; type: "bool" } |
|
2083 | Parameter { name: "visible"; type: "bool" } | |
2084 | } |
|
2084 | } | |
2085 | Signal { |
|
2085 | Signal { | |
2086 | name: "minorGridLinePenChanged" |
|
2086 | name: "minorGridLinePenChanged" | |
2087 | Parameter { name: "pen"; type: "QPen" } |
|
2087 | Parameter { name: "pen"; type: "QPen" } | |
2088 | } |
|
2088 | } | |
2089 | Signal { |
|
2089 | Signal { | |
2090 | name: "gridLineColorChanged" |
|
2090 | name: "gridLineColorChanged" | |
2091 | Parameter { name: "color"; type: "QColor" } |
|
2091 | Parameter { name: "color"; type: "QColor" } | |
2092 | } |
|
2092 | } | |
2093 | Signal { |
|
2093 | Signal { | |
2094 | name: "minorGridLineColorChanged" |
|
2094 | name: "minorGridLineColorChanged" | |
2095 | Parameter { name: "color"; type: "QColor" } |
|
2095 | Parameter { name: "color"; type: "QColor" } | |
2096 | } |
|
2096 | } | |
2097 | Signal { |
|
2097 | Signal { | |
2098 | name: "colorChanged" |
|
2098 | name: "colorChanged" | |
2099 | Parameter { name: "color"; type: "QColor" } |
|
2099 | Parameter { name: "color"; type: "QColor" } | |
2100 | } |
|
2100 | } | |
2101 | Signal { |
|
2101 | Signal { | |
2102 | name: "labelsColorChanged" |
|
2102 | name: "labelsColorChanged" | |
2103 | Parameter { name: "color"; type: "QColor" } |
|
2103 | Parameter { name: "color"; type: "QColor" } | |
2104 | } |
|
2104 | } | |
2105 | Signal { |
|
2105 | Signal { | |
2106 | name: "titleTextChanged" |
|
2106 | name: "titleTextChanged" | |
2107 | Parameter { name: "title"; type: "string" } |
|
2107 | Parameter { name: "title"; type: "string" } | |
2108 | } |
|
2108 | } | |
2109 | Signal { |
|
2109 | Signal { | |
2110 | name: "titleBrushChanged" |
|
2110 | name: "titleBrushChanged" | |
2111 | Parameter { name: "brush"; type: "QBrush" } |
|
2111 | Parameter { name: "brush"; type: "QBrush" } | |
2112 | } |
|
2112 | } | |
2113 | Signal { |
|
2113 | Signal { | |
2114 | name: "titleVisibleChanged" |
|
2114 | name: "titleVisibleChanged" | |
2115 | Parameter { name: "visible"; type: "bool" } |
|
2115 | Parameter { name: "visible"; type: "bool" } | |
2116 | } |
|
2116 | } | |
2117 | Signal { |
|
2117 | Signal { | |
2118 | name: "titleFontChanged" |
|
2118 | name: "titleFontChanged" | |
2119 | Parameter { name: "font"; type: "QFont" } |
|
2119 | Parameter { name: "font"; type: "QFont" } | |
2120 | } |
|
2120 | } | |
2121 | Signal { |
|
2121 | Signal { | |
2122 | name: "shadesVisibleChanged" |
|
2122 | name: "shadesVisibleChanged" | |
2123 | Parameter { name: "visible"; type: "bool" } |
|
2123 | Parameter { name: "visible"; type: "bool" } | |
2124 | } |
|
2124 | } | |
2125 | Signal { |
|
2125 | Signal { | |
2126 | name: "shadesColorChanged" |
|
2126 | name: "shadesColorChanged" | |
2127 | Parameter { name: "color"; type: "QColor" } |
|
2127 | Parameter { name: "color"; type: "QColor" } | |
2128 | } |
|
2128 | } | |
2129 | Signal { |
|
2129 | Signal { | |
2130 | name: "shadesBorderColorChanged" |
|
2130 | name: "shadesBorderColorChanged" | |
2131 | Parameter { name: "color"; type: "QColor" } |
|
2131 | Parameter { name: "color"; type: "QColor" } | |
2132 | } |
|
2132 | } | |
2133 | Signal { |
|
2133 | Signal { | |
2134 | name: "shadesPenChanged" |
|
2134 | name: "shadesPenChanged" | |
2135 | Parameter { name: "pen"; type: "QPen" } |
|
2135 | Parameter { name: "pen"; type: "QPen" } | |
2136 | } |
|
2136 | } | |
2137 | Signal { |
|
2137 | Signal { | |
2138 | name: "shadesBrushChanged" |
|
2138 | name: "shadesBrushChanged" | |
2139 | Parameter { name: "brush"; type: "QBrush" } |
|
2139 | Parameter { name: "brush"; type: "QBrush" } | |
2140 | } |
|
2140 | } | |
2141 | Signal { |
|
2141 | Signal { | |
2142 | name: "reverseChanged" |
|
2142 | name: "reverseChanged" | |
2143 | Parameter { name: "reverse"; type: "bool" } |
|
2143 | Parameter { name: "reverse"; type: "bool" } | |
2144 | } |
|
2144 | } | |
2145 | } |
|
2145 | } | |
2146 | Component { |
|
2146 | Component { | |
2147 | name: "QtCharts::QAbstractBarSeries" |
|
2147 | name: "QtCharts::QAbstractBarSeries" | |
2148 | prototype: "QtCharts::QAbstractSeries" |
|
2148 | prototype: "QtCharts::QAbstractSeries" | |
2149 | exports: [ |
|
2149 | exports: [ | |
2150 | "QtCharts/AbstractBarSeries 1.0", |
|
2150 | "QtCharts/AbstractBarSeries 1.0", | |
2151 | "QtCharts/AbstractBarSeries 2.0" |
|
2151 | "QtCharts/AbstractBarSeries 2.0" | |
2152 | ] |
|
2152 | ] | |
2153 | isCreatable: false |
|
2153 | isCreatable: false | |
2154 | exportMetaObjectRevisions: [0, 0] |
|
2154 | exportMetaObjectRevisions: [0, 0] | |
2155 | Enum { |
|
2155 | Enum { | |
2156 | name: "LabelsPosition" |
|
2156 | name: "LabelsPosition" | |
2157 | values: { |
|
2157 | values: { | |
2158 | "LabelsCenter": 0, |
|
2158 | "LabelsCenter": 0, | |
2159 | "LabelsInsideEnd": 1, |
|
2159 | "LabelsInsideEnd": 1, | |
2160 | "LabelsInsideBase": 2, |
|
2160 | "LabelsInsideBase": 2, | |
2161 | "LabelsOutsideEnd": 3 |
|
2161 | "LabelsOutsideEnd": 3 | |
2162 | } |
|
2162 | } | |
2163 | } |
|
2163 | } | |
2164 | Property { name: "barWidth"; type: "double" } |
|
2164 | Property { name: "barWidth"; type: "double" } | |
2165 | Property { name: "count"; type: "int"; isReadonly: true } |
|
2165 | Property { name: "count"; type: "int"; isReadonly: true } | |
2166 | Property { name: "labelsVisible"; type: "bool" } |
|
2166 | Property { name: "labelsVisible"; type: "bool" } | |
2167 | Property { name: "labelsFormat"; type: "string" } |
|
2167 | Property { name: "labelsFormat"; type: "string" } | |
2168 | Property { name: "labelsPosition"; type: "LabelsPosition" } |
|
2168 | Property { name: "labelsPosition"; type: "LabelsPosition" } | |
2169 | Property { name: "labelsAngle"; type: "double" } |
|
2169 | Property { name: "labelsAngle"; type: "double" } | |
2170 | Signal { |
|
2170 | Signal { | |
2171 | name: "clicked" |
|
2171 | name: "clicked" | |
2172 | Parameter { name: "index"; type: "int" } |
|
2172 | Parameter { name: "index"; type: "int" } | |
2173 | Parameter { name: "barset"; type: "QBarSet"; isPointer: true } |
|
2173 | Parameter { name: "barset"; type: "QBarSet"; isPointer: true } | |
2174 | } |
|
2174 | } | |
2175 | Signal { |
|
2175 | Signal { | |
2176 | name: "hovered" |
|
2176 | name: "hovered" | |
2177 | Parameter { name: "status"; type: "bool" } |
|
2177 | Parameter { name: "status"; type: "bool" } | |
2178 | Parameter { name: "index"; type: "int" } |
|
2178 | Parameter { name: "index"; type: "int" } | |
2179 | Parameter { name: "barset"; type: "QBarSet"; isPointer: true } |
|
2179 | Parameter { name: "barset"; type: "QBarSet"; isPointer: true } | |
2180 | } |
|
2180 | } | |
2181 | Signal { |
|
2181 | Signal { | |
2182 | name: "pressed" |
|
2182 | name: "pressed" | |
2183 | Parameter { name: "index"; type: "int" } |
|
2183 | Parameter { name: "index"; type: "int" } | |
2184 | Parameter { name: "barset"; type: "QBarSet"; isPointer: true } |
|
2184 | Parameter { name: "barset"; type: "QBarSet"; isPointer: true } | |
2185 | } |
|
2185 | } | |
2186 | Signal { |
|
2186 | Signal { | |
2187 | name: "released" |
|
2187 | name: "released" | |
2188 | Parameter { name: "index"; type: "int" } |
|
2188 | Parameter { name: "index"; type: "int" } | |
2189 | Parameter { name: "barset"; type: "QBarSet"; isPointer: true } |
|
2189 | Parameter { name: "barset"; type: "QBarSet"; isPointer: true } | |
2190 | } |
|
2190 | } | |
2191 | Signal { |
|
2191 | Signal { | |
2192 | name: "doubleClicked" |
|
2192 | name: "doubleClicked" | |
2193 | Parameter { name: "index"; type: "int" } |
|
2193 | Parameter { name: "index"; type: "int" } | |
2194 | Parameter { name: "barset"; type: "QBarSet"; isPointer: true } |
|
2194 | Parameter { name: "barset"; type: "QBarSet"; isPointer: true } | |
2195 | } |
|
2195 | } | |
2196 | Signal { |
|
2196 | Signal { | |
2197 | name: "labelsFormatChanged" |
|
2197 | name: "labelsFormatChanged" | |
2198 | Parameter { name: "format"; type: "string" } |
|
2198 | Parameter { name: "format"; type: "string" } | |
2199 | } |
|
2199 | } | |
2200 | Signal { |
|
2200 | Signal { | |
2201 | name: "labelsPositionChanged" |
|
2201 | name: "labelsPositionChanged" | |
2202 | Parameter { name: "position"; type: "QAbstractBarSeries::LabelsPosition" } |
|
2202 | Parameter { name: "position"; type: "QAbstractBarSeries::LabelsPosition" } | |
2203 | } |
|
2203 | } | |
2204 | Signal { |
|
2204 | Signal { | |
2205 | name: "labelsAngleChanged" |
|
2205 | name: "labelsAngleChanged" | |
2206 | Parameter { name: "angle"; type: "double" } |
|
2206 | Parameter { name: "angle"; type: "double" } | |
2207 | } |
|
2207 | } | |
2208 | Signal { |
|
2208 | Signal { | |
2209 | name: "barsetsAdded" |
|
2209 | name: "barsetsAdded" | |
2210 | Parameter { name: "sets"; type: "QList<QBarSet*>" } |
|
2210 | Parameter { name: "sets"; type: "QList<QBarSet*>" } | |
2211 | } |
|
2211 | } | |
2212 | Signal { |
|
2212 | Signal { | |
2213 | name: "barsetsRemoved" |
|
2213 | name: "barsetsRemoved" | |
2214 | Parameter { name: "sets"; type: "QList<QBarSet*>" } |
|
2214 | Parameter { name: "sets"; type: "QList<QBarSet*>" } | |
2215 | } |
|
2215 | } | |
2216 | } |
|
2216 | } | |
2217 | Component { |
|
2217 | Component { | |
2218 | name: "QtCharts::QAbstractSeries" |
|
2218 | name: "QtCharts::QAbstractSeries" | |
2219 | prototype: "QObject" |
|
2219 | prototype: "QObject" | |
2220 | exports: [ |
|
2220 | exports: [ | |
2221 | "QtCharts/AbstractSeries 1.0", |
|
2221 | "QtCharts/AbstractSeries 1.0", | |
2222 | "QtCharts/AbstractSeries 2.0" |
|
2222 | "QtCharts/AbstractSeries 2.0" | |
2223 | ] |
|
2223 | ] | |
2224 | isCreatable: false |
|
2224 | isCreatable: false | |
2225 | exportMetaObjectRevisions: [0, 0] |
|
2225 | exportMetaObjectRevisions: [0, 0] | |
2226 | Enum { |
|
2226 | Enum { | |
2227 | name: "SeriesType" |
|
2227 | name: "SeriesType" | |
2228 | values: { |
|
2228 | values: { | |
2229 | "SeriesTypeLine": 0, |
|
2229 | "SeriesTypeLine": 0, | |
2230 | "SeriesTypeArea": 1, |
|
2230 | "SeriesTypeArea": 1, | |
2231 | "SeriesTypeBar": 2, |
|
2231 | "SeriesTypeBar": 2, | |
2232 | "SeriesTypeStackedBar": 3, |
|
2232 | "SeriesTypeStackedBar": 3, | |
2233 | "SeriesTypePercentBar": 4, |
|
2233 | "SeriesTypePercentBar": 4, | |
2234 | "SeriesTypePie": 5, |
|
2234 | "SeriesTypePie": 5, | |
2235 | "SeriesTypeScatter": 6, |
|
2235 | "SeriesTypeScatter": 6, | |
2236 | "SeriesTypeSpline": 7, |
|
2236 | "SeriesTypeSpline": 7, | |
2237 | "SeriesTypeHorizontalBar": 8, |
|
2237 | "SeriesTypeHorizontalBar": 8, | |
2238 | "SeriesTypeHorizontalStackedBar": 9, |
|
2238 | "SeriesTypeHorizontalStackedBar": 9, | |
2239 | "SeriesTypeHorizontalPercentBar": 10, |
|
2239 | "SeriesTypeHorizontalPercentBar": 10, | |
2240 | "SeriesTypeBoxPlot": 11 |
|
2240 | "SeriesTypeBoxPlot": 11 | |
2241 | } |
|
2241 | } | |
2242 | } |
|
2242 | } | |
2243 | Property { name: "name"; type: "string" } |
|
2243 | Property { name: "name"; type: "string" } | |
2244 | Property { name: "visible"; type: "bool" } |
|
2244 | Property { name: "visible"; type: "bool" } | |
2245 | Property { name: "opacity"; type: "double" } |
|
2245 | Property { name: "opacity"; type: "double" } | |
2246 | Property { name: "type"; type: "SeriesType"; isReadonly: true } |
|
2246 | Property { name: "type"; type: "SeriesType"; isReadonly: true } | |
2247 | } |
|
2247 | } | |
2248 | Component { |
|
2248 | Component { | |
2249 | name: "QtCharts::QAreaSeries" |
|
2249 | name: "QtCharts::QAreaSeries" | |
2250 | prototype: "QtCharts::QAbstractSeries" |
|
2250 | prototype: "QtCharts::QAbstractSeries" | |
2251 | Property { name: "upperSeries"; type: "QLineSeries"; isReadonly: true; isPointer: true } |
|
2251 | Property { name: "upperSeries"; type: "QLineSeries"; isReadonly: true; isPointer: true } | |
2252 | Property { name: "lowerSeries"; type: "QLineSeries"; isReadonly: true; isPointer: true } |
|
2252 | Property { name: "lowerSeries"; type: "QLineSeries"; isReadonly: true; isPointer: true } | |
2253 | Property { name: "color"; type: "QColor" } |
|
2253 | Property { name: "color"; type: "QColor" } | |
2254 | Property { name: "borderColor"; type: "QColor" } |
|
2254 | Property { name: "borderColor"; type: "QColor" } | |
2255 | Property { name: "pointLabelsFormat"; type: "string" } |
|
2255 | Property { name: "pointLabelsFormat"; type: "string" } | |
2256 | Property { name: "pointLabelsVisible"; type: "bool" } |
|
2256 | Property { name: "pointLabelsVisible"; type: "bool" } | |
2257 | Property { name: "pointLabelsFont"; type: "QFont" } |
|
2257 | Property { name: "pointLabelsFont"; type: "QFont" } | |
2258 | Property { name: "pointLabelsColor"; type: "QColor" } |
|
2258 | Property { name: "pointLabelsColor"; type: "QColor" } | |
|
2259 | Property { name: "pointLabelsClipping"; type: "bool" } | |||
2259 | Signal { |
|
2260 | Signal { | |
2260 | name: "clicked" |
|
2261 | name: "clicked" | |
2261 | Parameter { name: "point"; type: "QPointF" } |
|
2262 | Parameter { name: "point"; type: "QPointF" } | |
2262 | } |
|
2263 | } | |
2263 | Signal { |
|
2264 | Signal { | |
2264 | name: "hovered" |
|
2265 | name: "hovered" | |
2265 | Parameter { name: "point"; type: "QPointF" } |
|
2266 | Parameter { name: "point"; type: "QPointF" } | |
2266 | Parameter { name: "state"; type: "bool" } |
|
2267 | Parameter { name: "state"; type: "bool" } | |
2267 | } |
|
2268 | } | |
2268 | Signal { |
|
2269 | Signal { | |
2269 | name: "pressed" |
|
2270 | name: "pressed" | |
2270 | Parameter { name: "point"; type: "QPointF" } |
|
2271 | Parameter { name: "point"; type: "QPointF" } | |
2271 | } |
|
2272 | } | |
2272 | Signal { |
|
2273 | Signal { | |
2273 | name: "released" |
|
2274 | name: "released" | |
2274 | Parameter { name: "point"; type: "QPointF" } |
|
2275 | Parameter { name: "point"; type: "QPointF" } | |
2275 | } |
|
2276 | } | |
2276 | Signal { |
|
2277 | Signal { | |
2277 | name: "doubleClicked" |
|
2278 | name: "doubleClicked" | |
2278 | Parameter { name: "point"; type: "QPointF" } |
|
2279 | Parameter { name: "point"; type: "QPointF" } | |
2279 | } |
|
2280 | } | |
2280 | Signal { name: "selected" } |
|
2281 | Signal { name: "selected" } | |
2281 | Signal { |
|
2282 | Signal { | |
2282 | name: "colorChanged" |
|
2283 | name: "colorChanged" | |
2283 | Parameter { name: "color"; type: "QColor" } |
|
2284 | Parameter { name: "color"; type: "QColor" } | |
2284 | } |
|
2285 | } | |
2285 | Signal { |
|
2286 | Signal { | |
2286 | name: "borderColorChanged" |
|
2287 | name: "borderColorChanged" | |
2287 | Parameter { name: "color"; type: "QColor" } |
|
2288 | Parameter { name: "color"; type: "QColor" } | |
2288 | } |
|
2289 | } | |
2289 | Signal { |
|
2290 | Signal { | |
2290 | name: "pointLabelsFormatChanged" |
|
2291 | name: "pointLabelsFormatChanged" | |
2291 | Parameter { name: "format"; type: "string" } |
|
2292 | Parameter { name: "format"; type: "string" } | |
2292 | } |
|
2293 | } | |
2293 | Signal { |
|
2294 | Signal { | |
2294 | name: "pointLabelsVisibilityChanged" |
|
2295 | name: "pointLabelsVisibilityChanged" | |
2295 | Parameter { name: "visible"; type: "bool" } |
|
2296 | Parameter { name: "visible"; type: "bool" } | |
2296 | } |
|
2297 | } | |
2297 | Signal { |
|
2298 | Signal { | |
2298 | name: "pointLabelsFontChanged" |
|
2299 | name: "pointLabelsFontChanged" | |
2299 | Parameter { name: "font"; type: "QFont" } |
|
2300 | Parameter { name: "font"; type: "QFont" } | |
2300 | } |
|
2301 | } | |
2301 | Signal { |
|
2302 | Signal { | |
2302 | name: "pointLabelsColorChanged" |
|
2303 | name: "pointLabelsColorChanged" | |
2303 | Parameter { name: "color"; type: "QColor" } |
|
2304 | Parameter { name: "color"; type: "QColor" } | |
2304 | } |
|
2305 | } | |
|
2306 | Signal { | |||
|
2307 | name: "pointLabelsClippingChanged" | |||
|
2308 | Parameter { name: "clipping"; type: "bool" } | |||
|
2309 | } | |||
2305 | } |
|
2310 | } | |
2306 | Component { |
|
2311 | Component { | |
2307 | name: "QtCharts::QBarCategoryAxis" |
|
2312 | name: "QtCharts::QBarCategoryAxis" | |
2308 | prototype: "QtCharts::QAbstractAxis" |
|
2313 | prototype: "QtCharts::QAbstractAxis" | |
2309 | exports: [ |
|
2314 | exports: [ | |
2310 | "QtCharts/BarCategoriesAxis 1.0", |
|
2315 | "QtCharts/BarCategoriesAxis 1.0", | |
2311 | "QtCharts/BarCategoryAxis 1.1", |
|
2316 | "QtCharts/BarCategoryAxis 1.1", | |
2312 | "QtCharts/BarCategoryAxis 2.0" |
|
2317 | "QtCharts/BarCategoryAxis 2.0" | |
2313 | ] |
|
2318 | ] | |
2314 | exportMetaObjectRevisions: [0, 0, 0] |
|
2319 | exportMetaObjectRevisions: [0, 0, 0] | |
2315 | Property { name: "categories"; type: "QStringList" } |
|
2320 | Property { name: "categories"; type: "QStringList" } | |
2316 | Property { name: "min"; type: "string" } |
|
2321 | Property { name: "min"; type: "string" } | |
2317 | Property { name: "max"; type: "string" } |
|
2322 | Property { name: "max"; type: "string" } | |
2318 | Property { name: "count"; type: "int"; isReadonly: true } |
|
2323 | Property { name: "count"; type: "int"; isReadonly: true } | |
2319 | Signal { |
|
2324 | Signal { | |
2320 | name: "minChanged" |
|
2325 | name: "minChanged" | |
2321 | Parameter { name: "min"; type: "string" } |
|
2326 | Parameter { name: "min"; type: "string" } | |
2322 | } |
|
2327 | } | |
2323 | Signal { |
|
2328 | Signal { | |
2324 | name: "maxChanged" |
|
2329 | name: "maxChanged" | |
2325 | Parameter { name: "max"; type: "string" } |
|
2330 | Parameter { name: "max"; type: "string" } | |
2326 | } |
|
2331 | } | |
2327 | Signal { |
|
2332 | Signal { | |
2328 | name: "rangeChanged" |
|
2333 | name: "rangeChanged" | |
2329 | Parameter { name: "min"; type: "string" } |
|
2334 | Parameter { name: "min"; type: "string" } | |
2330 | Parameter { name: "max"; type: "string" } |
|
2335 | Parameter { name: "max"; type: "string" } | |
2331 | } |
|
2336 | } | |
2332 | Method { name: "clear" } |
|
2337 | Method { name: "clear" } | |
2333 | } |
|
2338 | } | |
2334 | Component { |
|
2339 | Component { | |
2335 | name: "QtCharts::QBarModelMapper" |
|
2340 | name: "QtCharts::QBarModelMapper" | |
2336 | prototype: "QObject" |
|
2341 | prototype: "QObject" | |
2337 | exports: [ |
|
2342 | exports: [ | |
2338 | "QtCharts/BarModelMapper 1.0", |
|
2343 | "QtCharts/BarModelMapper 1.0", | |
2339 | "QtCharts/BarModelMapper 2.0" |
|
2344 | "QtCharts/BarModelMapper 2.0" | |
2340 | ] |
|
2345 | ] | |
2341 | isCreatable: false |
|
2346 | isCreatable: false | |
2342 | exportMetaObjectRevisions: [0, 0] |
|
2347 | exportMetaObjectRevisions: [0, 0] | |
2343 | } |
|
2348 | } | |
2344 | Component { name: "QtCharts::QBarSeries"; prototype: "QtCharts::QAbstractBarSeries" } |
|
2349 | Component { name: "QtCharts::QBarSeries"; prototype: "QtCharts::QAbstractBarSeries" } | |
2345 | Component { |
|
2350 | Component { | |
2346 | name: "QtCharts::QBarSet" |
|
2351 | name: "QtCharts::QBarSet" | |
2347 | prototype: "QObject" |
|
2352 | prototype: "QObject" | |
2348 | exports: ["QtCharts/BarSetBase 1.0", "QtCharts/BarSetBase 2.0"] |
|
2353 | exports: ["QtCharts/BarSetBase 1.0", "QtCharts/BarSetBase 2.0"] | |
2349 | isCreatable: false |
|
2354 | isCreatable: false | |
2350 | exportMetaObjectRevisions: [0, 0] |
|
2355 | exportMetaObjectRevisions: [0, 0] | |
2351 | Property { name: "label"; type: "string" } |
|
2356 | Property { name: "label"; type: "string" } | |
2352 | Property { name: "pen"; type: "QPen" } |
|
2357 | Property { name: "pen"; type: "QPen" } | |
2353 | Property { name: "brush"; type: "QBrush" } |
|
2358 | Property { name: "brush"; type: "QBrush" } | |
2354 | Property { name: "labelBrush"; type: "QBrush" } |
|
2359 | Property { name: "labelBrush"; type: "QBrush" } | |
2355 | Property { name: "labelFont"; type: "QFont" } |
|
2360 | Property { name: "labelFont"; type: "QFont" } | |
2356 | Property { name: "color"; type: "QColor" } |
|
2361 | Property { name: "color"; type: "QColor" } | |
2357 | Property { name: "borderColor"; type: "QColor" } |
|
2362 | Property { name: "borderColor"; type: "QColor" } | |
2358 | Property { name: "labelColor"; type: "QColor" } |
|
2363 | Property { name: "labelColor"; type: "QColor" } | |
2359 | Signal { |
|
2364 | Signal { | |
2360 | name: "clicked" |
|
2365 | name: "clicked" | |
2361 | Parameter { name: "index"; type: "int" } |
|
2366 | Parameter { name: "index"; type: "int" } | |
2362 | } |
|
2367 | } | |
2363 | Signal { |
|
2368 | Signal { | |
2364 | name: "hovered" |
|
2369 | name: "hovered" | |
2365 | Parameter { name: "status"; type: "bool" } |
|
2370 | Parameter { name: "status"; type: "bool" } | |
2366 | Parameter { name: "index"; type: "int" } |
|
2371 | Parameter { name: "index"; type: "int" } | |
2367 | } |
|
2372 | } | |
2368 | Signal { |
|
2373 | Signal { | |
2369 | name: "pressed" |
|
2374 | name: "pressed" | |
2370 | Parameter { name: "index"; type: "int" } |
|
2375 | Parameter { name: "index"; type: "int" } | |
2371 | } |
|
2376 | } | |
2372 | Signal { |
|
2377 | Signal { | |
2373 | name: "released" |
|
2378 | name: "released" | |
2374 | Parameter { name: "index"; type: "int" } |
|
2379 | Parameter { name: "index"; type: "int" } | |
2375 | } |
|
2380 | } | |
2376 | Signal { |
|
2381 | Signal { | |
2377 | name: "doubleClicked" |
|
2382 | name: "doubleClicked" | |
2378 | Parameter { name: "index"; type: "int" } |
|
2383 | Parameter { name: "index"; type: "int" } | |
2379 | } |
|
2384 | } | |
2380 | Signal { |
|
2385 | Signal { | |
2381 | name: "colorChanged" |
|
2386 | name: "colorChanged" | |
2382 | Parameter { name: "color"; type: "QColor" } |
|
2387 | Parameter { name: "color"; type: "QColor" } | |
2383 | } |
|
2388 | } | |
2384 | Signal { |
|
2389 | Signal { | |
2385 | name: "borderColorChanged" |
|
2390 | name: "borderColorChanged" | |
2386 | Parameter { name: "color"; type: "QColor" } |
|
2391 | Parameter { name: "color"; type: "QColor" } | |
2387 | } |
|
2392 | } | |
2388 | Signal { |
|
2393 | Signal { | |
2389 | name: "labelColorChanged" |
|
2394 | name: "labelColorChanged" | |
2390 | Parameter { name: "color"; type: "QColor" } |
|
2395 | Parameter { name: "color"; type: "QColor" } | |
2391 | } |
|
2396 | } | |
2392 | Signal { |
|
2397 | Signal { | |
2393 | name: "valuesAdded" |
|
2398 | name: "valuesAdded" | |
2394 | Parameter { name: "index"; type: "int" } |
|
2399 | Parameter { name: "index"; type: "int" } | |
2395 | Parameter { name: "count"; type: "int" } |
|
2400 | Parameter { name: "count"; type: "int" } | |
2396 | } |
|
2401 | } | |
2397 | Signal { |
|
2402 | Signal { | |
2398 | name: "valuesRemoved" |
|
2403 | name: "valuesRemoved" | |
2399 | Parameter { name: "index"; type: "int" } |
|
2404 | Parameter { name: "index"; type: "int" } | |
2400 | Parameter { name: "count"; type: "int" } |
|
2405 | Parameter { name: "count"; type: "int" } | |
2401 | } |
|
2406 | } | |
2402 | Signal { |
|
2407 | Signal { | |
2403 | name: "valueChanged" |
|
2408 | name: "valueChanged" | |
2404 | Parameter { name: "index"; type: "int" } |
|
2409 | Parameter { name: "index"; type: "int" } | |
2405 | } |
|
2410 | } | |
2406 | } |
|
2411 | } | |
2407 | Component { |
|
2412 | Component { | |
2408 | name: "QtCharts::QBoxPlotModelMapper" |
|
2413 | name: "QtCharts::QBoxPlotModelMapper" | |
2409 | prototype: "QObject" |
|
2414 | prototype: "QObject" | |
2410 | exports: ["QtCharts/BoxPlotModelMapper 2.0"] |
|
2415 | exports: ["QtCharts/BoxPlotModelMapper 2.0"] | |
2411 | isCreatable: false |
|
2416 | isCreatable: false | |
2412 | exportMetaObjectRevisions: [0] |
|
2417 | exportMetaObjectRevisions: [0] | |
2413 | } |
|
2418 | } | |
2414 | Component { |
|
2419 | Component { | |
2415 | name: "QtCharts::QBoxPlotSeries" |
|
2420 | name: "QtCharts::QBoxPlotSeries" | |
2416 | prototype: "QtCharts::QAbstractSeries" |
|
2421 | prototype: "QtCharts::QAbstractSeries" | |
2417 | Property { name: "boxOutlineVisible"; type: "bool" } |
|
2422 | Property { name: "boxOutlineVisible"; type: "bool" } | |
2418 | Property { name: "boxWidth"; type: "double" } |
|
2423 | Property { name: "boxWidth"; type: "double" } | |
2419 | Property { name: "pen"; type: "QPen" } |
|
2424 | Property { name: "pen"; type: "QPen" } | |
2420 | Property { name: "brush"; type: "QBrush" } |
|
2425 | Property { name: "brush"; type: "QBrush" } | |
2421 | Property { name: "count"; revision: 1; type: "int"; isReadonly: true } |
|
2426 | Property { name: "count"; revision: 1; type: "int"; isReadonly: true } | |
2422 | Signal { |
|
2427 | Signal { | |
2423 | name: "clicked" |
|
2428 | name: "clicked" | |
2424 | Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true } |
|
2429 | Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true } | |
2425 | } |
|
2430 | } | |
2426 | Signal { |
|
2431 | Signal { | |
2427 | name: "hovered" |
|
2432 | name: "hovered" | |
2428 | Parameter { name: "status"; type: "bool" } |
|
2433 | Parameter { name: "status"; type: "bool" } | |
2429 | Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true } |
|
2434 | Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true } | |
2430 | } |
|
2435 | } | |
2431 | Signal { |
|
2436 | Signal { | |
2432 | name: "pressed" |
|
2437 | name: "pressed" | |
2433 | Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true } |
|
2438 | Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true } | |
2434 | } |
|
2439 | } | |
2435 | Signal { |
|
2440 | Signal { | |
2436 | name: "released" |
|
2441 | name: "released" | |
2437 | Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true } |
|
2442 | Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true } | |
2438 | } |
|
2443 | } | |
2439 | Signal { |
|
2444 | Signal { | |
2440 | name: "doubleClicked" |
|
2445 | name: "doubleClicked" | |
2441 | Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true } |
|
2446 | Parameter { name: "boxset"; type: "QBoxSet"; isPointer: true } | |
2442 | } |
|
2447 | } | |
2443 | Signal { name: "boxOutlineVisibilityChanged" } |
|
2448 | Signal { name: "boxOutlineVisibilityChanged" } | |
2444 | Signal { |
|
2449 | Signal { | |
2445 | name: "boxsetsAdded" |
|
2450 | name: "boxsetsAdded" | |
2446 | Parameter { name: "sets"; type: "QList<QBoxSet*>" } |
|
2451 | Parameter { name: "sets"; type: "QList<QBoxSet*>" } | |
2447 | } |
|
2452 | } | |
2448 | Signal { |
|
2453 | Signal { | |
2449 | name: "boxsetsRemoved" |
|
2454 | name: "boxsetsRemoved" | |
2450 | Parameter { name: "sets"; type: "QList<QBoxSet*>" } |
|
2455 | Parameter { name: "sets"; type: "QList<QBoxSet*>" } | |
2451 | } |
|
2456 | } | |
2452 | } |
|
2457 | } | |
2453 | Component { |
|
2458 | Component { | |
2454 | name: "QtCharts::QBoxSet" |
|
2459 | name: "QtCharts::QBoxSet" | |
2455 | prototype: "QObject" |
|
2460 | prototype: "QObject" | |
2456 | Property { name: "pen"; type: "QPen" } |
|
2461 | Property { name: "pen"; type: "QPen" } | |
2457 | Property { name: "brush"; type: "QBrush" } |
|
2462 | Property { name: "brush"; type: "QBrush" } | |
2458 | Signal { name: "clicked" } |
|
2463 | Signal { name: "clicked" } | |
2459 | Signal { |
|
2464 | Signal { | |
2460 | name: "hovered" |
|
2465 | name: "hovered" | |
2461 | Parameter { name: "status"; type: "bool" } |
|
2466 | Parameter { name: "status"; type: "bool" } | |
2462 | } |
|
2467 | } | |
2463 | Signal { name: "pressed" } |
|
2468 | Signal { name: "pressed" } | |
2464 | Signal { name: "released" } |
|
2469 | Signal { name: "released" } | |
2465 | Signal { name: "doubleClicked" } |
|
2470 | Signal { name: "doubleClicked" } | |
2466 | Signal { name: "valuesChanged" } |
|
2471 | Signal { name: "valuesChanged" } | |
2467 | Signal { |
|
2472 | Signal { | |
2468 | name: "valueChanged" |
|
2473 | name: "valueChanged" | |
2469 | Parameter { name: "index"; type: "int" } |
|
2474 | Parameter { name: "index"; type: "int" } | |
2470 | } |
|
2475 | } | |
2471 | Signal { name: "cleared" } |
|
2476 | Signal { name: "cleared" } | |
2472 | } |
|
2477 | } | |
2473 | Component { |
|
2478 | Component { | |
2474 | name: "QtCharts::QCategoryAxis" |
|
2479 | name: "QtCharts::QCategoryAxis" | |
2475 | prototype: "QtCharts::QValueAxis" |
|
2480 | prototype: "QtCharts::QValueAxis" | |
2476 | Enum { |
|
2481 | Enum { | |
2477 | name: "AxisLabelsPosition" |
|
2482 | name: "AxisLabelsPosition" | |
2478 | values: { |
|
2483 | values: { | |
2479 | "AxisLabelsPositionCenter": 0, |
|
2484 | "AxisLabelsPositionCenter": 0, | |
2480 | "AxisLabelsPositionOnValue": 1 |
|
2485 | "AxisLabelsPositionOnValue": 1 | |
2481 | } |
|
2486 | } | |
2482 | } |
|
2487 | } | |
2483 | Property { name: "startValue"; type: "double" } |
|
2488 | Property { name: "startValue"; type: "double" } | |
2484 | Property { name: "count"; type: "int"; isReadonly: true } |
|
2489 | Property { name: "count"; type: "int"; isReadonly: true } | |
2485 | Property { name: "categoriesLabels"; type: "QStringList"; isReadonly: true } |
|
2490 | Property { name: "categoriesLabels"; type: "QStringList"; isReadonly: true } | |
2486 | Property { name: "labelsPosition"; type: "AxisLabelsPosition" } |
|
2491 | Property { name: "labelsPosition"; type: "AxisLabelsPosition" } | |
2487 | Signal { name: "categoriesChanged" } |
|
2492 | Signal { name: "categoriesChanged" } | |
2488 | Signal { |
|
2493 | Signal { | |
2489 | name: "labelsPositionChanged" |
|
2494 | name: "labelsPositionChanged" | |
2490 | Parameter { name: "position"; type: "QCategoryAxis::AxisLabelsPosition" } |
|
2495 | Parameter { name: "position"; type: "QCategoryAxis::AxisLabelsPosition" } | |
2491 | } |
|
2496 | } | |
2492 | } |
|
2497 | } | |
2493 | Component { |
|
2498 | Component { | |
2494 | name: "QtCharts::QDateTimeAxis" |
|
2499 | name: "QtCharts::QDateTimeAxis" | |
2495 | prototype: "QtCharts::QAbstractAxis" |
|
2500 | prototype: "QtCharts::QAbstractAxis" | |
2496 | exports: ["QtCharts/DateTimeAxis 1.1", "QtCharts/DateTimeAxis 2.0"] |
|
2501 | exports: ["QtCharts/DateTimeAxis 1.1", "QtCharts/DateTimeAxis 2.0"] | |
2497 | exportMetaObjectRevisions: [0, 0] |
|
2502 | exportMetaObjectRevisions: [0, 0] | |
2498 | Property { name: "tickCount"; type: "int" } |
|
2503 | Property { name: "tickCount"; type: "int" } | |
2499 | Property { name: "min"; type: "QDateTime" } |
|
2504 | Property { name: "min"; type: "QDateTime" } | |
2500 | Property { name: "max"; type: "QDateTime" } |
|
2505 | Property { name: "max"; type: "QDateTime" } | |
2501 | Property { name: "format"; type: "string" } |
|
2506 | Property { name: "format"; type: "string" } | |
2502 | Signal { |
|
2507 | Signal { | |
2503 | name: "minChanged" |
|
2508 | name: "minChanged" | |
2504 | Parameter { name: "min"; type: "QDateTime" } |
|
2509 | Parameter { name: "min"; type: "QDateTime" } | |
2505 | } |
|
2510 | } | |
2506 | Signal { |
|
2511 | Signal { | |
2507 | name: "maxChanged" |
|
2512 | name: "maxChanged" | |
2508 | Parameter { name: "max"; type: "QDateTime" } |
|
2513 | Parameter { name: "max"; type: "QDateTime" } | |
2509 | } |
|
2514 | } | |
2510 | Signal { |
|
2515 | Signal { | |
2511 | name: "rangeChanged" |
|
2516 | name: "rangeChanged" | |
2512 | Parameter { name: "min"; type: "QDateTime" } |
|
2517 | Parameter { name: "min"; type: "QDateTime" } | |
2513 | Parameter { name: "max"; type: "QDateTime" } |
|
2518 | Parameter { name: "max"; type: "QDateTime" } | |
2514 | } |
|
2519 | } | |
2515 | Signal { |
|
2520 | Signal { | |
2516 | name: "formatChanged" |
|
2521 | name: "formatChanged" | |
2517 | Parameter { name: "format"; type: "string" } |
|
2522 | Parameter { name: "format"; type: "string" } | |
2518 | } |
|
2523 | } | |
2519 | Signal { |
|
2524 | Signal { | |
2520 | name: "tickCountChanged" |
|
2525 | name: "tickCountChanged" | |
2521 | Parameter { name: "tick"; type: "int" } |
|
2526 | Parameter { name: "tick"; type: "int" } | |
2522 | } |
|
2527 | } | |
2523 | } |
|
2528 | } | |
2524 | Component { |
|
2529 | Component { | |
2525 | name: "QtCharts::QHBarModelMapper" |
|
2530 | name: "QtCharts::QHBarModelMapper" | |
2526 | prototype: "QtCharts::QBarModelMapper" |
|
2531 | prototype: "QtCharts::QBarModelMapper" | |
2527 | exports: [ |
|
2532 | exports: [ | |
2528 | "QtCharts/HBarModelMapper 1.0", |
|
2533 | "QtCharts/HBarModelMapper 1.0", | |
2529 | "QtCharts/HBarModelMapper 2.0" |
|
2534 | "QtCharts/HBarModelMapper 2.0" | |
2530 | ] |
|
2535 | ] | |
2531 | exportMetaObjectRevisions: [0, 0] |
|
2536 | exportMetaObjectRevisions: [0, 0] | |
2532 | Property { name: "series"; type: "QAbstractBarSeries"; isPointer: true } |
|
2537 | Property { name: "series"; type: "QAbstractBarSeries"; isPointer: true } | |
2533 | Property { name: "model"; type: "QAbstractItemModel"; isPointer: true } |
|
2538 | Property { name: "model"; type: "QAbstractItemModel"; isPointer: true } | |
2534 | Property { name: "firstBarSetRow"; type: "int" } |
|
2539 | Property { name: "firstBarSetRow"; type: "int" } | |
2535 | Property { name: "lastBarSetRow"; type: "int" } |
|
2540 | Property { name: "lastBarSetRow"; type: "int" } | |
2536 | Property { name: "firstColumn"; type: "int" } |
|
2541 | Property { name: "firstColumn"; type: "int" } | |
2537 | Property { name: "columnCount"; type: "int" } |
|
2542 | Property { name: "columnCount"; type: "int" } | |
2538 | Signal { name: "seriesReplaced" } |
|
2543 | Signal { name: "seriesReplaced" } | |
2539 | Signal { name: "modelReplaced" } |
|
2544 | Signal { name: "modelReplaced" } | |
2540 | } |
|
2545 | } | |
2541 | Component { |
|
2546 | Component { | |
2542 | name: "QtCharts::QHPieModelMapper" |
|
2547 | name: "QtCharts::QHPieModelMapper" | |
2543 | prototype: "QtCharts::QPieModelMapper" |
|
2548 | prototype: "QtCharts::QPieModelMapper" | |
2544 | exports: [ |
|
2549 | exports: [ | |
2545 | "QtCharts/HPieModelMapper 1.0", |
|
2550 | "QtCharts/HPieModelMapper 1.0", | |
2546 | "QtCharts/HPieModelMapper 2.0" |
|
2551 | "QtCharts/HPieModelMapper 2.0" | |
2547 | ] |
|
2552 | ] | |
2548 | exportMetaObjectRevisions: [0, 0] |
|
2553 | exportMetaObjectRevisions: [0, 0] | |
2549 | Property { name: "series"; type: "QPieSeries"; isPointer: true } |
|
2554 | Property { name: "series"; type: "QPieSeries"; isPointer: true } | |
2550 | Property { name: "model"; type: "QAbstractItemModel"; isPointer: true } |
|
2555 | Property { name: "model"; type: "QAbstractItemModel"; isPointer: true } | |
2551 | Property { name: "valuesRow"; type: "int" } |
|
2556 | Property { name: "valuesRow"; type: "int" } | |
2552 | Property { name: "labelsRow"; type: "int" } |
|
2557 | Property { name: "labelsRow"; type: "int" } | |
2553 | Property { name: "firstColumn"; type: "int" } |
|
2558 | Property { name: "firstColumn"; type: "int" } | |
2554 | Property { name: "columnCount"; type: "int" } |
|
2559 | Property { name: "columnCount"; type: "int" } | |
2555 | Signal { name: "seriesReplaced" } |
|
2560 | Signal { name: "seriesReplaced" } | |
2556 | Signal { name: "modelReplaced" } |
|
2561 | Signal { name: "modelReplaced" } | |
2557 | } |
|
2562 | } | |
2558 | Component { |
|
2563 | Component { | |
2559 | name: "QtCharts::QHXYModelMapper" |
|
2564 | name: "QtCharts::QHXYModelMapper" | |
2560 | prototype: "QtCharts::QXYModelMapper" |
|
2565 | prototype: "QtCharts::QXYModelMapper" | |
2561 | exports: [ |
|
2566 | exports: [ | |
2562 | "QtCharts/HXYModelMapper 1.0", |
|
2567 | "QtCharts/HXYModelMapper 1.0", | |
2563 | "QtCharts/HXYModelMapper 2.0" |
|
2568 | "QtCharts/HXYModelMapper 2.0" | |
2564 | ] |
|
2569 | ] | |
2565 | exportMetaObjectRevisions: [0, 0] |
|
2570 | exportMetaObjectRevisions: [0, 0] | |
2566 | Property { name: "series"; type: "QXYSeries"; isPointer: true } |
|
2571 | Property { name: "series"; type: "QXYSeries"; isPointer: true } | |
2567 | Property { name: "model"; type: "QAbstractItemModel"; isPointer: true } |
|
2572 | Property { name: "model"; type: "QAbstractItemModel"; isPointer: true } | |
2568 | Property { name: "xRow"; type: "int" } |
|
2573 | Property { name: "xRow"; type: "int" } | |
2569 | Property { name: "yRow"; type: "int" } |
|
2574 | Property { name: "yRow"; type: "int" } | |
2570 | Property { name: "firstColumn"; type: "int" } |
|
2575 | Property { name: "firstColumn"; type: "int" } | |
2571 | Property { name: "columnCount"; type: "int" } |
|
2576 | Property { name: "columnCount"; type: "int" } | |
2572 | Signal { name: "seriesReplaced" } |
|
2577 | Signal { name: "seriesReplaced" } | |
2573 | Signal { name: "modelReplaced" } |
|
2578 | Signal { name: "modelReplaced" } | |
2574 | } |
|
2579 | } | |
2575 | Component { name: "QtCharts::QHorizontalBarSeries"; prototype: "QtCharts::QAbstractBarSeries" } |
|
2580 | Component { name: "QtCharts::QHorizontalBarSeries"; prototype: "QtCharts::QAbstractBarSeries" } | |
2576 | Component { |
|
2581 | Component { | |
2577 | name: "QtCharts::QHorizontalPercentBarSeries" |
|
2582 | name: "QtCharts::QHorizontalPercentBarSeries" | |
2578 | prototype: "QtCharts::QAbstractBarSeries" |
|
2583 | prototype: "QtCharts::QAbstractBarSeries" | |
2579 | } |
|
2584 | } | |
2580 | Component { |
|
2585 | Component { | |
2581 | name: "QtCharts::QHorizontalStackedBarSeries" |
|
2586 | name: "QtCharts::QHorizontalStackedBarSeries" | |
2582 | prototype: "QtCharts::QAbstractBarSeries" |
|
2587 | prototype: "QtCharts::QAbstractBarSeries" | |
2583 | } |
|
2588 | } | |
2584 | Component { |
|
2589 | Component { | |
2585 | name: "QtCharts::QLegend" |
|
2590 | name: "QtCharts::QLegend" | |
2586 | defaultProperty: "children" |
|
2591 | defaultProperty: "children" | |
2587 | prototype: "QGraphicsWidget" |
|
2592 | prototype: "QGraphicsWidget" | |
2588 | exports: ["QtCharts/Legend 1.0", "QtCharts/Legend 2.0"] |
|
2593 | exports: ["QtCharts/Legend 1.0", "QtCharts/Legend 2.0"] | |
2589 | isCreatable: false |
|
2594 | isCreatable: false | |
2590 | exportMetaObjectRevisions: [0, 0] |
|
2595 | exportMetaObjectRevisions: [0, 0] | |
2591 | Property { name: "alignment"; type: "Qt::Alignment" } |
|
2596 | Property { name: "alignment"; type: "Qt::Alignment" } | |
2592 | Property { name: "backgroundVisible"; type: "bool" } |
|
2597 | Property { name: "backgroundVisible"; type: "bool" } | |
2593 | Property { name: "color"; type: "QColor" } |
|
2598 | Property { name: "color"; type: "QColor" } | |
2594 | Property { name: "borderColor"; type: "QColor" } |
|
2599 | Property { name: "borderColor"; type: "QColor" } | |
2595 | Property { name: "font"; type: "QFont" } |
|
2600 | Property { name: "font"; type: "QFont" } | |
2596 | Property { name: "labelColor"; type: "QColor" } |
|
2601 | Property { name: "labelColor"; type: "QColor" } | |
2597 | Property { name: "reverseMarkers"; type: "bool" } |
|
2602 | Property { name: "reverseMarkers"; type: "bool" } | |
2598 | Signal { |
|
2603 | Signal { | |
2599 | name: "backgroundVisibleChanged" |
|
2604 | name: "backgroundVisibleChanged" | |
2600 | Parameter { name: "visible"; type: "bool" } |
|
2605 | Parameter { name: "visible"; type: "bool" } | |
2601 | } |
|
2606 | } | |
2602 | Signal { |
|
2607 | Signal { | |
2603 | name: "colorChanged" |
|
2608 | name: "colorChanged" | |
2604 | Parameter { name: "color"; type: "QColor" } |
|
2609 | Parameter { name: "color"; type: "QColor" } | |
2605 | } |
|
2610 | } | |
2606 | Signal { |
|
2611 | Signal { | |
2607 | name: "borderColorChanged" |
|
2612 | name: "borderColorChanged" | |
2608 | Parameter { name: "color"; type: "QColor" } |
|
2613 | Parameter { name: "color"; type: "QColor" } | |
2609 | } |
|
2614 | } | |
2610 | Signal { |
|
2615 | Signal { | |
2611 | name: "fontChanged" |
|
2616 | name: "fontChanged" | |
2612 | Parameter { name: "font"; type: "QFont" } |
|
2617 | Parameter { name: "font"; type: "QFont" } | |
2613 | } |
|
2618 | } | |
2614 | Signal { |
|
2619 | Signal { | |
2615 | name: "labelColorChanged" |
|
2620 | name: "labelColorChanged" | |
2616 | Parameter { name: "color"; type: "QColor" } |
|
2621 | Parameter { name: "color"; type: "QColor" } | |
2617 | } |
|
2622 | } | |
2618 | Signal { |
|
2623 | Signal { | |
2619 | name: "reverseMarkersChanged" |
|
2624 | name: "reverseMarkersChanged" | |
2620 | Parameter { name: "reverseMarkers"; type: "bool" } |
|
2625 | Parameter { name: "reverseMarkers"; type: "bool" } | |
2621 | } |
|
2626 | } | |
2622 | } |
|
2627 | } | |
2623 | Component { name: "QtCharts::QLineSeries"; prototype: "QtCharts::QXYSeries" } |
|
2628 | Component { name: "QtCharts::QLineSeries"; prototype: "QtCharts::QXYSeries" } | |
2624 | Component { |
|
2629 | Component { | |
2625 | name: "QtCharts::QLogValueAxis" |
|
2630 | name: "QtCharts::QLogValueAxis" | |
2626 | prototype: "QtCharts::QAbstractAxis" |
|
2631 | prototype: "QtCharts::QAbstractAxis" | |
2627 | exports: ["QtCharts/LogValueAxis 1.3", "QtCharts/LogValueAxis 2.0"] |
|
2632 | exports: ["QtCharts/LogValueAxis 1.3", "QtCharts/LogValueAxis 2.0"] | |
2628 | exportMetaObjectRevisions: [0, 1] |
|
2633 | exportMetaObjectRevisions: [0, 1] | |
2629 | Property { name: "min"; type: "double" } |
|
2634 | Property { name: "min"; type: "double" } | |
2630 | Property { name: "max"; type: "double" } |
|
2635 | Property { name: "max"; type: "double" } | |
2631 | Property { name: "labelFormat"; type: "string" } |
|
2636 | Property { name: "labelFormat"; type: "string" } | |
2632 | Property { name: "base"; type: "double" } |
|
2637 | Property { name: "base"; type: "double" } | |
2633 | Signal { |
|
2638 | Signal { | |
2634 | name: "minChanged" |
|
2639 | name: "minChanged" | |
2635 | Parameter { name: "min"; type: "double" } |
|
2640 | Parameter { name: "min"; type: "double" } | |
2636 | } |
|
2641 | } | |
2637 | Signal { |
|
2642 | Signal { | |
2638 | name: "maxChanged" |
|
2643 | name: "maxChanged" | |
2639 | Parameter { name: "max"; type: "double" } |
|
2644 | Parameter { name: "max"; type: "double" } | |
2640 | } |
|
2645 | } | |
2641 | Signal { |
|
2646 | Signal { | |
2642 | name: "rangeChanged" |
|
2647 | name: "rangeChanged" | |
2643 | Parameter { name: "min"; type: "double" } |
|
2648 | Parameter { name: "min"; type: "double" } | |
2644 | Parameter { name: "max"; type: "double" } |
|
2649 | Parameter { name: "max"; type: "double" } | |
2645 | } |
|
2650 | } | |
2646 | Signal { |
|
2651 | Signal { | |
2647 | name: "labelFormatChanged" |
|
2652 | name: "labelFormatChanged" | |
2648 | Parameter { name: "format"; type: "string" } |
|
2653 | Parameter { name: "format"; type: "string" } | |
2649 | } |
|
2654 | } | |
2650 | Signal { |
|
2655 | Signal { | |
2651 | name: "baseChanged" |
|
2656 | name: "baseChanged" | |
2652 | Parameter { name: "base"; type: "double" } |
|
2657 | Parameter { name: "base"; type: "double" } | |
2653 | } |
|
2658 | } | |
2654 | } |
|
2659 | } | |
2655 | Component { name: "QtCharts::QPercentBarSeries"; prototype: "QtCharts::QAbstractBarSeries" } |
|
2660 | Component { name: "QtCharts::QPercentBarSeries"; prototype: "QtCharts::QAbstractBarSeries" } | |
2656 | Component { |
|
2661 | Component { | |
2657 | name: "QtCharts::QPieModelMapper" |
|
2662 | name: "QtCharts::QPieModelMapper" | |
2658 | prototype: "QObject" |
|
2663 | prototype: "QObject" | |
2659 | exports: [ |
|
2664 | exports: [ | |
2660 | "QtCharts/PieModelMapper 1.0", |
|
2665 | "QtCharts/PieModelMapper 1.0", | |
2661 | "QtCharts/PieModelMapper 2.0" |
|
2666 | "QtCharts/PieModelMapper 2.0" | |
2662 | ] |
|
2667 | ] | |
2663 | isCreatable: false |
|
2668 | isCreatable: false | |
2664 | exportMetaObjectRevisions: [0, 0] |
|
2669 | exportMetaObjectRevisions: [0, 0] | |
2665 | } |
|
2670 | } | |
2666 | Component { |
|
2671 | Component { | |
2667 | name: "QtCharts::QPieSeries" |
|
2672 | name: "QtCharts::QPieSeries" | |
2668 | prototype: "QtCharts::QAbstractSeries" |
|
2673 | prototype: "QtCharts::QAbstractSeries" | |
2669 | exports: ["QtCharts/QPieSeries 1.0", "QtCharts/QPieSeries 2.0"] |
|
2674 | exports: ["QtCharts/QPieSeries 1.0", "QtCharts/QPieSeries 2.0"] | |
2670 | isCreatable: false |
|
2675 | isCreatable: false | |
2671 | exportMetaObjectRevisions: [0, 0] |
|
2676 | exportMetaObjectRevisions: [0, 0] | |
2672 | Property { name: "horizontalPosition"; type: "double" } |
|
2677 | Property { name: "horizontalPosition"; type: "double" } | |
2673 | Property { name: "verticalPosition"; type: "double" } |
|
2678 | Property { name: "verticalPosition"; type: "double" } | |
2674 | Property { name: "size"; type: "double" } |
|
2679 | Property { name: "size"; type: "double" } | |
2675 | Property { name: "startAngle"; type: "double" } |
|
2680 | Property { name: "startAngle"; type: "double" } | |
2676 | Property { name: "endAngle"; type: "double" } |
|
2681 | Property { name: "endAngle"; type: "double" } | |
2677 | Property { name: "count"; type: "int"; isReadonly: true } |
|
2682 | Property { name: "count"; type: "int"; isReadonly: true } | |
2678 | Property { name: "sum"; type: "double"; isReadonly: true } |
|
2683 | Property { name: "sum"; type: "double"; isReadonly: true } | |
2679 | Property { name: "holeSize"; type: "double" } |
|
2684 | Property { name: "holeSize"; type: "double" } | |
2680 | Signal { |
|
2685 | Signal { | |
2681 | name: "added" |
|
2686 | name: "added" | |
2682 | Parameter { name: "slices"; type: "QList<QPieSlice*>" } |
|
2687 | Parameter { name: "slices"; type: "QList<QPieSlice*>" } | |
2683 | } |
|
2688 | } | |
2684 | Signal { |
|
2689 | Signal { | |
2685 | name: "removed" |
|
2690 | name: "removed" | |
2686 | Parameter { name: "slices"; type: "QList<QPieSlice*>" } |
|
2691 | Parameter { name: "slices"; type: "QList<QPieSlice*>" } | |
2687 | } |
|
2692 | } | |
2688 | Signal { |
|
2693 | Signal { | |
2689 | name: "clicked" |
|
2694 | name: "clicked" | |
2690 | Parameter { name: "slice"; type: "QPieSlice"; isPointer: true } |
|
2695 | Parameter { name: "slice"; type: "QPieSlice"; isPointer: true } | |
2691 | } |
|
2696 | } | |
2692 | Signal { |
|
2697 | Signal { | |
2693 | name: "hovered" |
|
2698 | name: "hovered" | |
2694 | Parameter { name: "slice"; type: "QPieSlice"; isPointer: true } |
|
2699 | Parameter { name: "slice"; type: "QPieSlice"; isPointer: true } | |
2695 | Parameter { name: "state"; type: "bool" } |
|
2700 | Parameter { name: "state"; type: "bool" } | |
2696 | } |
|
2701 | } | |
2697 | Signal { |
|
2702 | Signal { | |
2698 | name: "pressed" |
|
2703 | name: "pressed" | |
2699 | Parameter { name: "slice"; type: "QPieSlice"; isPointer: true } |
|
2704 | Parameter { name: "slice"; type: "QPieSlice"; isPointer: true } | |
2700 | } |
|
2705 | } | |
2701 | Signal { |
|
2706 | Signal { | |
2702 | name: "released" |
|
2707 | name: "released" | |
2703 | Parameter { name: "slice"; type: "QPieSlice"; isPointer: true } |
|
2708 | Parameter { name: "slice"; type: "QPieSlice"; isPointer: true } | |
2704 | } |
|
2709 | } | |
2705 | Signal { |
|
2710 | Signal { | |
2706 | name: "doubleClicked" |
|
2711 | name: "doubleClicked" | |
2707 | Parameter { name: "slice"; type: "QPieSlice"; isPointer: true } |
|
2712 | Parameter { name: "slice"; type: "QPieSlice"; isPointer: true } | |
2708 | } |
|
2713 | } | |
2709 | } |
|
2714 | } | |
2710 | Component { |
|
2715 | Component { | |
2711 | name: "QtCharts::QPieSlice" |
|
2716 | name: "QtCharts::QPieSlice" | |
2712 | prototype: "QObject" |
|
2717 | prototype: "QObject" | |
2713 | exports: ["QtCharts/PieSlice 1.0", "QtCharts/PieSlice 2.0"] |
|
2718 | exports: ["QtCharts/PieSlice 1.0", "QtCharts/PieSlice 2.0"] | |
2714 | exportMetaObjectRevisions: [0, 0] |
|
2719 | exportMetaObjectRevisions: [0, 0] | |
2715 | Enum { |
|
2720 | Enum { | |
2716 | name: "LabelPosition" |
|
2721 | name: "LabelPosition" | |
2717 | values: { |
|
2722 | values: { | |
2718 | "LabelOutside": 0, |
|
2723 | "LabelOutside": 0, | |
2719 | "LabelInsideHorizontal": 1, |
|
2724 | "LabelInsideHorizontal": 1, | |
2720 | "LabelInsideTangential": 2, |
|
2725 | "LabelInsideTangential": 2, | |
2721 | "LabelInsideNormal": 3 |
|
2726 | "LabelInsideNormal": 3 | |
2722 | } |
|
2727 | } | |
2723 | } |
|
2728 | } | |
2724 | Property { name: "label"; type: "string" } |
|
2729 | Property { name: "label"; type: "string" } | |
2725 | Property { name: "value"; type: "double" } |
|
2730 | Property { name: "value"; type: "double" } | |
2726 | Property { name: "labelVisible"; type: "bool" } |
|
2731 | Property { name: "labelVisible"; type: "bool" } | |
2727 | Property { name: "labelPosition"; type: "LabelPosition" } |
|
2732 | Property { name: "labelPosition"; type: "LabelPosition" } | |
2728 | Property { name: "exploded"; type: "bool" } |
|
2733 | Property { name: "exploded"; type: "bool" } | |
2729 | Property { name: "pen"; type: "QPen" } |
|
2734 | Property { name: "pen"; type: "QPen" } | |
2730 | Property { name: "borderColor"; type: "QColor" } |
|
2735 | Property { name: "borderColor"; type: "QColor" } | |
2731 | Property { name: "borderWidth"; type: "int" } |
|
2736 | Property { name: "borderWidth"; type: "int" } | |
2732 | Property { name: "brush"; type: "QBrush" } |
|
2737 | Property { name: "brush"; type: "QBrush" } | |
2733 | Property { name: "color"; type: "QColor" } |
|
2738 | Property { name: "color"; type: "QColor" } | |
2734 | Property { name: "labelBrush"; type: "QBrush" } |
|
2739 | Property { name: "labelBrush"; type: "QBrush" } | |
2735 | Property { name: "labelColor"; type: "QColor" } |
|
2740 | Property { name: "labelColor"; type: "QColor" } | |
2736 | Property { name: "labelFont"; type: "QFont" } |
|
2741 | Property { name: "labelFont"; type: "QFont" } | |
2737 | Property { name: "labelArmLengthFactor"; type: "double" } |
|
2742 | Property { name: "labelArmLengthFactor"; type: "double" } | |
2738 | Property { name: "explodeDistanceFactor"; type: "double" } |
|
2743 | Property { name: "explodeDistanceFactor"; type: "double" } | |
2739 | Property { name: "percentage"; type: "double"; isReadonly: true } |
|
2744 | Property { name: "percentage"; type: "double"; isReadonly: true } | |
2740 | Property { name: "startAngle"; type: "double"; isReadonly: true } |
|
2745 | Property { name: "startAngle"; type: "double"; isReadonly: true } | |
2741 | Property { name: "angleSpan"; type: "double"; isReadonly: true } |
|
2746 | Property { name: "angleSpan"; type: "double"; isReadonly: true } | |
2742 | Signal { name: "clicked" } |
|
2747 | Signal { name: "clicked" } | |
2743 | Signal { |
|
2748 | Signal { | |
2744 | name: "hovered" |
|
2749 | name: "hovered" | |
2745 | Parameter { name: "state"; type: "bool" } |
|
2750 | Parameter { name: "state"; type: "bool" } | |
2746 | } |
|
2751 | } | |
2747 | Signal { name: "pressed" } |
|
2752 | Signal { name: "pressed" } | |
2748 | Signal { name: "released" } |
|
2753 | Signal { name: "released" } | |
2749 | Signal { name: "doubleClicked" } |
|
2754 | Signal { name: "doubleClicked" } | |
2750 | } |
|
2755 | } | |
2751 | Component { |
|
2756 | Component { | |
2752 | name: "QtCharts::QScatterSeries" |
|
2757 | name: "QtCharts::QScatterSeries" | |
2753 | prototype: "QtCharts::QXYSeries" |
|
2758 | prototype: "QtCharts::QXYSeries" | |
2754 | Enum { |
|
2759 | Enum { | |
2755 | name: "MarkerShape" |
|
2760 | name: "MarkerShape" | |
2756 | values: { |
|
2761 | values: { | |
2757 | "MarkerShapeCircle": 0, |
|
2762 | "MarkerShapeCircle": 0, | |
2758 | "MarkerShapeRectangle": 1 |
|
2763 | "MarkerShapeRectangle": 1 | |
2759 | } |
|
2764 | } | |
2760 | } |
|
2765 | } | |
2761 | Property { name: "color"; type: "QColor" } |
|
2766 | Property { name: "color"; type: "QColor" } | |
2762 | Property { name: "borderColor"; type: "QColor" } |
|
2767 | Property { name: "borderColor"; type: "QColor" } | |
2763 | Property { name: "markerShape"; type: "MarkerShape" } |
|
2768 | Property { name: "markerShape"; type: "MarkerShape" } | |
2764 | Property { name: "markerSize"; type: "double" } |
|
2769 | Property { name: "markerSize"; type: "double" } | |
2765 | Property { name: "brush"; type: "QBrush" } |
|
2770 | Property { name: "brush"; type: "QBrush" } | |
2766 | Signal { |
|
2771 | Signal { | |
2767 | name: "colorChanged" |
|
2772 | name: "colorChanged" | |
2768 | Parameter { name: "color"; type: "QColor" } |
|
2773 | Parameter { name: "color"; type: "QColor" } | |
2769 | } |
|
2774 | } | |
2770 | Signal { |
|
2775 | Signal { | |
2771 | name: "borderColorChanged" |
|
2776 | name: "borderColorChanged" | |
2772 | Parameter { name: "color"; type: "QColor" } |
|
2777 | Parameter { name: "color"; type: "QColor" } | |
2773 | } |
|
2778 | } | |
2774 | } |
|
2779 | } | |
2775 | Component { name: "QtCharts::QSplineSeries"; prototype: "QtCharts::QLineSeries" } |
|
2780 | Component { name: "QtCharts::QSplineSeries"; prototype: "QtCharts::QLineSeries" } | |
2776 | Component { name: "QtCharts::QStackedBarSeries"; prototype: "QtCharts::QAbstractBarSeries" } |
|
2781 | Component { name: "QtCharts::QStackedBarSeries"; prototype: "QtCharts::QAbstractBarSeries" } | |
2777 | Component { |
|
2782 | Component { | |
2778 | name: "QtCharts::QVBarModelMapper" |
|
2783 | name: "QtCharts::QVBarModelMapper" | |
2779 | prototype: "QtCharts::QBarModelMapper" |
|
2784 | prototype: "QtCharts::QBarModelMapper" | |
2780 | exports: [ |
|
2785 | exports: [ | |
2781 | "QtCharts/VBarModelMapper 1.0", |
|
2786 | "QtCharts/VBarModelMapper 1.0", | |
2782 | "QtCharts/VBarModelMapper 2.0" |
|
2787 | "QtCharts/VBarModelMapper 2.0" | |
2783 | ] |
|
2788 | ] | |
2784 | exportMetaObjectRevisions: [0, 0] |
|
2789 | exportMetaObjectRevisions: [0, 0] | |
2785 | Property { name: "series"; type: "QAbstractBarSeries"; isPointer: true } |
|
2790 | Property { name: "series"; type: "QAbstractBarSeries"; isPointer: true } | |
2786 | Property { name: "model"; type: "QAbstractItemModel"; isPointer: true } |
|
2791 | Property { name: "model"; type: "QAbstractItemModel"; isPointer: true } | |
2787 | Property { name: "firstBarSetColumn"; type: "int" } |
|
2792 | Property { name: "firstBarSetColumn"; type: "int" } | |
2788 | Property { name: "lastBarSetColumn"; type: "int" } |
|
2793 | Property { name: "lastBarSetColumn"; type: "int" } | |
2789 | Property { name: "firstRow"; type: "int" } |
|
2794 | Property { name: "firstRow"; type: "int" } | |
2790 | Property { name: "rowCount"; type: "int" } |
|
2795 | Property { name: "rowCount"; type: "int" } | |
2791 | Signal { name: "seriesReplaced" } |
|
2796 | Signal { name: "seriesReplaced" } | |
2792 | Signal { name: "modelReplaced" } |
|
2797 | Signal { name: "modelReplaced" } | |
2793 | } |
|
2798 | } | |
2794 | Component { |
|
2799 | Component { | |
2795 | name: "QtCharts::QVBoxPlotModelMapper" |
|
2800 | name: "QtCharts::QVBoxPlotModelMapper" | |
2796 | prototype: "QtCharts::QBoxPlotModelMapper" |
|
2801 | prototype: "QtCharts::QBoxPlotModelMapper" | |
2797 | exports: ["QtCharts/VBoxPlotModelMapper 2.0"] |
|
2802 | exports: ["QtCharts/VBoxPlotModelMapper 2.0"] | |
2798 | exportMetaObjectRevisions: [0] |
|
2803 | exportMetaObjectRevisions: [0] | |
2799 | Property { name: "series"; type: "QBoxPlotSeries"; isPointer: true } |
|
2804 | Property { name: "series"; type: "QBoxPlotSeries"; isPointer: true } | |
2800 | Property { name: "model"; type: "QAbstractItemModel"; isPointer: true } |
|
2805 | Property { name: "model"; type: "QAbstractItemModel"; isPointer: true } | |
2801 | Property { name: "firstBoxSetColumn"; type: "int" } |
|
2806 | Property { name: "firstBoxSetColumn"; type: "int" } | |
2802 | Property { name: "lastBoxSetColumn"; type: "int" } |
|
2807 | Property { name: "lastBoxSetColumn"; type: "int" } | |
2803 | Property { name: "firstRow"; type: "int" } |
|
2808 | Property { name: "firstRow"; type: "int" } | |
2804 | Property { name: "rowCount"; type: "int" } |
|
2809 | Property { name: "rowCount"; type: "int" } | |
2805 | Signal { name: "seriesReplaced" } |
|
2810 | Signal { name: "seriesReplaced" } | |
2806 | Signal { name: "modelReplaced" } |
|
2811 | Signal { name: "modelReplaced" } | |
2807 | } |
|
2812 | } | |
2808 | Component { |
|
2813 | Component { | |
2809 | name: "QtCharts::QVPieModelMapper" |
|
2814 | name: "QtCharts::QVPieModelMapper" | |
2810 | prototype: "QtCharts::QPieModelMapper" |
|
2815 | prototype: "QtCharts::QPieModelMapper" | |
2811 | exports: [ |
|
2816 | exports: [ | |
2812 | "QtCharts/VPieModelMapper 1.0", |
|
2817 | "QtCharts/VPieModelMapper 1.0", | |
2813 | "QtCharts/VPieModelMapper 2.0" |
|
2818 | "QtCharts/VPieModelMapper 2.0" | |
2814 | ] |
|
2819 | ] | |
2815 | exportMetaObjectRevisions: [0, 0] |
|
2820 | exportMetaObjectRevisions: [0, 0] | |
2816 | Property { name: "series"; type: "QPieSeries"; isPointer: true } |
|
2821 | Property { name: "series"; type: "QPieSeries"; isPointer: true } | |
2817 | Property { name: "model"; type: "QAbstractItemModel"; isPointer: true } |
|
2822 | Property { name: "model"; type: "QAbstractItemModel"; isPointer: true } | |
2818 | Property { name: "valuesColumn"; type: "int" } |
|
2823 | Property { name: "valuesColumn"; type: "int" } | |
2819 | Property { name: "labelsColumn"; type: "int" } |
|
2824 | Property { name: "labelsColumn"; type: "int" } | |
2820 | Property { name: "firstRow"; type: "int" } |
|
2825 | Property { name: "firstRow"; type: "int" } | |
2821 | Property { name: "rowCount"; type: "int" } |
|
2826 | Property { name: "rowCount"; type: "int" } | |
2822 | Signal { name: "seriesReplaced" } |
|
2827 | Signal { name: "seriesReplaced" } | |
2823 | Signal { name: "modelReplaced" } |
|
2828 | Signal { name: "modelReplaced" } | |
2824 | } |
|
2829 | } | |
2825 | Component { |
|
2830 | Component { | |
2826 | name: "QtCharts::QVXYModelMapper" |
|
2831 | name: "QtCharts::QVXYModelMapper" | |
2827 | prototype: "QtCharts::QXYModelMapper" |
|
2832 | prototype: "QtCharts::QXYModelMapper" | |
2828 | exports: [ |
|
2833 | exports: [ | |
2829 | "QtCharts/VXYModelMapper 1.0", |
|
2834 | "QtCharts/VXYModelMapper 1.0", | |
2830 | "QtCharts/VXYModelMapper 2.0" |
|
2835 | "QtCharts/VXYModelMapper 2.0" | |
2831 | ] |
|
2836 | ] | |
2832 | exportMetaObjectRevisions: [0, 0] |
|
2837 | exportMetaObjectRevisions: [0, 0] | |
2833 | Property { name: "series"; type: "QXYSeries"; isPointer: true } |
|
2838 | Property { name: "series"; type: "QXYSeries"; isPointer: true } | |
2834 | Property { name: "model"; type: "QAbstractItemModel"; isPointer: true } |
|
2839 | Property { name: "model"; type: "QAbstractItemModel"; isPointer: true } | |
2835 | Property { name: "xColumn"; type: "int" } |
|
2840 | Property { name: "xColumn"; type: "int" } | |
2836 | Property { name: "yColumn"; type: "int" } |
|
2841 | Property { name: "yColumn"; type: "int" } | |
2837 | Property { name: "firstRow"; type: "int" } |
|
2842 | Property { name: "firstRow"; type: "int" } | |
2838 | Property { name: "rowCount"; type: "int" } |
|
2843 | Property { name: "rowCount"; type: "int" } | |
2839 | Signal { name: "seriesReplaced" } |
|
2844 | Signal { name: "seriesReplaced" } | |
2840 | Signal { name: "modelReplaced" } |
|
2845 | Signal { name: "modelReplaced" } | |
2841 | } |
|
2846 | } | |
2842 | Component { |
|
2847 | Component { | |
2843 | name: "QtCharts::QValueAxis" |
|
2848 | name: "QtCharts::QValueAxis" | |
2844 | prototype: "QtCharts::QAbstractAxis" |
|
2849 | prototype: "QtCharts::QAbstractAxis" | |
2845 | exports: [ |
|
2850 | exports: [ | |
2846 | "QtCharts/ValueAxis 1.1", |
|
2851 | "QtCharts/ValueAxis 1.1", | |
2847 | "QtCharts/ValueAxis 2.0", |
|
2852 | "QtCharts/ValueAxis 2.0", | |
2848 | "QtCharts/ValuesAxis 1.0" |
|
2853 | "QtCharts/ValuesAxis 1.0" | |
2849 | ] |
|
2854 | ] | |
2850 | exportMetaObjectRevisions: [0, 0, 0] |
|
2855 | exportMetaObjectRevisions: [0, 0, 0] | |
2851 | Property { name: "tickCount"; type: "int" } |
|
2856 | Property { name: "tickCount"; type: "int" } | |
2852 | Property { name: "min"; type: "double" } |
|
2857 | Property { name: "min"; type: "double" } | |
2853 | Property { name: "max"; type: "double" } |
|
2858 | Property { name: "max"; type: "double" } | |
2854 | Property { name: "labelFormat"; type: "string" } |
|
2859 | Property { name: "labelFormat"; type: "string" } | |
2855 | Property { name: "minorTickCount"; type: "int" } |
|
2860 | Property { name: "minorTickCount"; type: "int" } | |
2856 | Signal { |
|
2861 | Signal { | |
2857 | name: "minChanged" |
|
2862 | name: "minChanged" | |
2858 | Parameter { name: "min"; type: "double" } |
|
2863 | Parameter { name: "min"; type: "double" } | |
2859 | } |
|
2864 | } | |
2860 | Signal { |
|
2865 | Signal { | |
2861 | name: "maxChanged" |
|
2866 | name: "maxChanged" | |
2862 | Parameter { name: "max"; type: "double" } |
|
2867 | Parameter { name: "max"; type: "double" } | |
2863 | } |
|
2868 | } | |
2864 | Signal { |
|
2869 | Signal { | |
2865 | name: "rangeChanged" |
|
2870 | name: "rangeChanged" | |
2866 | Parameter { name: "min"; type: "double" } |
|
2871 | Parameter { name: "min"; type: "double" } | |
2867 | Parameter { name: "max"; type: "double" } |
|
2872 | Parameter { name: "max"; type: "double" } | |
2868 | } |
|
2873 | } | |
2869 | Signal { |
|
2874 | Signal { | |
2870 | name: "tickCountChanged" |
|
2875 | name: "tickCountChanged" | |
2871 | Parameter { name: "tickCount"; type: "int" } |
|
2876 | Parameter { name: "tickCount"; type: "int" } | |
2872 | } |
|
2877 | } | |
2873 | Signal { |
|
2878 | Signal { | |
2874 | name: "minorTickCountChanged" |
|
2879 | name: "minorTickCountChanged" | |
2875 | Parameter { name: "tickCount"; type: "int" } |
|
2880 | Parameter { name: "tickCount"; type: "int" } | |
2876 | } |
|
2881 | } | |
2877 | Signal { |
|
2882 | Signal { | |
2878 | name: "labelFormatChanged" |
|
2883 | name: "labelFormatChanged" | |
2879 | Parameter { name: "format"; type: "string" } |
|
2884 | Parameter { name: "format"; type: "string" } | |
2880 | } |
|
2885 | } | |
2881 | Method { name: "applyNiceNumbers" } |
|
2886 | Method { name: "applyNiceNumbers" } | |
2882 | } |
|
2887 | } | |
2883 | Component { |
|
2888 | Component { | |
2884 | name: "QtCharts::QXYModelMapper" |
|
2889 | name: "QtCharts::QXYModelMapper" | |
2885 | prototype: "QObject" |
|
2890 | prototype: "QObject" | |
2886 | exports: ["QtCharts/XYModelMapper 1.0", "QtCharts/XYModelMapper 2.0"] |
|
2891 | exports: ["QtCharts/XYModelMapper 1.0", "QtCharts/XYModelMapper 2.0"] | |
2887 | isCreatable: false |
|
2892 | isCreatable: false | |
2888 | exportMetaObjectRevisions: [0, 0] |
|
2893 | exportMetaObjectRevisions: [0, 0] | |
2889 | } |
|
2894 | } | |
2890 | Component { |
|
2895 | Component { | |
2891 | name: "QtCharts::QXYSeries" |
|
2896 | name: "QtCharts::QXYSeries" | |
2892 | prototype: "QtCharts::QAbstractSeries" |
|
2897 | prototype: "QtCharts::QAbstractSeries" | |
2893 | exports: ["QtCharts/XYSeries 1.0", "QtCharts/XYSeries 2.0"] |
|
2898 | exports: ["QtCharts/XYSeries 1.0", "QtCharts/XYSeries 2.0"] | |
2894 | isCreatable: false |
|
2899 | isCreatable: false | |
2895 | exportMetaObjectRevisions: [0, 0] |
|
2900 | exportMetaObjectRevisions: [0, 0] | |
2896 | Property { name: "pointsVisible"; type: "bool" } |
|
2901 | Property { name: "pointsVisible"; type: "bool" } | |
2897 | Property { name: "color"; type: "QColor" } |
|
2902 | Property { name: "color"; type: "QColor" } | |
2898 | Property { name: "pointLabelsFormat"; type: "string" } |
|
2903 | Property { name: "pointLabelsFormat"; type: "string" } | |
2899 | Property { name: "pointLabelsVisible"; type: "bool" } |
|
2904 | Property { name: "pointLabelsVisible"; type: "bool" } | |
2900 | Property { name: "pointLabelsFont"; type: "QFont" } |
|
2905 | Property { name: "pointLabelsFont"; type: "QFont" } | |
2901 | Property { name: "pointLabelsColor"; type: "QColor" } |
|
2906 | Property { name: "pointLabelsColor"; type: "QColor" } | |
|
2907 | Property { name: "pointLabelsClipping"; type: "bool" } | |||
2902 | Signal { |
|
2908 | Signal { | |
2903 | name: "clicked" |
|
2909 | name: "clicked" | |
2904 | Parameter { name: "point"; type: "QPointF" } |
|
2910 | Parameter { name: "point"; type: "QPointF" } | |
2905 | } |
|
2911 | } | |
2906 | Signal { |
|
2912 | Signal { | |
2907 | name: "hovered" |
|
2913 | name: "hovered" | |
2908 | Parameter { name: "point"; type: "QPointF" } |
|
2914 | Parameter { name: "point"; type: "QPointF" } | |
2909 | Parameter { name: "state"; type: "bool" } |
|
2915 | Parameter { name: "state"; type: "bool" } | |
2910 | } |
|
2916 | } | |
2911 | Signal { |
|
2917 | Signal { | |
2912 | name: "pressed" |
|
2918 | name: "pressed" | |
2913 | Parameter { name: "point"; type: "QPointF" } |
|
2919 | Parameter { name: "point"; type: "QPointF" } | |
2914 | } |
|
2920 | } | |
2915 | Signal { |
|
2921 | Signal { | |
2916 | name: "released" |
|
2922 | name: "released" | |
2917 | Parameter { name: "point"; type: "QPointF" } |
|
2923 | Parameter { name: "point"; type: "QPointF" } | |
2918 | } |
|
2924 | } | |
2919 | Signal { |
|
2925 | Signal { | |
2920 | name: "doubleClicked" |
|
2926 | name: "doubleClicked" | |
2921 | Parameter { name: "point"; type: "QPointF" } |
|
2927 | Parameter { name: "point"; type: "QPointF" } | |
2922 | } |
|
2928 | } | |
2923 | Signal { |
|
2929 | Signal { | |
2924 | name: "pointReplaced" |
|
2930 | name: "pointReplaced" | |
2925 | Parameter { name: "index"; type: "int" } |
|
2931 | Parameter { name: "index"; type: "int" } | |
2926 | } |
|
2932 | } | |
2927 | Signal { |
|
2933 | Signal { | |
2928 | name: "pointRemoved" |
|
2934 | name: "pointRemoved" | |
2929 | Parameter { name: "index"; type: "int" } |
|
2935 | Parameter { name: "index"; type: "int" } | |
2930 | } |
|
2936 | } | |
2931 | Signal { |
|
2937 | Signal { | |
2932 | name: "pointAdded" |
|
2938 | name: "pointAdded" | |
2933 | Parameter { name: "index"; type: "int" } |
|
2939 | Parameter { name: "index"; type: "int" } | |
2934 | } |
|
2940 | } | |
2935 | Signal { |
|
2941 | Signal { | |
2936 | name: "colorChanged" |
|
2942 | name: "colorChanged" | |
2937 | Parameter { name: "color"; type: "QColor" } |
|
2943 | Parameter { name: "color"; type: "QColor" } | |
2938 | } |
|
2944 | } | |
2939 | Signal { name: "pointsReplaced" } |
|
2945 | Signal { name: "pointsReplaced" } | |
2940 | Signal { |
|
2946 | Signal { | |
2941 | name: "pointLabelsFormatChanged" |
|
2947 | name: "pointLabelsFormatChanged" | |
2942 | Parameter { name: "format"; type: "string" } |
|
2948 | Parameter { name: "format"; type: "string" } | |
2943 | } |
|
2949 | } | |
2944 | Signal { |
|
2950 | Signal { | |
2945 | name: "pointLabelsVisibilityChanged" |
|
2951 | name: "pointLabelsVisibilityChanged" | |
2946 | Parameter { name: "visible"; type: "bool" } |
|
2952 | Parameter { name: "visible"; type: "bool" } | |
2947 | } |
|
2953 | } | |
2948 | Signal { |
|
2954 | Signal { | |
2949 | name: "pointLabelsFontChanged" |
|
2955 | name: "pointLabelsFontChanged" | |
2950 | Parameter { name: "font"; type: "QFont" } |
|
2956 | Parameter { name: "font"; type: "QFont" } | |
2951 | } |
|
2957 | } | |
2952 | Signal { |
|
2958 | Signal { | |
2953 | name: "pointLabelsColorChanged" |
|
2959 | name: "pointLabelsColorChanged" | |
2954 | Parameter { name: "color"; type: "QColor" } |
|
2960 | Parameter { name: "color"; type: "QColor" } | |
2955 | } |
|
2961 | } | |
2956 | Signal { |
|
2962 | Signal { | |
|
2963 | name: "pointLabelsClippingChanged" | |||
|
2964 | Parameter { name: "clipping"; type: "bool" } | |||
|
2965 | } | |||
|
2966 | Signal { | |||
2957 | name: "pointsRemoved" |
|
2967 | name: "pointsRemoved" | |
2958 | Parameter { name: "index"; type: "int" } |
|
2968 | Parameter { name: "index"; type: "int" } | |
2959 | Parameter { name: "count"; type: "int" } |
|
2969 | Parameter { name: "count"; type: "int" } | |
2960 | } |
|
2970 | } | |
2961 | } |
|
2971 | } | |
2962 | } |
|
2972 | } |
@@ -1,227 +1,228 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
3 | ** Copyright (C) 2015 The Qt Company Ltd | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Charts module. |
|
7 | ** This file is part of the Qt Charts module. | |
8 | ** |
|
8 | ** | |
9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
9 | ** Licensees holding valid commercial license for Qt may use this file in | |
10 | ** accordance with the Qt License Agreement provided with the Software |
|
10 | ** accordance with the Qt License Agreement provided with the Software | |
11 | ** or, alternatively, in accordance with the terms contained in a written |
|
11 | ** or, alternatively, in accordance with the terms contained in a written | |
12 | ** agreement between you and The Qt Company. |
|
12 | ** agreement between you and The Qt Company. | |
13 | ** |
|
13 | ** | |
14 | ** If you have questions regarding the use of this file, please use |
|
14 | ** If you have questions regarding the use of this file, please use | |
15 | ** contact form at http://qt.io |
|
15 | ** contact form at http://qt.io | |
16 | ** |
|
16 | ** | |
17 | ****************************************************************************/ |
|
17 | ****************************************************************************/ | |
18 |
|
18 | |||
19 | #include "../qxyseries/tst_qxyseries.h" |
|
19 | #include "../qxyseries/tst_qxyseries.h" | |
20 | #include <QtCharts/QLineSeries> |
|
20 | #include <QtCharts/QLineSeries> | |
21 |
|
21 | |||
22 |
|
22 | |||
23 | Q_DECLARE_METATYPE(QList<QPointF>) |
|
23 | Q_DECLARE_METATYPE(QList<QPointF>) | |
24 |
|
24 | |||
25 | class tst_QLineSeries : public tst_QXYSeries |
|
25 | class tst_QLineSeries : public tst_QXYSeries | |
26 | { |
|
26 | { | |
27 | Q_OBJECT |
|
27 | Q_OBJECT | |
28 |
|
28 | |||
29 | public slots: |
|
29 | public slots: | |
30 | void initTestCase(); |
|
30 | void initTestCase(); | |
31 | void cleanupTestCase(); |
|
31 | void cleanupTestCase(); | |
32 | void init(); |
|
32 | void init(); | |
33 | void cleanup(); |
|
33 | void cleanup(); | |
34 | private slots: |
|
34 | private slots: | |
35 | void qlineseries_data(); |
|
35 | void qlineseries_data(); | |
36 | void qlineseries(); |
|
36 | void qlineseries(); | |
37 | void pressedSignal(); |
|
37 | void pressedSignal(); | |
38 | void releasedSignal(); |
|
38 | void releasedSignal(); | |
39 | void doubleClickedSignal(); |
|
39 | void doubleClickedSignal(); | |
40 | void insert(); |
|
40 | void insert(); | |
41 | protected: |
|
41 | protected: | |
42 | void pointsVisible_data(); |
|
42 | void pointsVisible_data(); | |
43 | }; |
|
43 | }; | |
44 |
|
44 | |||
45 | void tst_QLineSeries::initTestCase() |
|
45 | void tst_QLineSeries::initTestCase() | |
46 | { |
|
46 | { | |
47 | } |
|
47 | } | |
48 |
|
48 | |||
49 | void tst_QLineSeries::cleanupTestCase() |
|
49 | void tst_QLineSeries::cleanupTestCase() | |
50 | { |
|
50 | { | |
51 | QTest::qWait(1); // Allow final deleteLaters to run |
|
51 | QTest::qWait(1); // Allow final deleteLaters to run | |
52 | } |
|
52 | } | |
53 |
|
53 | |||
54 | void tst_QLineSeries::init() |
|
54 | void tst_QLineSeries::init() | |
55 | { |
|
55 | { | |
56 | tst_QXYSeries::init(); |
|
56 | tst_QXYSeries::init(); | |
57 | m_series = new QLineSeries(); |
|
57 | m_series = new QLineSeries(); | |
58 | } |
|
58 | } | |
59 |
|
59 | |||
60 | void tst_QLineSeries::cleanup() |
|
60 | void tst_QLineSeries::cleanup() | |
61 | { |
|
61 | { | |
62 | delete m_series; |
|
62 | delete m_series; | |
63 | m_series=0; |
|
63 | m_series=0; | |
64 | tst_QXYSeries::cleanup(); |
|
64 | tst_QXYSeries::cleanup(); | |
65 | } |
|
65 | } | |
66 |
|
66 | |||
67 | void tst_QLineSeries::qlineseries_data() |
|
67 | void tst_QLineSeries::qlineseries_data() | |
68 | { |
|
68 | { | |
69 |
|
69 | |||
70 | } |
|
70 | } | |
71 |
|
71 | |||
72 | void tst_QLineSeries::qlineseries() |
|
72 | void tst_QLineSeries::qlineseries() | |
73 | { |
|
73 | { | |
74 | QLineSeries series; |
|
74 | QLineSeries series; | |
75 |
|
75 | |||
76 | QCOMPARE(series.count(),0); |
|
76 | QCOMPARE(series.count(),0); | |
77 | QCOMPARE(series.brush(), QBrush()); |
|
77 | QCOMPARE(series.brush(), QBrush()); | |
78 | QCOMPARE(series.points(), QList<QPointF>()); |
|
78 | QCOMPARE(series.points(), QList<QPointF>()); | |
79 | QCOMPARE(series.pen(), QPen()); |
|
79 | QCOMPARE(series.pen(), QPen()); | |
80 | QCOMPARE(series.pointsVisible(), false); |
|
80 | QCOMPARE(series.pointsVisible(), false); | |
81 | QCOMPARE(series.pointLabelsVisible(), false); |
|
81 | QCOMPARE(series.pointLabelsVisible(), false); | |
82 | QCOMPARE(series.pointLabelsFormat(), QLatin1String("@xPoint, @yPoint")); |
|
82 | QCOMPARE(series.pointLabelsFormat(), QLatin1String("@xPoint, @yPoint")); | |
|
83 | QCOMPARE(series.pointLabelsClipping(), true); | |||
83 |
|
84 | |||
84 | series.append(QList<QPointF>()); |
|
85 | series.append(QList<QPointF>()); | |
85 | series.append(0.0,0.0); |
|
86 | series.append(0.0,0.0); | |
86 | series.append(QPointF()); |
|
87 | series.append(QPointF()); | |
87 |
|
88 | |||
88 | series.remove(0.0,0.0); |
|
89 | series.remove(0.0,0.0); | |
89 | series.remove(QPointF()); |
|
90 | series.remove(QPointF()); | |
90 | series.clear(); |
|
91 | series.clear(); | |
91 |
|
92 | |||
92 | series.replace(QPointF(),QPointF()); |
|
93 | series.replace(QPointF(),QPointF()); | |
93 | series.replace(0,0,0,0); |
|
94 | series.replace(0,0,0,0); | |
94 | series.setBrush(QBrush()); |
|
95 | series.setBrush(QBrush()); | |
95 |
|
96 | |||
96 | series.setPen(QPen()); |
|
97 | series.setPen(QPen()); | |
97 | series.setPointsVisible(false); |
|
98 | series.setPointsVisible(false); | |
98 |
|
99 | |||
99 | series.setPointLabelsVisible(false); |
|
100 | series.setPointLabelsVisible(false); | |
100 | series.setPointLabelsFormat(QString()); |
|
101 | series.setPointLabelsFormat(QString()); | |
101 |
|
102 | |||
102 | m_chart->addSeries(&series); |
|
103 | m_chart->addSeries(&series); | |
103 | m_view->show(); |
|
104 | m_view->show(); | |
104 | QTest::qWaitForWindowShown(m_view); |
|
105 | QTest::qWaitForWindowShown(m_view); | |
105 | } |
|
106 | } | |
106 |
|
107 | |||
107 | void tst_QLineSeries::pressedSignal() |
|
108 | void tst_QLineSeries::pressedSignal() | |
108 | { |
|
109 | { | |
109 | SKIP_IF_CANNOT_TEST_MOUSE_EVENTS(); |
|
110 | SKIP_IF_CANNOT_TEST_MOUSE_EVENTS(); | |
110 |
|
111 | |||
111 | QPointF linePoint(4, 12); |
|
112 | QPointF linePoint(4, 12); | |
112 | QLineSeries *lineSeries = new QLineSeries(); |
|
113 | QLineSeries *lineSeries = new QLineSeries(); | |
113 | lineSeries->append(QPointF(2, 1)); |
|
114 | lineSeries->append(QPointF(2, 1)); | |
114 | lineSeries->append(linePoint); |
|
115 | lineSeries->append(linePoint); | |
115 | lineSeries->append(QPointF(6, 12)); |
|
116 | lineSeries->append(QPointF(6, 12)); | |
116 |
|
117 | |||
117 | QChartView view; |
|
118 | QChartView view; | |
118 | view.chart()->legend()->setVisible(false); |
|
119 | view.chart()->legend()->setVisible(false); | |
119 | view.chart()->addSeries(lineSeries); |
|
120 | view.chart()->addSeries(lineSeries); | |
120 | view.show(); |
|
121 | view.show(); | |
121 | QTest::qWaitForWindowShown(&view); |
|
122 | QTest::qWaitForWindowShown(&view); | |
122 |
|
123 | |||
123 | QSignalSpy seriesSpy(lineSeries, SIGNAL(pressed(QPointF))); |
|
124 | QSignalSpy seriesSpy(lineSeries, SIGNAL(pressed(QPointF))); | |
124 |
|
125 | |||
125 | QPointF checkPoint = view.chart()->mapToPosition(linePoint); |
|
126 | QPointF checkPoint = view.chart()->mapToPosition(linePoint); | |
126 | QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, checkPoint.toPoint()); |
|
127 | QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, checkPoint.toPoint()); | |
127 | QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); |
|
128 | QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); | |
128 |
|
129 | |||
129 | QCOMPARE(seriesSpy.count(), 1); |
|
130 | QCOMPARE(seriesSpy.count(), 1); | |
130 | QList<QVariant> seriesSpyArg = seriesSpy.takeFirst(); |
|
131 | QList<QVariant> seriesSpyArg = seriesSpy.takeFirst(); | |
131 | // checkPoint is QPointF and for the mouseClick it it's changed to QPoint |
|
132 | // checkPoint is QPointF and for the mouseClick it it's changed to QPoint | |
132 | // this causes small distinction in decimals so we round it before comparing |
|
133 | // this causes small distinction in decimals so we round it before comparing | |
133 | QPointF signalPoint = qvariant_cast<QPointF>(seriesSpyArg.at(0)); |
|
134 | QPointF signalPoint = qvariant_cast<QPointF>(seriesSpyArg.at(0)); | |
134 | QCOMPARE(qRound(signalPoint.x()), qRound(linePoint.x())); |
|
135 | QCOMPARE(qRound(signalPoint.x()), qRound(linePoint.x())); | |
135 | QCOMPARE(qRound(signalPoint.y()), qRound(linePoint.y())); |
|
136 | QCOMPARE(qRound(signalPoint.y()), qRound(linePoint.y())); | |
136 | } |
|
137 | } | |
137 |
|
138 | |||
138 | void tst_QLineSeries::releasedSignal() |
|
139 | void tst_QLineSeries::releasedSignal() | |
139 | { |
|
140 | { | |
140 | SKIP_IF_CANNOT_TEST_MOUSE_EVENTS(); |
|
141 | SKIP_IF_CANNOT_TEST_MOUSE_EVENTS(); | |
141 |
|
142 | |||
142 | QPointF linePoint(4, 12); |
|
143 | QPointF linePoint(4, 12); | |
143 | QLineSeries *lineSeries = new QLineSeries(); |
|
144 | QLineSeries *lineSeries = new QLineSeries(); | |
144 | lineSeries->append(QPointF(2, 20)); |
|
145 | lineSeries->append(QPointF(2, 20)); | |
145 | lineSeries->append(linePoint); |
|
146 | lineSeries->append(linePoint); | |
146 | lineSeries->append(QPointF(6, 12)); |
|
147 | lineSeries->append(QPointF(6, 12)); | |
147 |
|
148 | |||
148 | QChartView view; |
|
149 | QChartView view; | |
149 | view.chart()->legend()->setVisible(false); |
|
150 | view.chart()->legend()->setVisible(false); | |
150 | view.chart()->addSeries(lineSeries); |
|
151 | view.chart()->addSeries(lineSeries); | |
151 | view.show(); |
|
152 | view.show(); | |
152 | QTest::qWaitForWindowShown(&view); |
|
153 | QTest::qWaitForWindowShown(&view); | |
153 |
|
154 | |||
154 | QSignalSpy seriesSpy(lineSeries, SIGNAL(released(QPointF))); |
|
155 | QSignalSpy seriesSpy(lineSeries, SIGNAL(released(QPointF))); | |
155 |
|
156 | |||
156 | QPointF checkPoint = view.chart()->mapToPosition(linePoint); |
|
157 | QPointF checkPoint = view.chart()->mapToPosition(linePoint); | |
157 | QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, checkPoint.toPoint()); |
|
158 | QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, checkPoint.toPoint()); | |
158 | QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); |
|
159 | QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); | |
159 |
|
160 | |||
160 | QCOMPARE(seriesSpy.count(), 1); |
|
161 | QCOMPARE(seriesSpy.count(), 1); | |
161 | QList<QVariant> seriesSpyArg = seriesSpy.takeFirst(); |
|
162 | QList<QVariant> seriesSpyArg = seriesSpy.takeFirst(); | |
162 | // checkPoint is QPointF and for the mouseClick it it's changed to QPoint |
|
163 | // checkPoint is QPointF and for the mouseClick it it's changed to QPoint | |
163 | // this causes small distinction in decimals so we round it before comparing |
|
164 | // this causes small distinction in decimals so we round it before comparing | |
164 | QPointF signalPoint = qvariant_cast<QPointF>(seriesSpyArg.at(0)); |
|
165 | QPointF signalPoint = qvariant_cast<QPointF>(seriesSpyArg.at(0)); | |
165 | QCOMPARE(qRound(signalPoint.x()), qRound(linePoint.x())); |
|
166 | QCOMPARE(qRound(signalPoint.x()), qRound(linePoint.x())); | |
166 | QCOMPARE(qRound(signalPoint.y()), qRound(linePoint.y())); |
|
167 | QCOMPARE(qRound(signalPoint.y()), qRound(linePoint.y())); | |
167 | } |
|
168 | } | |
168 |
|
169 | |||
169 | void tst_QLineSeries::insert() |
|
170 | void tst_QLineSeries::insert() | |
170 | { |
|
171 | { | |
171 | QLineSeries lineSeries; |
|
172 | QLineSeries lineSeries; | |
172 | QSignalSpy insertSpy(&lineSeries, &QXYSeries::pointAdded); |
|
173 | QSignalSpy insertSpy(&lineSeries, &QXYSeries::pointAdded); | |
173 | lineSeries.insert(0, QPoint(3, 3)); |
|
174 | lineSeries.insert(0, QPoint(3, 3)); | |
174 | QCOMPARE(insertSpy.count(), 1); |
|
175 | QCOMPARE(insertSpy.count(), 1); | |
175 | QVariantList arguments = insertSpy.takeFirst(); |
|
176 | QVariantList arguments = insertSpy.takeFirst(); | |
176 | QCOMPARE(arguments.first().toInt(), 0); |
|
177 | QCOMPARE(arguments.first().toInt(), 0); | |
177 | lineSeries.insert(0, QPoint(1, 1)); |
|
178 | lineSeries.insert(0, QPoint(1, 1)); | |
178 | arguments = insertSpy.takeFirst(); |
|
179 | arguments = insertSpy.takeFirst(); | |
179 | QCOMPARE(arguments.first().toInt(), 0); |
|
180 | QCOMPARE(arguments.first().toInt(), 0); | |
180 | lineSeries.insert(1, QPoint(2, 2)); |
|
181 | lineSeries.insert(1, QPoint(2, 2)); | |
181 | arguments = insertSpy.takeFirst(); |
|
182 | arguments = insertSpy.takeFirst(); | |
182 | QCOMPARE(arguments.first().toInt(), 1); |
|
183 | QCOMPARE(arguments.first().toInt(), 1); | |
183 | lineSeries.insert(42, QPoint(0, 0)); |
|
184 | lineSeries.insert(42, QPoint(0, 0)); | |
184 | arguments = insertSpy.takeFirst(); |
|
185 | arguments = insertSpy.takeFirst(); | |
185 | QCOMPARE(arguments.first().toInt(), 3); |
|
186 | QCOMPARE(arguments.first().toInt(), 3); | |
186 | lineSeries.insert(-42, QPoint(0, 0)); |
|
187 | lineSeries.insert(-42, QPoint(0, 0)); | |
187 | arguments = insertSpy.takeFirst(); |
|
188 | arguments = insertSpy.takeFirst(); | |
188 | QCOMPARE(arguments.first().toInt(), 0); |
|
189 | QCOMPARE(arguments.first().toInt(), 0); | |
189 | } |
|
190 | } | |
190 |
|
191 | |||
191 | void tst_QLineSeries::doubleClickedSignal() |
|
192 | void tst_QLineSeries::doubleClickedSignal() | |
192 | { |
|
193 | { | |
193 | SKIP_IF_CANNOT_TEST_MOUSE_EVENTS(); |
|
194 | SKIP_IF_CANNOT_TEST_MOUSE_EVENTS(); | |
194 |
|
195 | |||
195 | QPointF linePoint(4, 12); |
|
196 | QPointF linePoint(4, 12); | |
196 | QLineSeries *lineSeries = new QLineSeries(); |
|
197 | QLineSeries *lineSeries = new QLineSeries(); | |
197 | lineSeries->append(QPointF(2, 20)); |
|
198 | lineSeries->append(QPointF(2, 20)); | |
198 | lineSeries->append(linePoint); |
|
199 | lineSeries->append(linePoint); | |
199 | lineSeries->append(QPointF(6, 12)); |
|
200 | lineSeries->append(QPointF(6, 12)); | |
200 |
|
201 | |||
201 | QChartView view; |
|
202 | QChartView view; | |
202 | view.chart()->legend()->setVisible(false); |
|
203 | view.chart()->legend()->setVisible(false); | |
203 | view.chart()->addSeries(lineSeries); |
|
204 | view.chart()->addSeries(lineSeries); | |
204 | view.show(); |
|
205 | view.show(); | |
205 | QTest::qWaitForWindowShown(&view); |
|
206 | QTest::qWaitForWindowShown(&view); | |
206 |
|
207 | |||
207 | QSignalSpy seriesSpy(lineSeries, SIGNAL(doubleClicked(QPointF))); |
|
208 | QSignalSpy seriesSpy(lineSeries, SIGNAL(doubleClicked(QPointF))); | |
208 |
|
209 | |||
209 | QPointF checkPoint = view.chart()->mapToPosition(linePoint); |
|
210 | QPointF checkPoint = view.chart()->mapToPosition(linePoint); | |
210 | // mouseClick needed first to save the position |
|
211 | // mouseClick needed first to save the position | |
211 | QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, checkPoint.toPoint()); |
|
212 | QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, checkPoint.toPoint()); | |
212 | QTest::mouseDClick(view.viewport(), Qt::LeftButton, 0, checkPoint.toPoint()); |
|
213 | QTest::mouseDClick(view.viewport(), Qt::LeftButton, 0, checkPoint.toPoint()); | |
213 | QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); |
|
214 | QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); | |
214 |
|
215 | |||
215 | QCOMPARE(seriesSpy.count(), 1); |
|
216 | QCOMPARE(seriesSpy.count(), 1); | |
216 | QList<QVariant> seriesSpyArg = seriesSpy.takeFirst(); |
|
217 | QList<QVariant> seriesSpyArg = seriesSpy.takeFirst(); | |
217 | // checkPoint is QPointF and for the mouseClick it it's changed to QPoint |
|
218 | // checkPoint is QPointF and for the mouseClick it it's changed to QPoint | |
218 | // this causes small distinction in decimals so we round it before comparing |
|
219 | // this causes small distinction in decimals so we round it before comparing | |
219 | QPointF signalPoint = qvariant_cast<QPointF>(seriesSpyArg.at(0)); |
|
220 | QPointF signalPoint = qvariant_cast<QPointF>(seriesSpyArg.at(0)); | |
220 | QCOMPARE(qRound(signalPoint.x()), qRound(linePoint.x())); |
|
221 | QCOMPARE(qRound(signalPoint.x()), qRound(linePoint.x())); | |
221 | QCOMPARE(qRound(signalPoint.y()), qRound(linePoint.y())); |
|
222 | QCOMPARE(qRound(signalPoint.y()), qRound(linePoint.y())); | |
222 | } |
|
223 | } | |
223 |
|
224 | |||
224 | QTEST_MAIN(tst_QLineSeries) |
|
225 | QTEST_MAIN(tst_QLineSeries) | |
225 |
|
226 | |||
226 | #include "tst_qlineseries.moc" |
|
227 | #include "tst_qlineseries.moc" | |
227 |
|
228 |
@@ -1,624 +1,642 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
3 | ** Copyright (C) 2015 The Qt Company Ltd | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Charts module. |
|
7 | ** This file is part of the Qt Charts module. | |
8 | ** |
|
8 | ** | |
9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
9 | ** Licensees holding valid commercial license for Qt may use this file in | |
10 | ** accordance with the Qt License Agreement provided with the Software |
|
10 | ** accordance with the Qt License Agreement provided with the Software | |
11 | ** or, alternatively, in accordance with the terms contained in a written |
|
11 | ** or, alternatively, in accordance with the terms contained in a written | |
12 | ** agreement between you and The Qt Company. |
|
12 | ** agreement between you and The Qt Company. | |
13 | ** |
|
13 | ** | |
14 | ** If you have questions regarding the use of this file, please use |
|
14 | ** If you have questions regarding the use of this file, please use | |
15 | ** contact form at http://qt.io |
|
15 | ** contact form at http://qt.io | |
16 | ** |
|
16 | ** | |
17 | ****************************************************************************/ |
|
17 | ****************************************************************************/ | |
18 |
|
18 | |||
19 | #include "tst_qxyseries.h" |
|
19 | #include "tst_qxyseries.h" | |
20 |
|
20 | |||
21 | Q_DECLARE_METATYPE(QList<QPointF>) |
|
21 | Q_DECLARE_METATYPE(QList<QPointF>) | |
22 |
|
22 | |||
23 | void tst_QXYSeries::initTestCase() |
|
23 | void tst_QXYSeries::initTestCase() | |
24 | { |
|
24 | { | |
25 | } |
|
25 | } | |
26 |
|
26 | |||
27 | void tst_QXYSeries::cleanupTestCase() |
|
27 | void tst_QXYSeries::cleanupTestCase() | |
28 | { |
|
28 | { | |
29 | QTest::qWait(1); // Allow final deleteLaters to run |
|
29 | QTest::qWait(1); // Allow final deleteLaters to run | |
30 | } |
|
30 | } | |
31 |
|
31 | |||
32 | void tst_QXYSeries::init() |
|
32 | void tst_QXYSeries::init() | |
33 | { |
|
33 | { | |
34 | m_view = new QChartView(newQChartOrQPolarChart()); |
|
34 | m_view = new QChartView(newQChartOrQPolarChart()); | |
35 | m_chart = m_view->chart(); |
|
35 | m_chart = m_view->chart(); | |
36 | } |
|
36 | } | |
37 |
|
37 | |||
38 | void tst_QXYSeries::cleanup() |
|
38 | void tst_QXYSeries::cleanup() | |
39 | { |
|
39 | { | |
40 | delete m_view; |
|
40 | delete m_view; | |
41 | m_view = 0; |
|
41 | m_view = 0; | |
42 | m_chart = 0; |
|
42 | m_chart = 0; | |
43 | m_series = 0; |
|
43 | m_series = 0; | |
44 | } |
|
44 | } | |
45 |
|
45 | |||
46 | void tst_QXYSeries::seriesName() |
|
46 | void tst_QXYSeries::seriesName() | |
47 | { |
|
47 | { | |
48 | QSignalSpy nameSpy(m_series, SIGNAL(nameChanged())); |
|
48 | QSignalSpy nameSpy(m_series, SIGNAL(nameChanged())); | |
49 | QCOMPARE(m_series->name(), QString()); |
|
49 | QCOMPARE(m_series->name(), QString()); | |
50 | m_series->setName("seriesname"); |
|
50 | m_series->setName("seriesname"); | |
51 | QCOMPARE(m_series->name(), QString("seriesname")); |
|
51 | QCOMPARE(m_series->name(), QString("seriesname")); | |
52 | TRY_COMPARE(nameSpy.count(), 1); |
|
52 | TRY_COMPARE(nameSpy.count(), 1); | |
53 | } |
|
53 | } | |
54 |
|
54 | |||
55 | void tst_QXYSeries::seriesVisible() |
|
55 | void tst_QXYSeries::seriesVisible() | |
56 | { |
|
56 | { | |
57 | QSignalSpy visibleSpy(m_series, SIGNAL(visibleChanged())); |
|
57 | QSignalSpy visibleSpy(m_series, SIGNAL(visibleChanged())); | |
58 | QCOMPARE(m_series->isVisible(), true); |
|
58 | QCOMPARE(m_series->isVisible(), true); | |
59 | m_series->setVisible(false); |
|
59 | m_series->setVisible(false); | |
60 | QCOMPARE(m_series->isVisible(), false); |
|
60 | QCOMPARE(m_series->isVisible(), false); | |
61 | m_series->setVisible(true); |
|
61 | m_series->setVisible(true); | |
62 | TRY_COMPARE(visibleSpy.count(), 2); |
|
62 | TRY_COMPARE(visibleSpy.count(), 2); | |
63 | } |
|
63 | } | |
64 |
|
64 | |||
65 | void tst_QXYSeries::seriesOpacity() |
|
65 | void tst_QXYSeries::seriesOpacity() | |
66 | { |
|
66 | { | |
67 | QSignalSpy opacitySpy(m_series, SIGNAL(opacityChanged())); |
|
67 | QSignalSpy opacitySpy(m_series, SIGNAL(opacityChanged())); | |
68 | QCOMPARE(m_series->opacity(), 1.0); |
|
68 | QCOMPARE(m_series->opacity(), 1.0); | |
69 |
|
69 | |||
70 | m_series->setOpacity(0.5); |
|
70 | m_series->setOpacity(0.5); | |
71 | QCOMPARE(m_series->opacity(), 0.5); |
|
71 | QCOMPARE(m_series->opacity(), 0.5); | |
72 | QCOMPARE(opacitySpy.count(), 1); |
|
72 | QCOMPARE(opacitySpy.count(), 1); | |
73 |
|
73 | |||
74 | m_series->setOpacity(0.0); |
|
74 | m_series->setOpacity(0.0); | |
75 | QCOMPARE(m_series->opacity(), 0.0); |
|
75 | QCOMPARE(m_series->opacity(), 0.0); | |
76 | QCOMPARE(opacitySpy.count(), 2); |
|
76 | QCOMPARE(opacitySpy.count(), 2); | |
77 |
|
77 | |||
78 | m_series->setOpacity(1.0); |
|
78 | m_series->setOpacity(1.0); | |
79 | QCOMPARE(m_series->opacity(), 1.0); |
|
79 | QCOMPARE(m_series->opacity(), 1.0); | |
80 | QCOMPARE(opacitySpy.count(), 3); |
|
80 | QCOMPARE(opacitySpy.count(), 3); | |
81 | } |
|
81 | } | |
82 |
|
82 | |||
83 | void tst_QXYSeries::pointLabelsFormat() |
|
83 | void tst_QXYSeries::pointLabelsFormat() | |
84 | { |
|
84 | { | |
85 | QSignalSpy labelsFormatSpy(m_series, SIGNAL(pointLabelsFormatChanged(QString))); |
|
85 | QSignalSpy labelsFormatSpy(m_series, SIGNAL(pointLabelsFormatChanged(QString))); | |
86 | QCOMPARE(m_series->pointLabelsFormat(), QLatin1String("@xPoint, @yPoint")); |
|
86 | QCOMPARE(m_series->pointLabelsFormat(), QLatin1String("@xPoint, @yPoint")); | |
87 |
|
87 | |||
88 | QString format("@yPoint"); |
|
88 | QString format("@yPoint"); | |
89 | m_series->setPointLabelsFormat(format); |
|
89 | m_series->setPointLabelsFormat(format); | |
90 | TRY_COMPARE(labelsFormatSpy.count(), 1); |
|
90 | TRY_COMPARE(labelsFormatSpy.count(), 1); | |
91 | QList<QVariant> arguments = labelsFormatSpy.takeFirst(); |
|
91 | QList<QVariant> arguments = labelsFormatSpy.takeFirst(); | |
92 | QVERIFY(arguments.at(0).toString() == format); |
|
92 | QVERIFY(arguments.at(0).toString() == format); | |
93 |
|
93 | |||
94 | m_series->setPointLabelsFormat(QString()); |
|
94 | m_series->setPointLabelsFormat(QString()); | |
95 | TRY_COMPARE(labelsFormatSpy.count(), 1); |
|
95 | TRY_COMPARE(labelsFormatSpy.count(), 1); | |
96 | arguments = labelsFormatSpy.takeFirst(); |
|
96 | arguments = labelsFormatSpy.takeFirst(); | |
97 | QVERIFY(arguments.at(0).toString() == QString()); |
|
97 | QVERIFY(arguments.at(0).toString() == QString()); | |
98 |
|
98 | |||
99 | } |
|
99 | } | |
100 |
|
100 | |||
101 | void tst_QXYSeries::pointLabelsVisible() |
|
101 | void tst_QXYSeries::pointLabelsVisible() | |
102 | { |
|
102 | { | |
103 | QSignalSpy labelsVisibleSpy(m_series, SIGNAL(pointLabelsVisibilityChanged(bool))); |
|
103 | QSignalSpy labelsVisibleSpy(m_series, SIGNAL(pointLabelsVisibilityChanged(bool))); | |
104 | QCOMPARE(m_series->pointLabelsVisible(), false); |
|
104 | QCOMPARE(m_series->pointLabelsVisible(), false); | |
105 |
|
105 | |||
106 | m_series->setPointLabelsVisible(); |
|
106 | m_series->setPointLabelsVisible(); | |
107 | QCOMPARE(m_series->pointLabelsVisible(), true); |
|
107 | QCOMPARE(m_series->pointLabelsVisible(), true); | |
108 | TRY_COMPARE(labelsVisibleSpy.count(), 1); |
|
108 | TRY_COMPARE(labelsVisibleSpy.count(), 1); | |
109 | QList<QVariant> arguments = labelsVisibleSpy.takeFirst(); |
|
109 | QList<QVariant> arguments = labelsVisibleSpy.takeFirst(); | |
110 | QVERIFY(arguments.at(0).toBool() == true); |
|
110 | QVERIFY(arguments.at(0).toBool() == true); | |
111 |
|
111 | |||
112 | m_series->setPointLabelsVisible(false); |
|
112 | m_series->setPointLabelsVisible(false); | |
113 | QCOMPARE(m_series->pointLabelsVisible(), false); |
|
113 | QCOMPARE(m_series->pointLabelsVisible(), false); | |
114 | TRY_COMPARE(labelsVisibleSpy.count(), 1); |
|
114 | TRY_COMPARE(labelsVisibleSpy.count(), 1); | |
115 | arguments = labelsVisibleSpy.takeFirst(); |
|
115 | arguments = labelsVisibleSpy.takeFirst(); | |
116 | QVERIFY(arguments.at(0).toBool() == false); |
|
116 | QVERIFY(arguments.at(0).toBool() == false); | |
117 | } |
|
117 | } | |
118 |
|
118 | |||
119 | void tst_QXYSeries::pointLabelsFont() |
|
119 | void tst_QXYSeries::pointLabelsFont() | |
120 | { |
|
120 | { | |
121 | QFont defaultFont(m_series->pointLabelsFont()); |
|
121 | QFont defaultFont(m_series->pointLabelsFont()); | |
122 | QSignalSpy labelsFontSpy(m_series, SIGNAL(pointLabelsFontChanged(QFont))); |
|
122 | QSignalSpy labelsFontSpy(m_series, SIGNAL(pointLabelsFontChanged(QFont))); | |
123 |
|
123 | |||
124 | QFont font("Times", 10); |
|
124 | QFont font("Times", 10); | |
125 | m_series->setPointLabelsFont(font); |
|
125 | m_series->setPointLabelsFont(font); | |
126 | TRY_COMPARE(labelsFontSpy.count(), 1); |
|
126 | TRY_COMPARE(labelsFontSpy.count(), 1); | |
127 | QList<QVariant> arguments = labelsFontSpy.takeFirst(); |
|
127 | QList<QVariant> arguments = labelsFontSpy.takeFirst(); | |
128 | QVERIFY(arguments.at(0).value<QFont>() == font); |
|
128 | QVERIFY(arguments.at(0).value<QFont>() == font); | |
129 |
|
129 | |||
130 | m_series->setPointLabelsFont(defaultFont); |
|
130 | m_series->setPointLabelsFont(defaultFont); | |
131 | TRY_COMPARE(labelsFontSpy.count(), 1); |
|
131 | TRY_COMPARE(labelsFontSpy.count(), 1); | |
132 | arguments = labelsFontSpy.takeFirst(); |
|
132 | arguments = labelsFontSpy.takeFirst(); | |
133 | QVERIFY(arguments.at(0).value<QFont>() == defaultFont); |
|
133 | QVERIFY(arguments.at(0).value<QFont>() == defaultFont); | |
134 |
|
134 | |||
135 | } |
|
135 | } | |
136 |
|
136 | |||
137 | void tst_QXYSeries::pointLabelsColor() |
|
137 | void tst_QXYSeries::pointLabelsColor() | |
138 | { |
|
138 | { | |
139 | QColor defaultColor(QPen().color()); |
|
139 | QColor defaultColor(QPen().color()); | |
140 | QSignalSpy labelsColorSpy(m_series, SIGNAL(pointLabelsColorChanged(QColor))); |
|
140 | QSignalSpy labelsColorSpy(m_series, SIGNAL(pointLabelsColorChanged(QColor))); | |
141 | QCOMPARE(m_series->pointLabelsColor(), defaultColor); |
|
141 | QCOMPARE(m_series->pointLabelsColor(), defaultColor); | |
142 |
|
142 | |||
143 | QColor color(Qt::blue); |
|
143 | QColor color(Qt::blue); | |
144 | m_series->setPointLabelsColor(color); |
|
144 | m_series->setPointLabelsColor(color); | |
145 | TRY_COMPARE(labelsColorSpy.count(), 1); |
|
145 | TRY_COMPARE(labelsColorSpy.count(), 1); | |
146 | QList<QVariant> arguments = labelsColorSpy.takeFirst(); |
|
146 | QList<QVariant> arguments = labelsColorSpy.takeFirst(); | |
147 | QVERIFY(arguments.at(0).value<QColor>() == color); |
|
147 | QVERIFY(arguments.at(0).value<QColor>() == color); | |
148 |
|
148 | |||
149 | m_series->setPointLabelsColor(defaultColor); |
|
149 | m_series->setPointLabelsColor(defaultColor); | |
150 | TRY_COMPARE(labelsColorSpy.count(), 1); |
|
150 | TRY_COMPARE(labelsColorSpy.count(), 1); | |
151 | arguments = labelsColorSpy.takeFirst(); |
|
151 | arguments = labelsColorSpy.takeFirst(); | |
152 | QVERIFY(arguments.at(0).value<QColor>() == defaultColor); |
|
152 | QVERIFY(arguments.at(0).value<QColor>() == defaultColor); | |
153 | } |
|
153 | } | |
154 |
|
154 | |||
|
155 | void tst_QXYSeries::pointLabelsClipping() | |||
|
156 | { | |||
|
157 | QSignalSpy labelsClippingSpy(m_series, SIGNAL(pointLabelsClippingChanged(bool))); | |||
|
158 | QCOMPARE(m_series->pointLabelsClipping(), true); | |||
|
159 | ||||
|
160 | m_series->setPointLabelsClipping(false); | |||
|
161 | QCOMPARE(m_series->pointLabelsClipping(), false); | |||
|
162 | TRY_COMPARE(labelsClippingSpy.count(), 1); | |||
|
163 | QList<QVariant> arguments = labelsClippingSpy.takeFirst(); | |||
|
164 | QVERIFY(arguments.at(0).toBool() == false); | |||
|
165 | ||||
|
166 | m_series->setPointLabelsClipping(); | |||
|
167 | QCOMPARE(m_series->pointLabelsClipping(), true); | |||
|
168 | TRY_COMPARE(labelsClippingSpy.count(), 1); | |||
|
169 | arguments = labelsClippingSpy.takeFirst(); | |||
|
170 | QVERIFY(arguments.at(0).toBool() == true); | |||
|
171 | } | |||
|
172 | ||||
155 | void tst_QXYSeries::append_data() |
|
173 | void tst_QXYSeries::append_data() | |
156 | { |
|
174 | { | |
157 | QTest::addColumn< QList<QPointF> >("points"); |
|
175 | QTest::addColumn< QList<QPointF> >("points"); | |
158 | QTest::addColumn< QList<QPointF> >("otherPoints"); |
|
176 | QTest::addColumn< QList<QPointF> >("otherPoints"); | |
159 | QTest::newRow("0,0 1,1 2,2 3,3") |
|
177 | QTest::newRow("0,0 1,1 2,2 3,3") | |
160 | << (QList<QPointF>() << QPointF(0,0) << QPointF(1,1) << QPointF(2,2) << QPointF(3,3)) |
|
178 | << (QList<QPointF>() << QPointF(0,0) << QPointF(1,1) << QPointF(2,2) << QPointF(3,3)) | |
161 | << (QList<QPointF>() << QPointF(4,4) << QPointF(5,5) << QPointF(6,6) << QPointF(7,7)); |
|
179 | << (QList<QPointF>() << QPointF(4,4) << QPointF(5,5) << QPointF(6,6) << QPointF(7,7)); | |
162 | QTest::newRow("0,0 -1,-1 -2,-2 -3,-3") |
|
180 | QTest::newRow("0,0 -1,-1 -2,-2 -3,-3") | |
163 | << (QList<QPointF>() << QPointF(0,0) << QPointF(-1,-1) << QPointF(-2,-2) << QPointF(-3,-3)) |
|
181 | << (QList<QPointF>() << QPointF(0,0) << QPointF(-1,-1) << QPointF(-2,-2) << QPointF(-3,-3)) | |
164 | << (QList<QPointF>() << QPointF(-4,-4) << QPointF(-5,-5) << QPointF(-6,-6) << QPointF(-7,-7)); |
|
182 | << (QList<QPointF>() << QPointF(-4,-4) << QPointF(-5,-5) << QPointF(-6,-6) << QPointF(-7,-7)); | |
165 | } |
|
183 | } | |
166 |
|
184 | |||
167 |
|
185 | |||
168 | void tst_QXYSeries::append_raw_data() |
|
186 | void tst_QXYSeries::append_raw_data() | |
169 | { |
|
187 | { | |
170 | append_data(); |
|
188 | append_data(); | |
171 | } |
|
189 | } | |
172 |
|
190 | |||
173 | void tst_QXYSeries::append_raw() |
|
191 | void tst_QXYSeries::append_raw() | |
174 | { |
|
192 | { | |
175 | QFETCH(QList<QPointF>, points); |
|
193 | QFETCH(QList<QPointF>, points); | |
176 | QFETCH(QList<QPointF>, otherPoints); |
|
194 | QFETCH(QList<QPointF>, otherPoints); | |
177 | QSignalSpy spy0(m_series, SIGNAL(clicked(QPointF))); |
|
195 | QSignalSpy spy0(m_series, SIGNAL(clicked(QPointF))); | |
178 | QSignalSpy addedSpy(m_series, SIGNAL(pointAdded(int))); |
|
196 | QSignalSpy addedSpy(m_series, SIGNAL(pointAdded(int))); | |
179 | m_series->append(points); |
|
197 | m_series->append(points); | |
180 | TRY_COMPARE(spy0.count(), 0); |
|
198 | TRY_COMPARE(spy0.count(), 0); | |
181 | TRY_COMPARE(addedSpy.count(), points.count()); |
|
199 | TRY_COMPARE(addedSpy.count(), points.count()); | |
182 | QCOMPARE(m_series->points(), points); |
|
200 | QCOMPARE(m_series->points(), points); | |
183 |
|
201 | |||
184 | // Process events between appends |
|
202 | // Process events between appends | |
185 | foreach (const QPointF &point, otherPoints) { |
|
203 | foreach (const QPointF &point, otherPoints) { | |
186 | m_series->append(point); |
|
204 | m_series->append(point); | |
187 | QApplication::processEvents(); |
|
205 | QApplication::processEvents(); | |
188 | } |
|
206 | } | |
189 | } |
|
207 | } | |
190 |
|
208 | |||
191 | void tst_QXYSeries::chart_append_data() |
|
209 | void tst_QXYSeries::chart_append_data() | |
192 | { |
|
210 | { | |
193 | append_data(); |
|
211 | append_data(); | |
194 | } |
|
212 | } | |
195 |
|
213 | |||
196 | void tst_QXYSeries::chart_append() |
|
214 | void tst_QXYSeries::chart_append() | |
197 | { |
|
215 | { | |
198 | append_raw(); |
|
216 | append_raw(); | |
199 | m_chart->addSeries(m_series); |
|
217 | m_chart->addSeries(m_series); | |
200 | m_view->show(); |
|
218 | m_view->show(); | |
201 | QTest::qWaitForWindowShown(m_view); |
|
219 | QTest::qWaitForWindowShown(m_view); | |
202 | } |
|
220 | } | |
203 |
|
221 | |||
204 | void tst_QXYSeries::append_chart_data() |
|
222 | void tst_QXYSeries::append_chart_data() | |
205 | { |
|
223 | { | |
206 | append_data(); |
|
224 | append_data(); | |
207 | } |
|
225 | } | |
208 |
|
226 | |||
209 | void tst_QXYSeries::append_chart() |
|
227 | void tst_QXYSeries::append_chart() | |
210 | { |
|
228 | { | |
211 | m_view->show(); |
|
229 | m_view->show(); | |
212 | m_chart->addSeries(m_series); |
|
230 | m_chart->addSeries(m_series); | |
213 | QTest::qWaitForWindowShown(m_view); |
|
231 | QTest::qWaitForWindowShown(m_view); | |
214 | append_raw(); |
|
232 | append_raw(); | |
215 |
|
233 | |||
216 | } |
|
234 | } | |
217 |
|
235 | |||
218 | void tst_QXYSeries::append_chart_animation_data() |
|
236 | void tst_QXYSeries::append_chart_animation_data() | |
219 | { |
|
237 | { | |
220 | append_data(); |
|
238 | append_data(); | |
221 | } |
|
239 | } | |
222 |
|
240 | |||
223 | void tst_QXYSeries::append_chart_animation() |
|
241 | void tst_QXYSeries::append_chart_animation() | |
224 | { |
|
242 | { | |
225 | m_chart->setAnimationOptions(QChart::AllAnimations); |
|
243 | m_chart->setAnimationOptions(QChart::AllAnimations); | |
226 | append_chart(); |
|
244 | append_chart(); | |
227 | } |
|
245 | } | |
228 |
|
246 | |||
229 | void tst_QXYSeries::count_data() |
|
247 | void tst_QXYSeries::count_data() | |
230 | { |
|
248 | { | |
231 | QTest::addColumn<int>("count"); |
|
249 | QTest::addColumn<int>("count"); | |
232 | QTest::newRow("0") << 0; |
|
250 | QTest::newRow("0") << 0; | |
233 | QTest::newRow("5") << 5; |
|
251 | QTest::newRow("5") << 5; | |
234 | QTest::newRow("10") << 5; |
|
252 | QTest::newRow("10") << 5; | |
235 | } |
|
253 | } | |
236 |
|
254 | |||
237 | void tst_QXYSeries::count_raw_data() |
|
255 | void tst_QXYSeries::count_raw_data() | |
238 | { |
|
256 | { | |
239 | count_data(); |
|
257 | count_data(); | |
240 | } |
|
258 | } | |
241 |
|
259 | |||
242 | void tst_QXYSeries::count_raw() |
|
260 | void tst_QXYSeries::count_raw() | |
243 | { |
|
261 | { | |
244 | QFETCH(int, count); |
|
262 | QFETCH(int, count); | |
245 |
|
263 | |||
246 | QSignalSpy spy0(m_series, SIGNAL(clicked(QPointF))); |
|
264 | QSignalSpy spy0(m_series, SIGNAL(clicked(QPointF))); | |
247 |
|
265 | |||
248 | for(int i=0 ; i< count; ++i) |
|
266 | for(int i=0 ; i< count; ++i) | |
249 | m_series->append(i,i); |
|
267 | m_series->append(i,i); | |
250 |
|
268 | |||
251 | TRY_COMPARE(spy0.count(), 0); |
|
269 | TRY_COMPARE(spy0.count(), 0); | |
252 | QCOMPARE(m_series->count(), count); |
|
270 | QCOMPARE(m_series->count(), count); | |
253 | } |
|
271 | } | |
254 |
|
272 | |||
255 | void tst_QXYSeries::remove_raw_data() |
|
273 | void tst_QXYSeries::remove_raw_data() | |
256 | { |
|
274 | { | |
257 | append_data(); |
|
275 | append_data(); | |
258 | } |
|
276 | } | |
259 |
|
277 | |||
260 | void tst_QXYSeries::remove_raw() |
|
278 | void tst_QXYSeries::remove_raw() | |
261 | { |
|
279 | { | |
262 | QFETCH(QList<QPointF>, points); |
|
280 | QFETCH(QList<QPointF>, points); | |
263 | QSignalSpy spy0(m_series, SIGNAL(clicked(QPointF))); |
|
281 | QSignalSpy spy0(m_series, SIGNAL(clicked(QPointF))); | |
264 | m_series->append(points); |
|
282 | m_series->append(points); | |
265 | TRY_COMPARE(spy0.count(), 0); |
|
283 | TRY_COMPARE(spy0.count(), 0); | |
266 | QCOMPARE(m_series->points(), points); |
|
284 | QCOMPARE(m_series->points(), points); | |
267 |
|
285 | |||
268 | foreach (const QPointF& point,points) |
|
286 | foreach (const QPointF& point,points) | |
269 | m_series->remove(point); |
|
287 | m_series->remove(point); | |
270 |
|
288 | |||
271 | QCOMPARE(m_series->points().count(), 0); |
|
289 | QCOMPARE(m_series->points().count(), 0); | |
272 | TRY_COMPARE(spy0.count(), 0); |
|
290 | TRY_COMPARE(spy0.count(), 0); | |
273 |
|
291 | |||
274 | m_series->append(points); |
|
292 | m_series->append(points); | |
275 | QCOMPARE(m_series->points(), points); |
|
293 | QCOMPARE(m_series->points(), points); | |
276 |
|
294 | |||
277 | //reverse order |
|
295 | //reverse order | |
278 | for(int i = points.count()-1 ; i>=0; i--){ |
|
296 | for(int i = points.count()-1 ; i>=0; i--){ | |
279 | m_series->remove(points[i]); |
|
297 | m_series->remove(points[i]); | |
280 | } |
|
298 | } | |
281 | QCOMPARE(m_series->points().count(), 0); |
|
299 | QCOMPARE(m_series->points().count(), 0); | |
282 |
|
300 | |||
283 | QApplication::processEvents(); |
|
301 | QApplication::processEvents(); | |
284 |
|
302 | |||
285 | // Process events between removes |
|
303 | // Process events between removes | |
286 | m_series->append(points); |
|
304 | m_series->append(points); | |
287 | QCOMPARE(m_series->points(), points); |
|
305 | QCOMPARE(m_series->points(), points); | |
288 | foreach (const QPointF &point, points) { |
|
306 | foreach (const QPointF &point, points) { | |
289 | m_series->remove(point); |
|
307 | m_series->remove(point); | |
290 | QApplication::processEvents(); |
|
308 | QApplication::processEvents(); | |
291 | } |
|
309 | } | |
292 |
|
310 | |||
293 | // Actual meaningful delay between removes, but still shorter than animation duration |
|
311 | // Actual meaningful delay between removes, but still shorter than animation duration | |
294 | // (simulate e.g. spamming a hypothetical "remove last point"-button) |
|
312 | // (simulate e.g. spamming a hypothetical "remove last point"-button) | |
295 | QList<QPointF> bunchOfPoints; |
|
313 | QList<QPointF> bunchOfPoints; | |
296 | for (int i = 0; i < 10; i++) |
|
314 | for (int i = 0; i < 10; i++) | |
297 | bunchOfPoints.append(QPointF(i, (qreal) rand() / (qreal) RAND_MAX)); |
|
315 | bunchOfPoints.append(QPointF(i, (qreal) rand() / (qreal) RAND_MAX)); | |
298 | m_series->replace(bunchOfPoints); |
|
316 | m_series->replace(bunchOfPoints); | |
299 | QCOMPARE(m_series->points(), bunchOfPoints); |
|
317 | QCOMPARE(m_series->points(), bunchOfPoints); | |
300 | QTest::qWait(1500); // Wait for append animations to be over |
|
318 | QTest::qWait(1500); // Wait for append animations to be over | |
301 | for (int i = bunchOfPoints.count() - 1; i >= 0; i--) { |
|
319 | for (int i = bunchOfPoints.count() - 1; i >= 0; i--) { | |
302 | m_series->remove(bunchOfPoints.at(i)); |
|
320 | m_series->remove(bunchOfPoints.at(i)); | |
303 | QTest::qWait(50); |
|
321 | QTest::qWait(50); | |
304 | } |
|
322 | } | |
305 | QCOMPARE(m_series->points().count(), 0); |
|
323 | QCOMPARE(m_series->points().count(), 0); | |
306 |
|
324 | |||
307 | // Removal using index |
|
325 | // Removal using index | |
308 | for (int i = 0; i < 10; i++) |
|
326 | for (int i = 0; i < 10; i++) | |
309 | bunchOfPoints.append(QPointF(i, (qreal) rand() / (qreal) RAND_MAX)); |
|
327 | bunchOfPoints.append(QPointF(i, (qreal) rand() / (qreal) RAND_MAX)); | |
310 | m_series->replace(bunchOfPoints); |
|
328 | m_series->replace(bunchOfPoints); | |
311 | m_series->remove(5); |
|
329 | m_series->remove(5); | |
312 | m_series->remove(0); |
|
330 | m_series->remove(0); | |
313 | QCOMPARE(m_series->points().count(), (bunchOfPoints.count() - 2)); |
|
331 | QCOMPARE(m_series->points().count(), (bunchOfPoints.count() - 2)); | |
314 | for (int i = bunchOfPoints.count() - 3; i >= 0; i--) { |
|
332 | for (int i = bunchOfPoints.count() - 3; i >= 0; i--) { | |
315 | m_series->remove(i); |
|
333 | m_series->remove(i); | |
316 | QCOMPARE(m_series->points().count(), i); |
|
334 | QCOMPARE(m_series->points().count(), i); | |
317 | } |
|
335 | } | |
318 | QCOMPARE(m_series->points().count(), 0); |
|
336 | QCOMPARE(m_series->points().count(), 0); | |
319 |
|
337 | |||
320 | // Multiple removal using index |
|
338 | // Multiple removal using index | |
321 | for (int i = 0; i < 10; i++) |
|
339 | for (int i = 0; i < 10; i++) | |
322 | bunchOfPoints.append(QPointF(i, (qreal) rand() / (qreal) RAND_MAX)); |
|
340 | bunchOfPoints.append(QPointF(i, (qreal) rand() / (qreal) RAND_MAX)); | |
323 | m_series->replace(bunchOfPoints); |
|
341 | m_series->replace(bunchOfPoints); | |
324 | m_series->removePoints(5, 2); |
|
342 | m_series->removePoints(5, 2); | |
325 | m_series->removePoints(0, 3); |
|
343 | m_series->removePoints(0, 3); | |
326 | QCOMPARE(m_series->points().count(), (bunchOfPoints.count() - 5)); |
|
344 | QCOMPARE(m_series->points().count(), (bunchOfPoints.count() - 5)); | |
327 | m_series->removePoints(0, (bunchOfPoints.count() - 5)); |
|
345 | m_series->removePoints(0, (bunchOfPoints.count() - 5)); | |
328 | QCOMPARE(m_series->points().count(), 0); |
|
346 | QCOMPARE(m_series->points().count(), 0); | |
329 | } |
|
347 | } | |
330 |
|
348 | |||
331 | void tst_QXYSeries::remove_chart_data() |
|
349 | void tst_QXYSeries::remove_chart_data() | |
332 | { |
|
350 | { | |
333 | append_data(); |
|
351 | append_data(); | |
334 | } |
|
352 | } | |
335 |
|
353 | |||
336 | void tst_QXYSeries::remove_chart() |
|
354 | void tst_QXYSeries::remove_chart() | |
337 | { |
|
355 | { | |
338 | m_view->show(); |
|
356 | m_view->show(); | |
339 | m_chart->addSeries(m_series); |
|
357 | m_chart->addSeries(m_series); | |
340 | QTest::qWaitForWindowShown(m_view); |
|
358 | QTest::qWaitForWindowShown(m_view); | |
341 | remove_raw(); |
|
359 | remove_raw(); | |
342 | } |
|
360 | } | |
343 |
|
361 | |||
344 | void tst_QXYSeries::remove_chart_animation_data() |
|
362 | void tst_QXYSeries::remove_chart_animation_data() | |
345 | { |
|
363 | { | |
346 | append_data(); |
|
364 | append_data(); | |
347 | } |
|
365 | } | |
348 |
|
366 | |||
349 | void tst_QXYSeries::remove_chart_animation() |
|
367 | void tst_QXYSeries::remove_chart_animation() | |
350 | { |
|
368 | { | |
351 | m_chart->setAnimationOptions(QChart::AllAnimations); |
|
369 | m_chart->setAnimationOptions(QChart::AllAnimations); | |
352 | remove_chart(); |
|
370 | remove_chart(); | |
353 | } |
|
371 | } | |
354 |
|
372 | |||
355 |
|
373 | |||
356 | void tst_QXYSeries::clear_raw_data() |
|
374 | void tst_QXYSeries::clear_raw_data() | |
357 | { |
|
375 | { | |
358 | append_data(); |
|
376 | append_data(); | |
359 | } |
|
377 | } | |
360 |
|
378 | |||
361 | void tst_QXYSeries::clear_raw() |
|
379 | void tst_QXYSeries::clear_raw() | |
362 | { |
|
380 | { | |
363 | QFETCH(QList<QPointF>, points); |
|
381 | QFETCH(QList<QPointF>, points); | |
364 | QSignalSpy spy0(m_series, SIGNAL(clicked(QPointF))); |
|
382 | QSignalSpy spy0(m_series, SIGNAL(clicked(QPointF))); | |
365 | m_series->append(points); |
|
383 | m_series->append(points); | |
366 | TRY_COMPARE(spy0.count(), 0); |
|
384 | TRY_COMPARE(spy0.count(), 0); | |
367 | QCOMPARE(m_series->points(), points); |
|
385 | QCOMPARE(m_series->points(), points); | |
368 | m_series->clear(); |
|
386 | m_series->clear(); | |
369 | TRY_COMPARE(spy0.count(), 0); |
|
387 | TRY_COMPARE(spy0.count(), 0); | |
370 | QCOMPARE(m_series->points().count(), 0); |
|
388 | QCOMPARE(m_series->points().count(), 0); | |
371 |
|
389 | |||
372 | QApplication::processEvents(); |
|
390 | QApplication::processEvents(); | |
373 | } |
|
391 | } | |
374 |
|
392 | |||
375 | void tst_QXYSeries::clear_chart_data() |
|
393 | void tst_QXYSeries::clear_chart_data() | |
376 | { |
|
394 | { | |
377 | append_data(); |
|
395 | append_data(); | |
378 | } |
|
396 | } | |
379 |
|
397 | |||
380 | void tst_QXYSeries::clear_chart() |
|
398 | void tst_QXYSeries::clear_chart() | |
381 | { |
|
399 | { | |
382 | m_view->show(); |
|
400 | m_view->show(); | |
383 | m_chart->addSeries(m_series); |
|
401 | m_chart->addSeries(m_series); | |
384 | QTest::qWaitForWindowShown(m_view); |
|
402 | QTest::qWaitForWindowShown(m_view); | |
385 | clear_raw(); |
|
403 | clear_raw(); | |
386 | } |
|
404 | } | |
387 |
|
405 | |||
388 | void tst_QXYSeries::clear_chart_animation_data() |
|
406 | void tst_QXYSeries::clear_chart_animation_data() | |
389 | { |
|
407 | { | |
390 | append_data(); |
|
408 | append_data(); | |
391 | } |
|
409 | } | |
392 |
|
410 | |||
393 | void tst_QXYSeries::clear_chart_animation() |
|
411 | void tst_QXYSeries::clear_chart_animation() | |
394 | { |
|
412 | { | |
395 | m_chart->setAnimationOptions(QChart::AllAnimations); |
|
413 | m_chart->setAnimationOptions(QChart::AllAnimations); | |
396 | clear_chart(); |
|
414 | clear_chart(); | |
397 | } |
|
415 | } | |
398 |
|
416 | |||
399 | void tst_QXYSeries::replace_raw_data() |
|
417 | void tst_QXYSeries::replace_raw_data() | |
400 | { |
|
418 | { | |
401 | append_data(); |
|
419 | append_data(); | |
402 | } |
|
420 | } | |
403 |
|
421 | |||
404 | void tst_QXYSeries::replace_raw() |
|
422 | void tst_QXYSeries::replace_raw() | |
405 | { |
|
423 | { | |
406 | QFETCH(QList<QPointF>, points); |
|
424 | QFETCH(QList<QPointF>, points); | |
407 | QFETCH(QList<QPointF>, otherPoints); |
|
425 | QFETCH(QList<QPointF>, otherPoints); | |
408 | QSignalSpy pointReplacedSpy(m_series, SIGNAL(pointReplaced(int))); |
|
426 | QSignalSpy pointReplacedSpy(m_series, SIGNAL(pointReplaced(int))); | |
409 | QSignalSpy pointsReplacedSpy(m_series, SIGNAL(pointsReplaced())); |
|
427 | QSignalSpy pointsReplacedSpy(m_series, SIGNAL(pointsReplaced())); | |
410 | m_series->append(points); |
|
428 | m_series->append(points); | |
411 | TRY_COMPARE(pointReplacedSpy.count(), 0); |
|
429 | TRY_COMPARE(pointReplacedSpy.count(), 0); | |
412 | TRY_COMPARE(pointsReplacedSpy.count(), 0); |
|
430 | TRY_COMPARE(pointsReplacedSpy.count(), 0); | |
413 | QCOMPARE(m_series->points(), points); |
|
431 | QCOMPARE(m_series->points(), points); | |
414 |
|
432 | |||
415 | foreach (const QPointF& point, points) |
|
433 | foreach (const QPointF& point, points) | |
416 | m_series->replace(point.x(),point.y(),point.x(),0); |
|
434 | m_series->replace(point.x(),point.y(),point.x(),0); | |
417 | TRY_COMPARE(pointReplacedSpy.count(), points.count()); |
|
435 | TRY_COMPARE(pointReplacedSpy.count(), points.count()); | |
418 | TRY_COMPARE(pointsReplacedSpy.count(), 0); |
|
436 | TRY_COMPARE(pointsReplacedSpy.count(), 0); | |
419 |
|
437 | |||
420 | // Replace a point that does not exist |
|
438 | // Replace a point that does not exist | |
421 | m_series->replace(-123, 999, 0, 0); |
|
439 | m_series->replace(-123, 999, 0, 0); | |
422 | TRY_COMPARE(pointReplacedSpy.count(), points.count()); |
|
440 | TRY_COMPARE(pointReplacedSpy.count(), points.count()); | |
423 | TRY_COMPARE(pointsReplacedSpy.count(), 0); |
|
441 | TRY_COMPARE(pointsReplacedSpy.count(), 0); | |
424 |
|
442 | |||
425 | QList<QPointF> newPoints = m_series->points(); |
|
443 | QList<QPointF> newPoints = m_series->points(); | |
426 | QCOMPARE(newPoints.count(), points.count()); |
|
444 | QCOMPARE(newPoints.count(), points.count()); | |
427 | for(int i =0 ; i<points.count() ; ++i) { |
|
445 | for(int i =0 ; i<points.count() ; ++i) { | |
428 | QCOMPARE(points[i].x(), newPoints[i].x()); |
|
446 | QCOMPARE(points[i].x(), newPoints[i].x()); | |
429 | QCOMPARE(newPoints[i].y(), 0.0); |
|
447 | QCOMPARE(newPoints[i].y(), 0.0); | |
430 | } |
|
448 | } | |
431 |
|
449 | |||
432 | // Replace all points |
|
450 | // Replace all points | |
433 | QList<QPointF> allPoints; |
|
451 | QList<QPointF> allPoints; | |
434 | for (int i = 0; i < 10; i++) |
|
452 | for (int i = 0; i < 10; i++) | |
435 | allPoints.append(QPointF(i, (qreal) rand() / (qreal) RAND_MAX)); |
|
453 | allPoints.append(QPointF(i, (qreal) rand() / (qreal) RAND_MAX)); | |
436 | m_series->replace(allPoints); |
|
454 | m_series->replace(allPoints); | |
437 | TRY_COMPARE(pointReplacedSpy.count(), points.count()); |
|
455 | TRY_COMPARE(pointReplacedSpy.count(), points.count()); | |
438 | TRY_COMPARE(pointsReplacedSpy.count(), 1); |
|
456 | TRY_COMPARE(pointsReplacedSpy.count(), 1); | |
439 |
|
457 | |||
440 | m_series->replace(points); |
|
458 | m_series->replace(points); | |
441 | QApplication::processEvents(); |
|
459 | QApplication::processEvents(); | |
442 |
|
460 | |||
443 | // Process events between replaces |
|
461 | // Process events between replaces | |
444 | for (int i = 0; i < points.count(); ++i) { |
|
462 | for (int i = 0; i < points.count(); ++i) { | |
445 | m_series->replace(points.at(i), otherPoints.at(i)); |
|
463 | m_series->replace(points.at(i), otherPoints.at(i)); | |
446 | QApplication::processEvents(); |
|
464 | QApplication::processEvents(); | |
447 | } |
|
465 | } | |
448 |
|
466 | |||
449 | newPoints = m_series->points(); |
|
467 | newPoints = m_series->points(); | |
450 | QCOMPARE(newPoints.count(), points.count()); |
|
468 | QCOMPARE(newPoints.count(), points.count()); | |
451 | for (int i = 0; i < points.count(); ++i) { |
|
469 | for (int i = 0; i < points.count(); ++i) { | |
452 | QCOMPARE(otherPoints.at(i).x(), newPoints.at(i).x()); |
|
470 | QCOMPARE(otherPoints.at(i).x(), newPoints.at(i).x()); | |
453 | QCOMPARE(otherPoints.at(i).y(), newPoints.at(i).y()); |
|
471 | QCOMPARE(otherPoints.at(i).y(), newPoints.at(i).y()); | |
454 | } |
|
472 | } | |
455 |
|
473 | |||
456 | // Append followed by a replace shouldn't crash |
|
474 | // Append followed by a replace shouldn't crash | |
457 | m_series->clear(); |
|
475 | m_series->clear(); | |
458 | m_series->append(QPointF(22,22)); |
|
476 | m_series->append(QPointF(22,22)); | |
459 | m_series->append(QPointF(23,23)); |
|
477 | m_series->append(QPointF(23,23)); | |
460 | QApplication::processEvents(); |
|
478 | QApplication::processEvents(); | |
461 | m_series->replace(QPointF(23,23), otherPoints.at(1)); |
|
479 | m_series->replace(QPointF(23,23), otherPoints.at(1)); | |
462 | QCOMPARE(m_series->points().at(1).x(), otherPoints.at(1).x()); |
|
480 | QCOMPARE(m_series->points().at(1).x(), otherPoints.at(1).x()); | |
463 | QCOMPARE(m_series->points().at(1).y(), otherPoints.at(1).y()); |
|
481 | QCOMPARE(m_series->points().at(1).y(), otherPoints.at(1).y()); | |
464 |
|
482 | |||
465 | // Replace using index |
|
483 | // Replace using index | |
466 | m_series->append(otherPoints); |
|
484 | m_series->append(otherPoints); | |
467 | m_series->replace(0, QPointF(333, 333)); |
|
485 | m_series->replace(0, QPointF(333, 333)); | |
468 | m_series->replace(3, 444, 444); |
|
486 | m_series->replace(3, 444, 444); | |
469 | m_series->replace(m_series->count() - 1, QPointF(555, 555)); |
|
487 | m_series->replace(m_series->count() - 1, QPointF(555, 555)); | |
470 | QCOMPARE(m_series->points().at(0), QPointF(333, 333)); |
|
488 | QCOMPARE(m_series->points().at(0), QPointF(333, 333)); | |
471 | QCOMPARE(m_series->points().at(3), QPointF(444, 444)); |
|
489 | QCOMPARE(m_series->points().at(3), QPointF(444, 444)); | |
472 | QCOMPARE(m_series->points().at(m_series->count() - 1), QPointF(555, 555)); |
|
490 | QCOMPARE(m_series->points().at(m_series->count() - 1), QPointF(555, 555)); | |
473 | } |
|
491 | } | |
474 |
|
492 | |||
475 |
|
493 | |||
476 | void tst_QXYSeries::replace_chart_data() |
|
494 | void tst_QXYSeries::replace_chart_data() | |
477 | { |
|
495 | { | |
478 | append_data(); |
|
496 | append_data(); | |
479 | } |
|
497 | } | |
480 |
|
498 | |||
481 | void tst_QXYSeries::replace_chart() |
|
499 | void tst_QXYSeries::replace_chart() | |
482 | { |
|
500 | { | |
483 | m_view->show(); |
|
501 | m_view->show(); | |
484 | m_chart->addSeries(m_series); |
|
502 | m_chart->addSeries(m_series); | |
485 | QTest::qWaitForWindowShown(m_view); |
|
503 | QTest::qWaitForWindowShown(m_view); | |
486 | replace_raw(); |
|
504 | replace_raw(); | |
487 | } |
|
505 | } | |
488 |
|
506 | |||
489 | void tst_QXYSeries::replace_chart_animation_data() |
|
507 | void tst_QXYSeries::replace_chart_animation_data() | |
490 | { |
|
508 | { | |
491 | append_data(); |
|
509 | append_data(); | |
492 | } |
|
510 | } | |
493 |
|
511 | |||
494 | void tst_QXYSeries::replace_chart_animation() |
|
512 | void tst_QXYSeries::replace_chart_animation() | |
495 | { |
|
513 | { | |
496 | m_chart->setAnimationOptions(QChart::AllAnimations); |
|
514 | m_chart->setAnimationOptions(QChart::AllAnimations); | |
497 | replace_chart(); |
|
515 | replace_chart(); | |
498 | } |
|
516 | } | |
499 |
|
517 | |||
500 | void tst_QXYSeries::insert_data() |
|
518 | void tst_QXYSeries::insert_data() | |
501 | { |
|
519 | { | |
502 | append_data(); |
|
520 | append_data(); | |
503 | } |
|
521 | } | |
504 |
|
522 | |||
505 | void tst_QXYSeries::insert() |
|
523 | void tst_QXYSeries::insert() | |
506 | { |
|
524 | { | |
507 | QFETCH(QList<QPointF>, points); |
|
525 | QFETCH(QList<QPointF>, points); | |
508 | m_series->append(points); |
|
526 | m_series->append(points); | |
509 |
|
527 | |||
510 | QSignalSpy addedSpy(m_series, SIGNAL(pointAdded(int))); |
|
528 | QSignalSpy addedSpy(m_series, SIGNAL(pointAdded(int))); | |
511 |
|
529 | |||
512 | m_series->insert(0, QPointF(5, 5)); |
|
530 | m_series->insert(0, QPointF(5, 5)); | |
513 | TRY_COMPARE(addedSpy.count(), 1); |
|
531 | TRY_COMPARE(addedSpy.count(), 1); | |
514 | QCOMPARE(m_series->points().count(), points.count() + 1); |
|
532 | QCOMPARE(m_series->points().count(), points.count() + 1); | |
515 |
|
533 | |||
516 | m_series->insert(m_series->count(), QPointF(6, 6)); |
|
534 | m_series->insert(m_series->count(), QPointF(6, 6)); | |
517 | TRY_COMPARE(addedSpy.count(), 2); |
|
535 | TRY_COMPARE(addedSpy.count(), 2); | |
518 | QCOMPARE(m_series->points().count(), points.count() + 2); |
|
536 | QCOMPARE(m_series->points().count(), points.count() + 2); | |
519 | } |
|
537 | } | |
520 |
|
538 | |||
521 | void tst_QXYSeries::oper_data() |
|
539 | void tst_QXYSeries::oper_data() | |
522 | { |
|
540 | { | |
523 | append_data(); |
|
541 | append_data(); | |
524 | } |
|
542 | } | |
525 |
|
543 | |||
526 | void tst_QXYSeries::oper() |
|
544 | void tst_QXYSeries::oper() | |
527 | { |
|
545 | { | |
528 | QFETCH(QList<QPointF>, points); |
|
546 | QFETCH(QList<QPointF>, points); | |
529 |
|
547 | |||
530 | QSignalSpy spy0(m_series, SIGNAL(clicked(QPointF))); |
|
548 | QSignalSpy spy0(m_series, SIGNAL(clicked(QPointF))); | |
531 |
|
549 | |||
532 | foreach (const QPointF& point,points) |
|
550 | foreach (const QPointF& point,points) | |
533 | { |
|
551 | { | |
534 | *m_series<<point; |
|
552 | *m_series<<point; | |
535 | } |
|
553 | } | |
536 |
|
554 | |||
537 | QCOMPARE(m_series->points(), points); |
|
555 | QCOMPARE(m_series->points(), points); | |
538 | TRY_COMPARE(spy0.count(), 0); |
|
556 | TRY_COMPARE(spy0.count(), 0); | |
539 | } |
|
557 | } | |
540 |
|
558 | |||
541 |
|
559 | |||
542 | void tst_QXYSeries::pen_data() |
|
560 | void tst_QXYSeries::pen_data() | |
543 | { |
|
561 | { | |
544 | QTest::addColumn<QPen>("pen"); |
|
562 | QTest::addColumn<QPen>("pen"); | |
545 | QTest::newRow("null") << QPen(); |
|
563 | QTest::newRow("null") << QPen(); | |
546 | QTest::newRow("blue") << QPen(Qt::blue); |
|
564 | QTest::newRow("blue") << QPen(Qt::blue); | |
547 | QTest::newRow("black") << QPen(Qt::black); |
|
565 | QTest::newRow("black") << QPen(Qt::black); | |
548 | QTest::newRow("red") << QPen(Qt::red); |
|
566 | QTest::newRow("red") << QPen(Qt::red); | |
549 | } |
|
567 | } | |
550 |
|
568 | |||
551 | void tst_QXYSeries::pen() |
|
569 | void tst_QXYSeries::pen() | |
552 | { |
|
570 | { | |
553 | QFETCH(QPen, pen); |
|
571 | QFETCH(QPen, pen); | |
554 |
|
572 | |||
555 | QSignalSpy spy0(m_series, SIGNAL(clicked(QPointF))); |
|
573 | QSignalSpy spy0(m_series, SIGNAL(clicked(QPointF))); | |
556 | m_series->setPen(pen); |
|
574 | m_series->setPen(pen); | |
557 |
|
575 | |||
558 | TRY_COMPARE(spy0.count(), 0); |
|
576 | TRY_COMPARE(spy0.count(), 0); | |
559 | QCOMPARE(m_series->pen(), pen); |
|
577 | QCOMPARE(m_series->pen(), pen); | |
560 |
|
578 | |||
561 | m_chart->addSeries(m_series); |
|
579 | m_chart->addSeries(m_series); | |
562 |
|
580 | |||
563 | if (pen != QPen()) |
|
581 | if (pen != QPen()) | |
564 | QCOMPARE(m_series->pen(), pen); |
|
582 | QCOMPARE(m_series->pen(), pen); | |
565 |
|
583 | |||
566 | m_chart->setTheme(QChart::ChartThemeDark); |
|
584 | m_chart->setTheme(QChart::ChartThemeDark); | |
567 |
|
585 | |||
568 | // setting a theme will overwrite all customizations |
|
586 | // setting a theme will overwrite all customizations | |
569 | if (pen != QPen()) |
|
587 | if (pen != QPen()) | |
570 | QVERIFY(m_series->pen() != pen); |
|
588 | QVERIFY(m_series->pen() != pen); | |
571 | } |
|
589 | } | |
572 |
|
590 | |||
573 | void tst_QXYSeries::pointsVisible_data() |
|
591 | void tst_QXYSeries::pointsVisible_data() | |
574 | { |
|
592 | { | |
575 | QTest::addColumn<bool>("pointsVisible"); |
|
593 | QTest::addColumn<bool>("pointsVisible"); | |
576 | QTest::newRow("true") << true; |
|
594 | QTest::newRow("true") << true; | |
577 | QTest::newRow("false") << false; |
|
595 | QTest::newRow("false") << false; | |
578 | } |
|
596 | } | |
579 |
|
597 | |||
580 | void tst_QXYSeries::pointsVisible_raw_data() |
|
598 | void tst_QXYSeries::pointsVisible_raw_data() | |
581 | { |
|
599 | { | |
582 | pointsVisible_data(); |
|
600 | pointsVisible_data(); | |
583 | } |
|
601 | } | |
584 |
|
602 | |||
585 | void tst_QXYSeries::pointsVisible_raw() |
|
603 | void tst_QXYSeries::pointsVisible_raw() | |
586 | { |
|
604 | { | |
587 | QFETCH(bool, pointsVisible); |
|
605 | QFETCH(bool, pointsVisible); | |
588 | QSignalSpy spy0(m_series, SIGNAL(clicked(QPointF))); |
|
606 | QSignalSpy spy0(m_series, SIGNAL(clicked(QPointF))); | |
589 | m_series->setPointsVisible(pointsVisible); |
|
607 | m_series->setPointsVisible(pointsVisible); | |
590 | TRY_COMPARE(spy0.count(), 0); |
|
608 | TRY_COMPARE(spy0.count(), 0); | |
591 | QCOMPARE(m_series->pointsVisible(), pointsVisible); |
|
609 | QCOMPARE(m_series->pointsVisible(), pointsVisible); | |
592 | } |
|
610 | } | |
593 |
|
611 | |||
594 | void tst_QXYSeries::changedSignals() |
|
612 | void tst_QXYSeries::changedSignals() | |
595 | { |
|
613 | { | |
596 | QSignalSpy visibleSpy(m_series, SIGNAL(visibleChanged())); |
|
614 | QSignalSpy visibleSpy(m_series, SIGNAL(visibleChanged())); | |
597 | QSignalSpy nameSpy(m_series, SIGNAL(nameChanged())); |
|
615 | QSignalSpy nameSpy(m_series, SIGNAL(nameChanged())); | |
598 | QSignalSpy colorSpy(m_series, SIGNAL(colorChanged(QColor))); |
|
616 | QSignalSpy colorSpy(m_series, SIGNAL(colorChanged(QColor))); | |
599 |
|
617 | |||
600 | // Visibility |
|
618 | // Visibility | |
601 | m_series->setVisible(false); |
|
619 | m_series->setVisible(false); | |
602 | m_series->setVisible(false); |
|
620 | m_series->setVisible(false); | |
603 | TRY_COMPARE(visibleSpy.count(), 1); |
|
621 | TRY_COMPARE(visibleSpy.count(), 1); | |
604 | m_series->setVisible(true); |
|
622 | m_series->setVisible(true); | |
605 | TRY_COMPARE(visibleSpy.count(), 2); |
|
623 | TRY_COMPARE(visibleSpy.count(), 2); | |
606 |
|
624 | |||
607 | // Color |
|
625 | // Color | |
608 | m_series->setColor(QColor("aliceblue")); |
|
626 | m_series->setColor(QColor("aliceblue")); | |
609 | TRY_COMPARE(colorSpy.count(), 1); |
|
627 | TRY_COMPARE(colorSpy.count(), 1); | |
610 |
|
628 | |||
611 | // Pen and Brush |
|
629 | // Pen and Brush | |
612 | QPen p = m_series->pen(); |
|
630 | QPen p = m_series->pen(); | |
613 | p.setColor("aquamarine"); |
|
631 | p.setColor("aquamarine"); | |
614 | m_series->setPen(p); |
|
632 | m_series->setPen(p); | |
615 | QBrush b = m_series->brush(); |
|
633 | QBrush b = m_series->brush(); | |
616 | b.setColor("beige"); |
|
634 | b.setColor("beige"); | |
617 | m_series->setBrush(b); |
|
635 | m_series->setBrush(b); | |
618 | TRY_COMPARE(colorSpy.count(), 2); |
|
636 | TRY_COMPARE(colorSpy.count(), 2); | |
619 |
|
637 | |||
620 | // Verify all the signals again, to make sure no extra signals were emitted |
|
638 | // Verify all the signals again, to make sure no extra signals were emitted | |
621 | TRY_COMPARE(visibleSpy.count(), 2); |
|
639 | TRY_COMPARE(visibleSpy.count(), 2); | |
622 | TRY_COMPARE(nameSpy.count(), 0); |
|
640 | TRY_COMPARE(nameSpy.count(), 0); | |
623 | TRY_COMPARE(colorSpy.count(), 2); |
|
641 | TRY_COMPARE(colorSpy.count(), 2); | |
624 | } |
|
642 | } |
@@ -1,96 +1,97 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
3 | ** Copyright (C) 2015 The Qt Company Ltd | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Charts module. |
|
7 | ** This file is part of the Qt Charts module. | |
8 | ** |
|
8 | ** | |
9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
9 | ** Licensees holding valid commercial license for Qt may use this file in | |
10 | ** accordance with the Qt License Agreement provided with the Software |
|
10 | ** accordance with the Qt License Agreement provided with the Software | |
11 | ** or, alternatively, in accordance with the terms contained in a written |
|
11 | ** or, alternatively, in accordance with the terms contained in a written | |
12 | ** agreement between you and The Qt Company. |
|
12 | ** agreement between you and The Qt Company. | |
13 | ** |
|
13 | ** | |
14 | ** If you have questions regarding the use of this file, please use |
|
14 | ** If you have questions regarding the use of this file, please use | |
15 | ** contact form at http://qt.io |
|
15 | ** contact form at http://qt.io | |
16 | ** |
|
16 | ** | |
17 | ****************************************************************************/ |
|
17 | ****************************************************************************/ | |
18 |
|
18 | |||
19 | #ifndef TST_QXYSERIES_H |
|
19 | #ifndef TST_QXYSERIES_H | |
20 | #define TST_QXYSERIES_H |
|
20 | #define TST_QXYSERIES_H | |
21 |
|
21 | |||
22 | #include <QtTest/QtTest> |
|
22 | #include <QtTest/QtTest> | |
23 | #include <QtCharts/QXYSeries> |
|
23 | #include <QtCharts/QXYSeries> | |
24 | #include <QtCharts/QChartView> |
|
24 | #include <QtCharts/QChartView> | |
25 | #include <QtGui/QStandardItemModel> |
|
25 | #include <QtGui/QStandardItemModel> | |
26 | #include <tst_definitions.h> |
|
26 | #include <tst_definitions.h> | |
27 |
|
27 | |||
28 | QT_CHARTS_USE_NAMESPACE |
|
28 | QT_CHARTS_USE_NAMESPACE | |
29 |
|
29 | |||
30 | class tst_QXYSeries : public QObject |
|
30 | class tst_QXYSeries : public QObject | |
31 | { |
|
31 | { | |
32 | Q_OBJECT |
|
32 | Q_OBJECT | |
33 |
|
33 | |||
34 | public slots: |
|
34 | public slots: | |
35 | virtual void initTestCase(); |
|
35 | virtual void initTestCase(); | |
36 | virtual void cleanupTestCase(); |
|
36 | virtual void cleanupTestCase(); | |
37 | virtual void init(); |
|
37 | virtual void init(); | |
38 | virtual void cleanup(); |
|
38 | virtual void cleanup(); | |
39 |
|
39 | |||
40 | private slots: |
|
40 | private slots: | |
41 | void seriesName(); |
|
41 | void seriesName(); | |
42 | void seriesVisible(); |
|
42 | void seriesVisible(); | |
43 | void pointLabelsFormat(); |
|
43 | void pointLabelsFormat(); | |
44 | void pointLabelsVisible(); |
|
44 | void pointLabelsVisible(); | |
45 | void pointLabelsFont(); |
|
45 | void pointLabelsFont(); | |
46 | void pointLabelsColor(); |
|
46 | void pointLabelsColor(); | |
|
47 | void pointLabelsClipping(); | |||
47 | void seriesOpacity(); |
|
48 | void seriesOpacity(); | |
48 | void oper_data(); |
|
49 | void oper_data(); | |
49 | void oper(); |
|
50 | void oper(); | |
50 | void pen_data(); |
|
51 | void pen_data(); | |
51 | void pen(); |
|
52 | void pen(); | |
52 | void pointsVisible_raw_data(); |
|
53 | void pointsVisible_raw_data(); | |
53 | void pointsVisible_raw(); |
|
54 | void pointsVisible_raw(); | |
54 | void append_raw_data(); |
|
55 | void append_raw_data(); | |
55 | void append_raw(); |
|
56 | void append_raw(); | |
56 | void append_chart_data(); |
|
57 | void append_chart_data(); | |
57 | void append_chart(); |
|
58 | void append_chart(); | |
58 | void append_chart_animation_data(); |
|
59 | void append_chart_animation_data(); | |
59 | void append_chart_animation(); |
|
60 | void append_chart_animation(); | |
60 | void chart_append_data(); |
|
61 | void chart_append_data(); | |
61 | void chart_append(); |
|
62 | void chart_append(); | |
62 | void count_raw_data(); |
|
63 | void count_raw_data(); | |
63 | void count_raw(); |
|
64 | void count_raw(); | |
64 | void remove_raw_data(); |
|
65 | void remove_raw_data(); | |
65 | void remove_raw(); |
|
66 | void remove_raw(); | |
66 | void remove_chart_data(); |
|
67 | void remove_chart_data(); | |
67 | void remove_chart(); |
|
68 | void remove_chart(); | |
68 | void remove_chart_animation_data(); |
|
69 | void remove_chart_animation_data(); | |
69 | void remove_chart_animation(); |
|
70 | void remove_chart_animation(); | |
70 | void clear_raw_data(); |
|
71 | void clear_raw_data(); | |
71 | void clear_raw(); |
|
72 | void clear_raw(); | |
72 | void clear_chart_data(); |
|
73 | void clear_chart_data(); | |
73 | void clear_chart(); |
|
74 | void clear_chart(); | |
74 | void clear_chart_animation_data(); |
|
75 | void clear_chart_animation_data(); | |
75 | void clear_chart_animation(); |
|
76 | void clear_chart_animation(); | |
76 | void replace_raw_data(); |
|
77 | void replace_raw_data(); | |
77 | void replace_raw(); |
|
78 | void replace_raw(); | |
78 | void replace_chart_data(); |
|
79 | void replace_chart_data(); | |
79 | void replace_chart(); |
|
80 | void replace_chart(); | |
80 | void replace_chart_animation_data(); |
|
81 | void replace_chart_animation_data(); | |
81 | void replace_chart_animation(); |
|
82 | void replace_chart_animation(); | |
82 | void insert_data(); |
|
83 | void insert_data(); | |
83 | void insert(); |
|
84 | void insert(); | |
84 | void changedSignals(); |
|
85 | void changedSignals(); | |
85 | protected: |
|
86 | protected: | |
86 | void append_data(); |
|
87 | void append_data(); | |
87 | void count_data(); |
|
88 | void count_data(); | |
88 | void pointsVisible_data(); |
|
89 | void pointsVisible_data(); | |
89 |
|
90 | |||
90 | protected: |
|
91 | protected: | |
91 | QChartView* m_view; |
|
92 | QChartView* m_view; | |
92 | QChart* m_chart; |
|
93 | QChart* m_chart; | |
93 | QXYSeries* m_series; |
|
94 | QXYSeries* m_series; | |
94 | }; |
|
95 | }; | |
95 |
|
96 | |||
96 | #endif |
|
97 | #endif |
@@ -1,115 +1,117 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
3 | ** Copyright (C) 2015 The Qt Company Ltd | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Charts module. |
|
7 | ** This file is part of the Qt Charts module. | |
8 | ** |
|
8 | ** | |
9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
9 | ** Licensees holding valid commercial license for Qt may use this file in | |
10 | ** accordance with the Qt License Agreement provided with the Software |
|
10 | ** accordance with the Qt License Agreement provided with the Software | |
11 | ** or, alternatively, in accordance with the terms contained in a written |
|
11 | ** or, alternatively, in accordance with the terms contained in a written | |
12 | ** agreement between you and The Qt Company. |
|
12 | ** agreement between you and The Qt Company. | |
13 | ** |
|
13 | ** | |
14 | ** If you have questions regarding the use of this file, please use |
|
14 | ** If you have questions regarding the use of this file, please use | |
15 | ** contact form at http://qt.io |
|
15 | ** contact form at http://qt.io | |
16 | ** |
|
16 | ** | |
17 | ****************************************************************************/ |
|
17 | ****************************************************************************/ | |
18 |
|
18 | |||
19 | import QtQuick 2.0 |
|
19 | import QtQuick 2.0 | |
20 | import QtCharts 2.0 |
|
20 | import QtCharts 2.0 | |
21 |
|
21 | |||
22 | ChartView { |
|
22 | ChartView { | |
23 | title: "area series" |
|
23 | title: "area series" | |
24 | anchors.fill: parent |
|
24 | anchors.fill: parent | |
25 | animationOptions: ChartView.SeriesAnimations |
|
25 | animationOptions: ChartView.SeriesAnimations | |
26 |
|
26 | |||
27 | property variant series: areaSeries |
|
27 | property variant series: areaSeries | |
28 |
|
28 | |||
29 | AreaSeries { |
|
29 | AreaSeries { | |
30 | id: areaSeries |
|
30 | id: areaSeries | |
31 | name: "area 1" |
|
31 | name: "area 1" | |
32 |
|
32 | |||
33 | upperSeries: LineSeries { |
|
33 | upperSeries: LineSeries { | |
34 | XYPoint { x: 0; y: 1 } |
|
34 | XYPoint { x: 0; y: 1 } | |
35 | XYPoint { x: 1; y: 1 } |
|
35 | XYPoint { x: 1; y: 1 } | |
36 | XYPoint { x: 2; y: 3 } |
|
36 | XYPoint { x: 2; y: 3 } | |
37 | XYPoint { x: 3; y: 3 } |
|
37 | XYPoint { x: 3; y: 3 } | |
38 | XYPoint { x: 4; y: 2 } |
|
38 | XYPoint { x: 4; y: 2 } | |
39 | XYPoint { x: 5; y: 0 } |
|
39 | XYPoint { x: 5; y: 0 } | |
40 | XYPoint { x: 6; y: 2 } |
|
40 | XYPoint { x: 6; y: 2 } | |
41 | XYPoint { x: 7; y: 1 } |
|
41 | XYPoint { x: 7; y: 1 } | |
42 | XYPoint { x: 8; y: 2 } |
|
42 | XYPoint { x: 8; y: 2 } | |
43 | XYPoint { x: 9; y: 1 } |
|
43 | XYPoint { x: 9; y: 1 } | |
44 | XYPoint { x: 10; y: 3 } |
|
44 | XYPoint { x: 10; y: 3 } | |
45 | XYPoint { x: 11; y: 3 } |
|
45 | XYPoint { x: 11; y: 3 } | |
46 | } |
|
46 | } | |
47 | lowerSeries: LineSeries { |
|
47 | lowerSeries: LineSeries { | |
48 | XYPoint { x: 0; y: 0 } |
|
48 | XYPoint { x: 0; y: 0 } | |
49 | XYPoint { x: 1; y: 0 } |
|
49 | XYPoint { x: 1; y: 0 } | |
50 | XYPoint { x: 2; y: 0 } |
|
50 | XYPoint { x: 2; y: 0 } | |
51 | XYPoint { x: 3; y: 0 } |
|
51 | XYPoint { x: 3; y: 0 } | |
52 | XYPoint { x: 4; y: 0 } |
|
52 | XYPoint { x: 4; y: 0 } | |
53 | XYPoint { x: 5; y: 0 } |
|
53 | XYPoint { x: 5; y: 0 } | |
54 | XYPoint { x: 6; y: 0 } |
|
54 | XYPoint { x: 6; y: 0 } | |
55 | XYPoint { x: 7; y: 0 } |
|
55 | XYPoint { x: 7; y: 0 } | |
56 | XYPoint { x: 8; y: 0 } |
|
56 | XYPoint { x: 8; y: 0 } | |
57 | XYPoint { x: 9; y: 0 } |
|
57 | XYPoint { x: 9; y: 0 } | |
58 | XYPoint { x: 10; y: 0 } |
|
58 | XYPoint { x: 10; y: 0 } | |
59 | XYPoint { x: 11; y: 0 } |
|
59 | XYPoint { x: 11; y: 0 } | |
60 | } |
|
60 | } | |
61 |
|
61 | |||
62 | pointLabelsFormat: "@xPoint, @yPoint"; |
|
62 | pointLabelsFormat: "@xPoint, @yPoint"; | |
63 |
|
63 | |||
64 | onNameChanged: console.log(name + ".onNameChanged: " + name); |
|
64 | onNameChanged: console.log(name + ".onNameChanged: " + name); | |
65 | onVisibleChanged: console.log(name + ".onVisibleChanged: " + visible); |
|
65 | onVisibleChanged: console.log(name + ".onVisibleChanged: " + visible); | |
66 | onOpacityChanged: console.log(name + ".onOpacityChanged: " + opacity); |
|
66 | onOpacityChanged: console.log(name + ".onOpacityChanged: " + opacity); | |
67 | onClicked: console.log(name + ".onClicked: " + point.x + ", " + point.y); |
|
67 | onClicked: console.log(name + ".onClicked: " + point.x + ", " + point.y); | |
68 | onSelected: console.log(name + ".onSelected"); |
|
68 | onSelected: console.log(name + ".onSelected"); | |
69 | onColorChanged: console.log(name + ".onColorChanged: " + color); |
|
69 | onColorChanged: console.log(name + ".onColorChanged: " + color); | |
70 | onBorderColorChanged: console.log(name + ".onBorderColorChanged: " + borderColor); |
|
70 | onBorderColorChanged: console.log(name + ".onBorderColorChanged: " + borderColor); | |
71 | onBorderWidthChanged: console.log(name + ".onBorderChanged: " + borderWidth); |
|
71 | onBorderWidthChanged: console.log(name + ".onBorderChanged: " + borderWidth); | |
72 | // onCountChanged: console.log(name + ".onCountChanged: " + count); |
|
72 | // onCountChanged: console.log(name + ".onCountChanged: " + count); | |
73 | onHovered: console.log("lineSeries.onHovered:" + point.x + "," + point.y + " " + state); |
|
73 | onHovered: console.log("lineSeries.onHovered:" + point.x + "," + point.y + " " + state); | |
74 | onPointLabelsVisibilityChanged: console.log(name + ".onPointLabelsVisibilityChanged: " |
|
74 | onPointLabelsVisibilityChanged: console.log(name + ".onPointLabelsVisibilityChanged: " | |
75 | + visible); |
|
75 | + visible); | |
76 | onPointLabelsFormatChanged: console.log(name + ".onPointLabelsFormatChanged: " |
|
76 | onPointLabelsFormatChanged: console.log(name + ".onPointLabelsFormatChanged: " | |
77 | + format); |
|
77 | + format); | |
78 | onPointLabelsFontChanged: console.log(name + ".onPointLabelsFontChanged: " |
|
78 | onPointLabelsFontChanged: console.log(name + ".onPointLabelsFontChanged: " | |
79 | + font.family); |
|
79 | + font.family); | |
80 | onPointLabelsColorChanged: console.log(name + ".onPointLabelsColorChanged: " |
|
80 | onPointLabelsColorChanged: console.log(name + ".onPointLabelsColorChanged: " | |
81 | + color); |
|
81 | + color); | |
|
82 | onPointLabelsClippingChanged: console.log(name + ".onPointLabelsClippingChanged: " | |||
|
83 | + clipping); | |||
82 | onPressed: console.log(name + ".onPressed: " + point.x + ", " + point.y); |
|
84 | onPressed: console.log(name + ".onPressed: " + point.x + ", " + point.y); | |
83 | onReleased: console.log(name + ".onReleased: " + point.x + ", " + point.y); |
|
85 | onReleased: console.log(name + ".onReleased: " + point.x + ", " + point.y); | |
84 | onDoubleClicked: console.log(name + ".onDoubleClicked: " + point.x + ", " + point.y); |
|
86 | onDoubleClicked: console.log(name + ".onDoubleClicked: " + point.x + ", " + point.y); | |
85 | } |
|
87 | } | |
86 |
|
88 | |||
87 | AreaSeries { |
|
89 | AreaSeries { | |
88 | name: "area 2" |
|
90 | name: "area 2" | |
89 |
|
91 | |||
90 | upperSeries: LineSeries { |
|
92 | upperSeries: LineSeries { | |
91 | XYPoint { x: 0; y: 0.5 } |
|
93 | XYPoint { x: 0; y: 0.5 } | |
92 | XYPoint { x: 1; y: 1.5 } |
|
94 | XYPoint { x: 1; y: 1.5 } | |
93 | XYPoint { x: 2; y: 0.3 } |
|
95 | XYPoint { x: 2; y: 0.3 } | |
94 | XYPoint { x: 3; y: 1.5 } |
|
96 | XYPoint { x: 3; y: 1.5 } | |
95 | XYPoint { x: 4; y: 0.1 } |
|
97 | XYPoint { x: 4; y: 0.1 } | |
96 | XYPoint { x: 5; y: 0.3 } |
|
98 | XYPoint { x: 5; y: 0.3 } | |
97 | XYPoint { x: 6; y: 1.2 } |
|
99 | XYPoint { x: 6; y: 1.2 } | |
98 | XYPoint { x: 7; y: 1.3 } |
|
100 | XYPoint { x: 7; y: 1.3 } | |
99 | XYPoint { x: 8; y: 0.2 } |
|
101 | XYPoint { x: 8; y: 0.2 } | |
100 | XYPoint { x: 9; y: 0.1 } |
|
102 | XYPoint { x: 9; y: 0.1 } | |
101 | XYPoint { x: 10; y: 3.2 } |
|
103 | XYPoint { x: 10; y: 3.2 } | |
102 | XYPoint { x: 11; y: 4.6 } |
|
104 | XYPoint { x: 11; y: 4.6 } | |
103 | } |
|
105 | } | |
104 |
|
106 | |||
105 | onNameChanged: console.log(name + ".onNameChanged: " + name); |
|
107 | onNameChanged: console.log(name + ".onNameChanged: " + name); | |
106 | onVisibleChanged: console.log(name + ".onVisibleChanged: " + visible); |
|
108 | onVisibleChanged: console.log(name + ".onVisibleChanged: " + visible); | |
107 | onClicked: console.log(name + ".onClicked: " + point.x + ", " + point.y); |
|
109 | onClicked: console.log(name + ".onClicked: " + point.x + ", " + point.y); | |
108 | onSelected: console.log(name + ".onSelected"); |
|
110 | onSelected: console.log(name + ".onSelected"); | |
109 | onColorChanged: console.log(name + ".onColorChanged: " + color); |
|
111 | onColorChanged: console.log(name + ".onColorChanged: " + color); | |
110 | onBorderColorChanged: console.log(name + ".onBorderColorChanged: " + borderColor); |
|
112 | onBorderColorChanged: console.log(name + ".onBorderColorChanged: " + borderColor); | |
111 | onPressed: console.log(name + ".onPressed: " + point.x + ", " + point.y); |
|
113 | onPressed: console.log(name + ".onPressed: " + point.x + ", " + point.y); | |
112 | onReleased: console.log(name + ".onReleased: " + point.x + ", " + point.y); |
|
114 | onReleased: console.log(name + ".onReleased: " + point.x + ", " + point.y); | |
113 | onDoubleClicked: console.log(name + ".onDoubleClicked: " + point.x + ", " + point.y); |
|
115 | onDoubleClicked: console.log(name + ".onDoubleClicked: " + point.x + ", " + point.y); | |
114 | } |
|
116 | } | |
115 | } |
|
117 | } |
@@ -1,109 +1,113 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
3 | ** Copyright (C) 2015 The Qt Company Ltd | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Charts module. |
|
7 | ** This file is part of the Qt Charts module. | |
8 | ** |
|
8 | ** | |
9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
9 | ** Licensees holding valid commercial license for Qt may use this file in | |
10 | ** accordance with the Qt License Agreement provided with the Software |
|
10 | ** accordance with the Qt License Agreement provided with the Software | |
11 | ** or, alternatively, in accordance with the terms contained in a written |
|
11 | ** or, alternatively, in accordance with the terms contained in a written | |
12 | ** agreement between you and The Qt Company. |
|
12 | ** agreement between you and The Qt Company. | |
13 | ** |
|
13 | ** | |
14 | ** If you have questions regarding the use of this file, please use |
|
14 | ** If you have questions regarding the use of this file, please use | |
15 | ** contact form at http://qt.io |
|
15 | ** contact form at http://qt.io | |
16 | ** |
|
16 | ** | |
17 | ****************************************************************************/ |
|
17 | ****************************************************************************/ | |
18 |
|
18 | |||
19 | import QtQuick 2.0 |
|
19 | import QtQuick 2.0 | |
20 |
|
20 | |||
21 | Flow { |
|
21 | Flow { | |
22 | id: flow |
|
22 | id: flow | |
23 | spacing: 5 |
|
23 | spacing: 5 | |
24 | flow: Flow.TopToBottom |
|
24 | flow: Flow.TopToBottom | |
25 | property variant series |
|
25 | property variant series | |
26 |
|
26 | |||
27 | Button { |
|
27 | Button { | |
28 | text: "visible" |
|
28 | text: "visible" | |
29 | onClicked: series.visible = !series.visible; |
|
29 | onClicked: series.visible = !series.visible; | |
30 | } |
|
30 | } | |
31 | Button { |
|
31 | Button { | |
32 | text: "opacity +" |
|
32 | text: "opacity +" | |
33 | onClicked: series.opacity += 0.1; |
|
33 | onClicked: series.opacity += 0.1; | |
34 | } |
|
34 | } | |
35 | Button { |
|
35 | Button { | |
36 | text: "opacity -" |
|
36 | text: "opacity -" | |
37 | onClicked: series.opacity -= 0.1; |
|
37 | onClicked: series.opacity -= 0.1; | |
38 | } |
|
38 | } | |
39 | Button { |
|
39 | Button { | |
40 | text: "color" |
|
40 | text: "color" | |
41 | onClicked: series.color = main.nextColor(); |
|
41 | onClicked: series.color = main.nextColor(); | |
42 | } |
|
42 | } | |
43 | Button { |
|
43 | Button { | |
44 | text: "borderColor" |
|
44 | text: "borderColor" | |
45 | onClicked: series.borderColor = main.nextColor(); |
|
45 | onClicked: series.borderColor = main.nextColor(); | |
46 | } |
|
46 | } | |
47 | Button { |
|
47 | Button { | |
48 | text: series != undefined ? "borderWidth + (" + series.borderWidth + ")" : "" |
|
48 | text: series != undefined ? "borderWidth + (" + series.borderWidth + ")" : "" | |
49 | onClicked: series.borderWidth += 0.5; |
|
49 | onClicked: series.borderWidth += 0.5; | |
50 | } |
|
50 | } | |
51 | Button { |
|
51 | Button { | |
52 | text: series != undefined ? "borderWidth - (" + series.borderWidth + ")" : "" |
|
52 | text: series != undefined ? "borderWidth - (" + series.borderWidth + ")" : "" | |
53 | onClicked: series.borderWidth -= 0.5; |
|
53 | onClicked: series.borderWidth -= 0.5; | |
54 | } |
|
54 | } | |
55 | Button { |
|
55 | Button { | |
56 | text: "point labels visible" |
|
56 | text: "point labels visible" | |
57 | onClicked: series.pointLabelsVisible = !series.pointLabelsVisible; |
|
57 | onClicked: series.pointLabelsVisible = !series.pointLabelsVisible; | |
58 | } |
|
58 | } | |
59 | Button { |
|
59 | Button { | |
60 | text: "point labels format" |
|
60 | text: "point labels format" | |
61 | onClicked: { |
|
61 | onClicked: { | |
62 | if (series.pointLabelsFormat === "@xPoint, @yPoint") |
|
62 | if (series.pointLabelsFormat === "@xPoint, @yPoint") | |
63 | series.pointLabelsFormat = "(@xPoint)" |
|
63 | series.pointLabelsFormat = "(@xPoint)" | |
64 | else |
|
64 | else | |
65 | series.pointLabelsFormat = "@xPoint, @yPoint" |
|
65 | series.pointLabelsFormat = "@xPoint, @yPoint" | |
66 | } |
|
66 | } | |
67 | } |
|
67 | } | |
68 | Button { |
|
68 | Button { | |
69 | text: "point labels font" |
|
69 | text: "point labels font" | |
70 | onClicked: { |
|
70 | onClicked: { | |
71 | if (series.pointLabelsFont.family === "Times") |
|
71 | if (series.pointLabelsFont.family === "Times") | |
72 | series.pointLabelsFont.family = "Courier"; |
|
72 | series.pointLabelsFont.family = "Courier"; | |
73 | else |
|
73 | else | |
74 | series.pointLabelsFont.family = "Times"; |
|
74 | series.pointLabelsFont.family = "Times"; | |
75 | } |
|
75 | } | |
76 | } |
|
76 | } | |
77 | Button { |
|
77 | Button { | |
78 | text: "point labels color" |
|
78 | text: "point labels color" | |
79 | onClicked: series.pointLabelsColor = main.nextColor(); |
|
79 | onClicked: series.pointLabelsColor = main.nextColor(); | |
80 | } |
|
80 | } | |
81 | Button { |
|
81 | Button { | |
|
82 | text: "point labels clipping" | |||
|
83 | onClicked: series.pointLabelsClipping = !series.pointLabelsClipping; | |||
|
84 | } | |||
|
85 | Button { | |||
82 | id: upperButton |
|
86 | id: upperButton | |
83 | text: "upper series" |
|
87 | text: "upper series" | |
84 | unpressedColor: "#79bd8f" |
|
88 | unpressedColor: "#79bd8f" | |
85 | onClicked: { |
|
89 | onClicked: { | |
86 | lineEditor.visible = true; |
|
90 | lineEditor.visible = true; | |
87 | color = "#00a388"; |
|
91 | color = "#00a388"; | |
88 | lowerButton.color = "#79bd8f"; |
|
92 | lowerButton.color = "#79bd8f"; | |
89 | lineEditor.series = series.upperSeries; |
|
93 | lineEditor.series = series.upperSeries; | |
90 | } |
|
94 | } | |
91 | } |
|
95 | } | |
92 | Button { |
|
96 | Button { | |
93 | id: lowerButton |
|
97 | id: lowerButton | |
94 | text: "lower series" |
|
98 | text: "lower series" | |
95 | unpressedColor: "#79bd8f" |
|
99 | unpressedColor: "#79bd8f" | |
96 | onClicked: { |
|
100 | onClicked: { | |
97 | lineEditor.visible = true; |
|
101 | lineEditor.visible = true; | |
98 | color = "#00a388"; |
|
102 | color = "#00a388"; | |
99 | upperButton.color = "#79bd8f"; |
|
103 | upperButton.color = "#79bd8f"; | |
100 | lineEditor.series = series.lowerSeries; |
|
104 | lineEditor.series = series.lowerSeries; | |
101 | } |
|
105 | } | |
102 | } |
|
106 | } | |
103 | LineEditor { |
|
107 | LineEditor { | |
104 | id: lineEditor |
|
108 | id: lineEditor | |
105 | visible: false |
|
109 | visible: false | |
106 | } |
|
110 | } | |
107 |
|
111 | |||
108 | onSeriesChanged: lineEditor.series = series.upperSeries; |
|
112 | onSeriesChanged: lineEditor.series = series.upperSeries; | |
109 | } |
|
113 | } |
@@ -1,82 +1,84 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
3 | ** Copyright (C) 2015 The Qt Company Ltd | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Charts module. |
|
7 | ** This file is part of the Qt Charts module. | |
8 | ** |
|
8 | ** | |
9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
9 | ** Licensees holding valid commercial license for Qt may use this file in | |
10 | ** accordance with the Qt License Agreement provided with the Software |
|
10 | ** accordance with the Qt License Agreement provided with the Software | |
11 | ** or, alternatively, in accordance with the terms contained in a written |
|
11 | ** or, alternatively, in accordance with the terms contained in a written | |
12 | ** agreement between you and The Qt Company. |
|
12 | ** agreement between you and The Qt Company. | |
13 | ** |
|
13 | ** | |
14 | ** If you have questions regarding the use of this file, please use |
|
14 | ** If you have questions regarding the use of this file, please use | |
15 | ** contact form at http://qt.io |
|
15 | ** contact form at http://qt.io | |
16 | ** |
|
16 | ** | |
17 | ****************************************************************************/ |
|
17 | ****************************************************************************/ | |
18 |
|
18 | |||
19 | import QtQuick 2.0 |
|
19 | import QtQuick 2.0 | |
20 | import QtCharts 2.0 |
|
20 | import QtCharts 2.0 | |
21 |
|
21 | |||
22 | ChartView { |
|
22 | ChartView { | |
23 | property variant series: lineSeries |
|
23 | property variant series: lineSeries | |
24 |
|
24 | |||
25 | title: "line series" |
|
25 | title: "line series" | |
26 | anchors.fill: parent |
|
26 | anchors.fill: parent | |
27 | animationOptions: ChartView.SeriesAnimations |
|
27 | animationOptions: ChartView.SeriesAnimations | |
28 |
|
28 | |||
29 | LineSeries { |
|
29 | LineSeries { | |
30 | id: lineSeries |
|
30 | id: lineSeries | |
31 | name: "line 1" |
|
31 | name: "line 1" | |
32 | XYPoint { x: 0; y: 0 } |
|
32 | XYPoint { x: 0; y: 0 } | |
33 | XYPoint { x: 1.1; y: 2.1 } |
|
33 | XYPoint { x: 1.1; y: 2.1 } | |
34 | XYPoint { x: 1.9; y: 3.3 } |
|
34 | XYPoint { x: 1.9; y: 3.3 } | |
35 | XYPoint { x: 2.1; y: 2.1 } |
|
35 | XYPoint { x: 2.1; y: 2.1 } | |
36 | XYPoint { x: 2.9; y: 4.9 } |
|
36 | XYPoint { x: 2.9; y: 4.9 } | |
37 | XYPoint { x: 3.4; y: 3.0 } |
|
37 | XYPoint { x: 3.4; y: 3.0 } | |
38 | XYPoint { x: 4.1; y: 3.3 } |
|
38 | XYPoint { x: 4.1; y: 3.3 } | |
39 |
|
39 | |||
40 | pointLabelsFormat: "@xPoint, @yPoint"; |
|
40 | pointLabelsFormat: "@xPoint, @yPoint"; | |
41 |
|
41 | |||
42 | onNameChanged: console.log("lineSeries.onNameChanged: " + name); |
|
42 | onNameChanged: console.log("lineSeries.onNameChanged: " + name); | |
43 | onVisibleChanged: console.log("lineSeries.onVisibleChanged: " + visible); |
|
43 | onVisibleChanged: console.log("lineSeries.onVisibleChanged: " + visible); | |
44 | onOpacityChanged: console.log(name + ".onOpacityChanged: " + opacity); |
|
44 | onOpacityChanged: console.log(name + ".onOpacityChanged: " + opacity); | |
45 | onClicked: console.log(name + ".onClicked: " + point.x + ", " + point.y); |
|
45 | onClicked: console.log(name + ".onClicked: " + point.x + ", " + point.y); | |
46 | onPointReplaced: console.log("lineSeries.onPointReplaced: " + index); |
|
46 | onPointReplaced: console.log("lineSeries.onPointReplaced: " + index); | |
47 | onPointRemoved: console.log("lineSeries.onPointRemoved: " + index); |
|
47 | onPointRemoved: console.log("lineSeries.onPointRemoved: " + index); | |
48 | onPointAdded: console.log("lineSeries.onPointAdded: " + series.at(index).x + ", " + series.at(index).y); |
|
48 | onPointAdded: console.log("lineSeries.onPointAdded: " + series.at(index).x + ", " + series.at(index).y); | |
49 | onColorChanged: console.log("lineSeries.onColorChanged: " + color); |
|
49 | onColorChanged: console.log("lineSeries.onColorChanged: " + color); | |
50 | onWidthChanged: console.log("lineSeries.onWidthChanged: " + width); |
|
50 | onWidthChanged: console.log("lineSeries.onWidthChanged: " + width); | |
51 | onStyleChanged: console.log("lineSeries.onStyleChanged: " + style); |
|
51 | onStyleChanged: console.log("lineSeries.onStyleChanged: " + style); | |
52 | onCapStyleChanged: console.log("lineSeries.onCapStyleChanged: " + capStyle); |
|
52 | onCapStyleChanged: console.log("lineSeries.onCapStyleChanged: " + capStyle); | |
53 | onCountChanged: console.log("lineSeries.onCountChanged: " + count); |
|
53 | onCountChanged: console.log("lineSeries.onCountChanged: " + count); | |
54 | onHovered: console.log("lineSeries.onHovered:" + point.x + "," + point.y + " " + state); |
|
54 | onHovered: console.log("lineSeries.onHovered:" + point.x + "," + point.y + " " + state); | |
55 | onPointLabelsVisibilityChanged: console.log("lineSeries.onPointLabelsVisibilityChanged: " |
|
55 | onPointLabelsVisibilityChanged: console.log("lineSeries.onPointLabelsVisibilityChanged: " | |
56 | + visible); |
|
56 | + visible); | |
57 | onPointLabelsFormatChanged: console.log("lineSeries.onPointLabelsFormatChanged: " |
|
57 | onPointLabelsFormatChanged: console.log("lineSeries.onPointLabelsFormatChanged: " | |
58 | + format); |
|
58 | + format); | |
59 | onPointLabelsFontChanged: console.log("lineSeries.onPointLabelsFontChanged: " |
|
59 | onPointLabelsFontChanged: console.log("lineSeries.onPointLabelsFontChanged: " | |
60 | + font.family); |
|
60 | + font.family); | |
61 | onPointLabelsColorChanged: console.log("lineSeries.onPointLabelsColorChanged: " |
|
61 | onPointLabelsColorChanged: console.log("lineSeries.onPointLabelsColorChanged: " | |
62 | + color); |
|
62 | + color); | |
|
63 | onPointLabelsClippingChanged: console.log("lineSeries.onPointLabelsClippingChanged: " | |||
|
64 | + clipping); | |||
63 | onPressed: console.log(name + ".onPressed: " + point.x + ", " + point.y); |
|
65 | onPressed: console.log(name + ".onPressed: " + point.x + ", " + point.y); | |
64 | onReleased: console.log(name + ".onReleased: " + point.x + ", " + point.y); |
|
66 | onReleased: console.log(name + ".onReleased: " + point.x + ", " + point.y); | |
65 | onDoubleClicked: console.log(name + ".onDoubleClicked: " + point.x + ", " + point.y); |
|
67 | onDoubleClicked: console.log(name + ".onDoubleClicked: " + point.x + ", " + point.y); | |
66 | } |
|
68 | } | |
67 |
|
69 | |||
68 | LineSeries { |
|
70 | LineSeries { | |
69 | name: "line 2" |
|
71 | name: "line 2" | |
70 | XYPoint { x: 1.1; y: 1.1 } |
|
72 | XYPoint { x: 1.1; y: 1.1 } | |
71 | XYPoint { x: 1.9; y: 2.3 } |
|
73 | XYPoint { x: 1.9; y: 2.3 } | |
72 | XYPoint { x: 2.1; y: 1.1 } |
|
74 | XYPoint { x: 2.1; y: 1.1 } | |
73 | XYPoint { x: 2.9; y: 3.9 } |
|
75 | XYPoint { x: 2.9; y: 3.9 } | |
74 | XYPoint { x: 3.4; y: 2.0 } |
|
76 | XYPoint { x: 3.4; y: 2.0 } | |
75 | XYPoint { x: 4.1; y: 2.3 } |
|
77 | XYPoint { x: 4.1; y: 2.3 } | |
76 | onClicked: console.log(name + ".onClicked: " + point.x + ", " + point.y); |
|
78 | onClicked: console.log(name + ".onClicked: " + point.x + ", " + point.y); | |
77 | onHovered: console.log(name + ".onHovered: " + point.x + ", " + point.y); |
|
79 | onHovered: console.log(name + ".onHovered: " + point.x + ", " + point.y); | |
78 | onPressed: console.log(name + ".onPressed: " + point.x + ", " + point.y); |
|
80 | onPressed: console.log(name + ".onPressed: " + point.x + ", " + point.y); | |
79 | onReleased: console.log(name + ".onReleased: " + point.x + ", " + point.y); |
|
81 | onReleased: console.log(name + ".onReleased: " + point.x + ", " + point.y); | |
80 | onDoubleClicked: console.log(name + ".onDoubleClicked: " + point.x + ", " + point.y); |
|
82 | onDoubleClicked: console.log(name + ".onDoubleClicked: " + point.x + ", " + point.y); | |
81 | } |
|
83 | } | |
82 | } |
|
84 | } |
@@ -1,131 +1,135 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
3 | ** Copyright (C) 2015 The Qt Company Ltd | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Charts module. |
|
7 | ** This file is part of the Qt Charts module. | |
8 | ** |
|
8 | ** | |
9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
9 | ** Licensees holding valid commercial license for Qt may use this file in | |
10 | ** accordance with the Qt License Agreement provided with the Software |
|
10 | ** accordance with the Qt License Agreement provided with the Software | |
11 | ** or, alternatively, in accordance with the terms contained in a written |
|
11 | ** or, alternatively, in accordance with the terms contained in a written | |
12 | ** agreement between you and The Qt Company. |
|
12 | ** agreement between you and The Qt Company. | |
13 | ** |
|
13 | ** | |
14 | ** If you have questions regarding the use of this file, please use |
|
14 | ** If you have questions regarding the use of this file, please use | |
15 | ** contact form at http://qt.io |
|
15 | ** contact form at http://qt.io | |
16 | ** |
|
16 | ** | |
17 | ****************************************************************************/ |
|
17 | ****************************************************************************/ | |
18 |
|
18 | |||
19 | import QtQuick 2.0 |
|
19 | import QtQuick 2.0 | |
20 |
|
20 | |||
21 |
|
21 | |||
22 | Flow { |
|
22 | Flow { | |
23 | id: flow |
|
23 | id: flow | |
24 | spacing: 5 |
|
24 | spacing: 5 | |
25 | flow: Flow.TopToBottom |
|
25 | flow: Flow.TopToBottom | |
26 | property variant series |
|
26 | property variant series | |
27 |
|
27 | |||
28 | Button { |
|
28 | Button { | |
29 | text: "visible" |
|
29 | text: "visible" | |
30 | onClicked: series.visible = !series.visible; |
|
30 | onClicked: series.visible = !series.visible; | |
31 | } |
|
31 | } | |
32 | Button { |
|
32 | Button { | |
33 | text: "opacity +" |
|
33 | text: "opacity +" | |
34 | onClicked: series.opacity += 0.1; |
|
34 | onClicked: series.opacity += 0.1; | |
35 | } |
|
35 | } | |
36 | Button { |
|
36 | Button { | |
37 | text: "opacity -" |
|
37 | text: "opacity -" | |
38 | onClicked: series.opacity -= 0.1; |
|
38 | onClicked: series.opacity -= 0.1; | |
39 | } |
|
39 | } | |
40 | Button { |
|
40 | Button { | |
41 | text: "color" |
|
41 | text: "color" | |
42 | onClicked: series.color = main.nextColor(); |
|
42 | onClicked: series.color = main.nextColor(); | |
43 | } |
|
43 | } | |
44 | Button { |
|
44 | Button { | |
45 | text: series != undefined ? "width + (" + series.width + ")" : "" |
|
45 | text: series != undefined ? "width + (" + series.width + ")" : "" | |
46 | onClicked: series.width += 0.5; |
|
46 | onClicked: series.width += 0.5; | |
47 | } |
|
47 | } | |
48 | Button { |
|
48 | Button { | |
49 | text: series != undefined ? "width - (" + series.width + ")" : "" |
|
49 | text: series != undefined ? "width - (" + series.width + ")" : "" | |
50 | onClicked: series.width -= 0.5; |
|
50 | onClicked: series.width -= 0.5; | |
51 | } |
|
51 | } | |
52 | Button { |
|
52 | Button { | |
53 | text: series != undefined ? "style + (" + series.style + ")" : "" |
|
53 | text: series != undefined ? "style + (" + series.style + ")" : "" | |
54 | onClicked: series.style++; |
|
54 | onClicked: series.style++; | |
55 | } |
|
55 | } | |
56 | Button { |
|
56 | Button { | |
57 | text: series != undefined ? "style - (" + series.style + ")" : "" |
|
57 | text: series != undefined ? "style - (" + series.style + ")" : "" | |
58 | onClicked: series.style--; |
|
58 | onClicked: series.style--; | |
59 | } |
|
59 | } | |
60 | Button { |
|
60 | Button { | |
61 | text: series != undefined ? "cap style + (" + series.capStyle + ")" : "" |
|
61 | text: series != undefined ? "cap style + (" + series.capStyle + ")" : "" | |
62 | onClicked: series.capStyle++; |
|
62 | onClicked: series.capStyle++; | |
63 | } |
|
63 | } | |
64 | Button { |
|
64 | Button { | |
65 | text: series != undefined ? "cap style - (" +series.capStyle + ")" : "" |
|
65 | text: series != undefined ? "cap style - (" +series.capStyle + ")" : "" | |
66 | onClicked: series.capStyle--; |
|
66 | onClicked: series.capStyle--; | |
67 | } |
|
67 | } | |
68 | Button { |
|
68 | Button { | |
69 | text: "points visible" |
|
69 | text: "points visible" | |
70 | onClicked: series.pointsVisible = !series.pointsVisible; |
|
70 | onClicked: series.pointsVisible = !series.pointsVisible; | |
71 | } |
|
71 | } | |
72 | Button { |
|
72 | Button { | |
73 | text: "point labels visible" |
|
73 | text: "point labels visible" | |
74 | onClicked: series.pointLabelsVisible = !series.pointLabelsVisible; |
|
74 | onClicked: series.pointLabelsVisible = !series.pointLabelsVisible; | |
75 | } |
|
75 | } | |
76 | Button { |
|
76 | Button { | |
77 | text: "point labels format" |
|
77 | text: "point labels format" | |
78 | onClicked: { |
|
78 | onClicked: { | |
79 | if (series.pointLabelsFormat === "@xPoint, @yPoint") |
|
79 | if (series.pointLabelsFormat === "@xPoint, @yPoint") | |
80 | series.pointLabelsFormat = "(@xPoint)" |
|
80 | series.pointLabelsFormat = "(@xPoint)" | |
81 | else |
|
81 | else | |
82 | series.pointLabelsFormat = "@xPoint, @yPoint" |
|
82 | series.pointLabelsFormat = "@xPoint, @yPoint" | |
83 | } |
|
83 | } | |
84 | } |
|
84 | } | |
85 | Button { |
|
85 | Button { | |
86 | text: "point labels font" |
|
86 | text: "point labels font" | |
87 | onClicked: { |
|
87 | onClicked: { | |
88 | if (series.pointLabelsFont.family === "Times") |
|
88 | if (series.pointLabelsFont.family === "Times") | |
89 | series.pointLabelsFont.family = "Courier"; |
|
89 | series.pointLabelsFont.family = "Courier"; | |
90 | else |
|
90 | else | |
91 | series.pointLabelsFont.family = "Times"; |
|
91 | series.pointLabelsFont.family = "Times"; | |
92 | } |
|
92 | } | |
93 | } |
|
93 | } | |
94 | Button { |
|
94 | Button { | |
95 | text: "point labels color" |
|
95 | text: "point labels color" | |
96 | onClicked: series.pointLabelsColor = main.nextColor(); |
|
96 | onClicked: series.pointLabelsColor = main.nextColor(); | |
97 | } |
|
97 | } | |
98 | Button { |
|
98 | Button { | |
|
99 | text: "point labels clipping" | |||
|
100 | onClicked: series.pointLabelsClipping = !series.pointLabelsClipping; | |||
|
101 | } | |||
|
102 | Button { | |||
99 | text: "append point" |
|
103 | text: "append point" | |
100 | onClicked: series.append(series.count - 1, series.count - 1); |
|
104 | onClicked: series.append(series.count - 1, series.count - 1); | |
101 | } |
|
105 | } | |
102 | Button { |
|
106 | Button { | |
103 | text: "replace point" |
|
107 | text: "replace point" | |
104 | onClicked: { |
|
108 | onClicked: { | |
105 | var xyPoint = series.at(series.count - 1); |
|
109 | var xyPoint = series.at(series.count - 1); | |
106 | series.replace(series.count - 1, xyPoint.x, xyPoint.y + 0.1); |
|
110 | series.replace(series.count - 1, xyPoint.x, xyPoint.y + 0.1); | |
107 | } |
|
111 | } | |
108 | } |
|
112 | } | |
109 | Button { |
|
113 | Button { | |
110 | text: "remove point" |
|
114 | text: "remove point" | |
111 | onClicked: series.remove(series.count - 1); |
|
115 | onClicked: series.remove(series.count - 1); | |
112 | } |
|
116 | } | |
113 | Button { |
|
117 | Button { | |
114 | text: "remove points" |
|
118 | text: "remove points" | |
115 | onClicked: { |
|
119 | onClicked: { | |
116 | var count = 3; |
|
120 | var count = 3; | |
117 | if (series.count < 3) |
|
121 | if (series.count < 3) | |
118 | count = series.count |
|
122 | count = series.count | |
119 | var index = series.count - count; |
|
123 | var index = series.count - count; | |
120 | series.removePoints(index, count); |
|
124 | series.removePoints(index, count); | |
121 | } |
|
125 | } | |
122 | } |
|
126 | } | |
123 | Button { |
|
127 | Button { | |
124 | text: "insert point" |
|
128 | text: "insert point" | |
125 | onClicked: series.insert(series.count - 2, series.count - 2, series.count - 2); |
|
129 | onClicked: series.insert(series.count - 2, series.count - 2, series.count - 2); | |
126 | } |
|
130 | } | |
127 | Button { |
|
131 | Button { | |
128 | text: "clear" |
|
132 | text: "clear" | |
129 | onClicked: series.clear(); |
|
133 | onClicked: series.clear(); | |
130 | } |
|
134 | } | |
131 | } |
|
135 | } |
@@ -1,80 +1,82 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
3 | ** Copyright (C) 2015 The Qt Company Ltd | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Charts module. |
|
7 | ** This file is part of the Qt Charts module. | |
8 | ** |
|
8 | ** | |
9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
9 | ** Licensees holding valid commercial license for Qt may use this file in | |
10 | ** accordance with the Qt License Agreement provided with the Software |
|
10 | ** accordance with the Qt License Agreement provided with the Software | |
11 | ** or, alternatively, in accordance with the terms contained in a written |
|
11 | ** or, alternatively, in accordance with the terms contained in a written | |
12 | ** agreement between you and The Qt Company. |
|
12 | ** agreement between you and The Qt Company. | |
13 | ** |
|
13 | ** | |
14 | ** If you have questions regarding the use of this file, please use |
|
14 | ** If you have questions regarding the use of this file, please use | |
15 | ** contact form at http://qt.io |
|
15 | ** contact form at http://qt.io | |
16 | ** |
|
16 | ** | |
17 | ****************************************************************************/ |
|
17 | ****************************************************************************/ | |
18 |
|
18 | |||
19 | import QtQuick 2.0 |
|
19 | import QtQuick 2.0 | |
20 | import QtCharts 2.0 |
|
20 | import QtCharts 2.0 | |
21 |
|
21 | |||
22 | ChartView { |
|
22 | ChartView { | |
23 | title: "scatter series" |
|
23 | title: "scatter series" | |
24 | property variant series: scatterSeries |
|
24 | property variant series: scatterSeries | |
25 | animationOptions: ChartView.SeriesAnimations |
|
25 | animationOptions: ChartView.SeriesAnimations | |
26 |
|
26 | |||
27 | ScatterSeries { |
|
27 | ScatterSeries { | |
28 | id: scatterSeries |
|
28 | id: scatterSeries | |
29 | name: "scatter 1" |
|
29 | name: "scatter 1" | |
30 | XYPoint { x: 1.5; y: 1.5 } |
|
30 | XYPoint { x: 1.5; y: 1.5 } | |
31 | XYPoint { x: 1.5; y: 1.6 } |
|
31 | XYPoint { x: 1.5; y: 1.6 } | |
32 | XYPoint { x: 1.57; y: 1.55 } |
|
32 | XYPoint { x: 1.57; y: 1.55 } | |
33 | XYPoint { x: 1.8; y: 1.8 } |
|
33 | XYPoint { x: 1.8; y: 1.8 } | |
34 | XYPoint { x: 1.9; y: 1.6 } |
|
34 | XYPoint { x: 1.9; y: 1.6 } | |
35 | XYPoint { x: 2.1; y: 1.3 } |
|
35 | XYPoint { x: 2.1; y: 1.3 } | |
36 | XYPoint { x: 2.5; y: 2.1 } |
|
36 | XYPoint { x: 2.5; y: 2.1 } | |
37 |
|
37 | |||
38 | pointLabelsFormat: "@xPoint, @yPoint"; |
|
38 | pointLabelsFormat: "@xPoint, @yPoint"; | |
39 |
|
39 | |||
40 | onNameChanged: console.log("scatterSeries.onNameChanged: " + name); |
|
40 | onNameChanged: console.log("scatterSeries.onNameChanged: " + name); | |
41 | onVisibleChanged: console.log("scatterSeries.onVisibleChanged: " + visible); |
|
41 | onVisibleChanged: console.log("scatterSeries.onVisibleChanged: " + visible); | |
42 | onOpacityChanged: console.log(name + ".onOpacityChanged: " + opacity); |
|
42 | onOpacityChanged: console.log(name + ".onOpacityChanged: " + opacity); | |
43 | onClicked: console.log(name + ".onClicked: " + point.x + ", " + point.y); |
|
43 | onClicked: console.log(name + ".onClicked: " + point.x + ", " + point.y); | |
44 | onHovered: console.log(name + ".onHovered: " + point.x + ", " + point.y); |
|
44 | onHovered: console.log(name + ".onHovered: " + point.x + ", " + point.y); | |
45 | onPointReplaced: console.log("scatterSeries.onPointReplaced: " + index); |
|
45 | onPointReplaced: console.log("scatterSeries.onPointReplaced: " + index); | |
46 | onPointRemoved: console.log("scatterSeries.onPointRemoved: " + index); |
|
46 | onPointRemoved: console.log("scatterSeries.onPointRemoved: " + index); | |
47 | onPointAdded: console.log("scatterSeries.onPointAdded: " + series.at(index).x + ", " + series.at(index).y); |
|
47 | onPointAdded: console.log("scatterSeries.onPointAdded: " + series.at(index).x + ", " + series.at(index).y); | |
48 | onColorChanged: console.log("scatterSeries.onColorChanged: " + color); |
|
48 | onColorChanged: console.log("scatterSeries.onColorChanged: " + color); | |
49 | onBorderColorChanged: console.log("scatterSeries.onBorderColorChanged: " + borderColor); |
|
49 | onBorderColorChanged: console.log("scatterSeries.onBorderColorChanged: " + borderColor); | |
50 | onBorderWidthChanged: console.log("scatterSeries.onBorderChanged: " + borderWidth); |
|
50 | onBorderWidthChanged: console.log("scatterSeries.onBorderChanged: " + borderWidth); | |
51 | onCountChanged: console.log("scatterSeries.onCountChanged: " + count); |
|
51 | onCountChanged: console.log("scatterSeries.onCountChanged: " + count); | |
52 | onPointLabelsVisibilityChanged: console.log("scatterSeries.onPointLabelsVisibilityChanged: " |
|
52 | onPointLabelsVisibilityChanged: console.log("scatterSeries.onPointLabelsVisibilityChanged: " | |
53 | + visible); |
|
53 | + visible); | |
54 | onPointLabelsFormatChanged: console.log("scatterSeries.onPointLabelsFormatChanged: " |
|
54 | onPointLabelsFormatChanged: console.log("scatterSeries.onPointLabelsFormatChanged: " | |
55 | + format); |
|
55 | + format); | |
56 | onPointLabelsFontChanged: console.log("scatterSeries.onPointLabelsFontChanged: " |
|
56 | onPointLabelsFontChanged: console.log("scatterSeries.onPointLabelsFontChanged: " | |
57 | + font.family); |
|
57 | + font.family); | |
58 | onPointLabelsColorChanged: console.log("scatterSeries.onPointLabelsColorChanged: " |
|
58 | onPointLabelsColorChanged: console.log("scatterSeries.onPointLabelsColorChanged: " | |
59 | + color); |
|
59 | + color); | |
|
60 | onPointLabelsClippingChanged: console.log("scatterSeries.onPointLabelsClippingChanged: " | |||
|
61 | + clipping); | |||
60 | onPressed: console.log(name + ".onPressed: " + point.x + ", " + point.y); |
|
62 | onPressed: console.log(name + ".onPressed: " + point.x + ", " + point.y); | |
61 | onReleased: console.log(name + ".onReleased: " + point.x + ", " + point.y); |
|
63 | onReleased: console.log(name + ".onReleased: " + point.x + ", " + point.y); | |
62 | onDoubleClicked: console.log(name + ".onDoubleClicked: " + point.x + ", " + point.y); |
|
64 | onDoubleClicked: console.log(name + ".onDoubleClicked: " + point.x + ", " + point.y); | |
63 | } |
|
65 | } | |
64 |
|
66 | |||
65 | ScatterSeries { |
|
67 | ScatterSeries { | |
66 | name: "scatter2" |
|
68 | name: "scatter2" | |
67 | XYPoint { x: 2.0; y: 2.0 } |
|
69 | XYPoint { x: 2.0; y: 2.0 } | |
68 | XYPoint { x: 2.0; y: 2.1 } |
|
70 | XYPoint { x: 2.0; y: 2.1 } | |
69 | XYPoint { x: 2.07; y: 2.05 } |
|
71 | XYPoint { x: 2.07; y: 2.05 } | |
70 | XYPoint { x: 2.2; y: 2.9 } |
|
72 | XYPoint { x: 2.2; y: 2.9 } | |
71 | XYPoint { x: 2.4; y: 2.7 } |
|
73 | XYPoint { x: 2.4; y: 2.7 } | |
72 | XYPoint { x: 2.67; y: 2.65 } |
|
74 | XYPoint { x: 2.67; y: 2.65 } | |
73 | onClicked: console.log(name + ".onClicked: " + point.x + ", " + point.y); |
|
75 | onClicked: console.log(name + ".onClicked: " + point.x + ", " + point.y); | |
74 | onHovered: console.log(name + ".onHovered: " + point.x + ", " + point.y); |
|
76 | onHovered: console.log(name + ".onHovered: " + point.x + ", " + point.y); | |
75 | onPressed: console.log(name + ".onPressed: " + point.x + ", " + point.y); |
|
77 | onPressed: console.log(name + ".onPressed: " + point.x + ", " + point.y); | |
76 | onReleased: console.log(name + ".onReleased: " + point.x + ", " + point.y); |
|
78 | onReleased: console.log(name + ".onReleased: " + point.x + ", " + point.y); | |
77 | onDoubleClicked: console.log(name + ".onDoubleClicked: " + point.x + ", " + point.y); |
|
79 | onDoubleClicked: console.log(name + ".onDoubleClicked: " + point.x + ", " + point.y); | |
78 | } |
|
80 | } | |
79 |
|
81 | |||
80 | } |
|
82 | } |
@@ -1,126 +1,134 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
3 | ** Copyright (C) 2015 The Qt Company Ltd | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Charts module. |
|
7 | ** This file is part of the Qt Charts module. | |
8 | ** |
|
8 | ** | |
9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
9 | ** Licensees holding valid commercial license for Qt may use this file in | |
10 | ** accordance with the Qt License Agreement provided with the Software |
|
10 | ** accordance with the Qt License Agreement provided with the Software | |
11 | ** or, alternatively, in accordance with the terms contained in a written |
|
11 | ** or, alternatively, in accordance with the terms contained in a written | |
12 | ** agreement between you and The Qt Company. |
|
12 | ** agreement between you and The Qt Company. | |
13 | ** |
|
13 | ** | |
14 | ** If you have questions regarding the use of this file, please use |
|
14 | ** If you have questions regarding the use of this file, please use | |
15 | ** contact form at http://qt.io |
|
15 | ** contact form at http://qt.io | |
16 | ** |
|
16 | ** | |
17 | ****************************************************************************/ |
|
17 | ****************************************************************************/ | |
18 |
|
18 | |||
19 | import QtQuick 2.0 |
|
19 | import QtQuick 2.0 | |
20 |
|
20 | |||
21 | Flow { |
|
21 | Flow { | |
22 | id: flow |
|
22 | id: flow | |
23 | spacing: 5 |
|
23 | spacing: 5 | |
24 | flow: Flow.TopToBottom |
|
24 | flow: Flow.TopToBottom | |
25 | property variant series |
|
25 | property variant series | |
26 |
|
26 | |||
27 | Button { |
|
27 | Button { | |
28 | text: "visible" |
|
28 | text: "visible" | |
29 | onClicked: series.visible = !series.visible; |
|
29 | onClicked: series.visible = !series.visible; | |
30 | } |
|
30 | } | |
31 | Button { |
|
31 | Button { | |
32 | text: "opacity +" |
|
32 | text: "opacity +" | |
33 | onClicked: series.opacity += 0.1; |
|
33 | onClicked: series.opacity += 0.1; | |
34 | } |
|
34 | } | |
35 | Button { |
|
35 | Button { | |
36 | text: "opacity -" |
|
36 | text: "opacity -" | |
37 | onClicked: series.opacity -= 0.1; |
|
37 | onClicked: series.opacity -= 0.1; | |
38 | } |
|
38 | } | |
39 | Button { |
|
39 | Button { | |
40 | text: "color" |
|
40 | text: "color" | |
41 | onClicked: series.color = main.nextColor(); |
|
41 | onClicked: series.color = main.nextColor(); | |
42 | } |
|
42 | } | |
43 | Button { |
|
43 | Button { | |
44 | text: "borderColor" |
|
44 | text: "borderColor" | |
45 | onClicked: series.borderColor = main.nextColor(); |
|
45 | onClicked: series.borderColor = main.nextColor(); | |
46 | } |
|
46 | } | |
47 | Button { |
|
47 | Button { | |
48 | text: series != undefined ? "borderWidth + (" + series.borderWidth + ")" : "" |
|
48 | text: series != undefined ? "borderWidth + (" + series.borderWidth + ")" : "" | |
49 | onClicked: series.borderWidth += 0.5; |
|
49 | onClicked: series.borderWidth += 0.5; | |
50 | } |
|
50 | } | |
51 | Button { |
|
51 | Button { | |
52 | text: series != undefined ? "borderWidth - (" + series.borderWidth + ")" : "" |
|
52 | text: series != undefined ? "borderWidth - (" + series.borderWidth + ")" : "" | |
53 | onClicked: series.borderWidth -= 0.5; |
|
53 | onClicked: series.borderWidth -= 0.5; | |
54 | } |
|
54 | } | |
55 | Button { |
|
55 | Button { | |
56 | text: "markerSize +" |
|
56 | text: "markerSize +" | |
57 | onClicked: series.markerSize += 1.0; |
|
57 | onClicked: series.markerSize += 1.0; | |
58 | } |
|
58 | } | |
59 | Button { |
|
59 | Button { | |
60 | text: "markerSize -" |
|
60 | text: "markerSize -" | |
61 | onClicked: series.markerSize -= 1.0; |
|
61 | onClicked: series.markerSize -= 1.0; | |
62 | } |
|
62 | } | |
63 | Button { |
|
63 | Button { | |
64 | text: "markerShape" |
|
64 | text: "markerShape" | |
65 | onClicked: series.markerShape = ((series.markerShape + 1) % 2); |
|
65 | onClicked: series.markerShape = ((series.markerShape + 1) % 2); | |
66 | } |
|
66 | } | |
67 | Button { |
|
67 | Button { | |
68 | text: "point labels visible" |
|
68 | text: "point labels visible" | |
69 | onClicked: series.pointLabelsVisible = !series.pointLabelsVisible; |
|
69 | onClicked: series.pointLabelsVisible = !series.pointLabelsVisible; | |
70 | } |
|
70 | } | |
71 | Button { |
|
71 | Button { | |
|
72 | text: "point labels clipping" | |||
|
73 | onClicked: series.pointLabelsClipping = !series.pointLabelsClipping; | |||
|
74 | } | |||
|
75 | Button { | |||
72 | text: "point labels format" |
|
76 | text: "point labels format" | |
73 | onClicked: { |
|
77 | onClicked: { | |
74 | if (series.pointLabelsFormat === "@xPoint, @yPoint") |
|
78 | if (series.pointLabelsFormat === "@xPoint, @yPoint") | |
75 | series.pointLabelsFormat = "(@xPoint)" |
|
79 | series.pointLabelsFormat = "(@xPoint)" | |
76 | else |
|
80 | else | |
77 | series.pointLabelsFormat = "@xPoint, @yPoint" |
|
81 | series.pointLabelsFormat = "@xPoint, @yPoint" | |
78 | } |
|
82 | } | |
79 | } |
|
83 | } | |
80 | Button { |
|
84 | Button { | |
81 | text: "point labels font" |
|
85 | text: "point labels font" | |
82 | onClicked: { |
|
86 | onClicked: { | |
83 | if (series.pointLabelsFont.family === "Times") |
|
87 | if (series.pointLabelsFont.family === "Times") | |
84 | series.pointLabelsFont.family = "Courier"; |
|
88 | series.pointLabelsFont.family = "Courier"; | |
85 | else |
|
89 | else | |
86 | series.pointLabelsFont.family = "Times"; |
|
90 | series.pointLabelsFont.family = "Times"; | |
87 | } |
|
91 | } | |
88 | } |
|
92 | } | |
89 | Button { |
|
93 | Button { | |
90 | text: "point labels color" |
|
94 | text: "point labels color" | |
91 | onClicked: series.pointLabelsColor = main.nextColor(); |
|
95 | onClicked: series.pointLabelsColor = main.nextColor(); | |
92 | } |
|
96 | } | |
93 | Button { |
|
97 | Button { | |
|
98 | text: "point labels clipping" | |||
|
99 | onClicked: series.pointLabelsClipping = !series.pointLabelsClipping; | |||
|
100 | } | |||
|
101 | Button { | |||
94 | text: "append point" |
|
102 | text: "append point" | |
95 | onClicked: series.append(series.count - 1, series.count - 1); |
|
103 | onClicked: series.append(series.count - 1, series.count - 1); | |
96 | } |
|
104 | } | |
97 | Button { |
|
105 | Button { | |
98 | text: "replace point" |
|
106 | text: "replace point" | |
99 | onClicked: { |
|
107 | onClicked: { | |
100 | var xyPoint = series.at(series.count - 1); |
|
108 | var xyPoint = series.at(series.count - 1); | |
101 | series.replace(series.count - 1, xyPoint.x, xyPoint.y + 0.1); |
|
109 | series.replace(series.count - 1, xyPoint.x, xyPoint.y + 0.1); | |
102 | } |
|
110 | } | |
103 | } |
|
111 | } | |
104 | Button { |
|
112 | Button { | |
105 | text: "remove point" |
|
113 | text: "remove point" | |
106 | onClicked: series.remove(series.count - 1); |
|
114 | onClicked: series.remove(series.count - 1); | |
107 | } |
|
115 | } | |
108 | Button { |
|
116 | Button { | |
109 | text: "remove points" |
|
117 | text: "remove points" | |
110 | onClicked: { |
|
118 | onClicked: { | |
111 | var count = 3; |
|
119 | var count = 3; | |
112 | if (series.count < 3) |
|
120 | if (series.count < 3) | |
113 | count = series.count |
|
121 | count = series.count | |
114 | var index = series.count - count; |
|
122 | var index = series.count - count; | |
115 | series.removePoints(index, count); |
|
123 | series.removePoints(index, count); | |
116 | } |
|
124 | } | |
117 | } |
|
125 | } | |
118 | Button { |
|
126 | Button { | |
119 | text: "insert point" |
|
127 | text: "insert point" | |
120 | onClicked: series.insert(series.count - 2, series.count - 2, series.count - 2); |
|
128 | onClicked: series.insert(series.count - 2, series.count - 2, series.count - 2); | |
121 | } |
|
129 | } | |
122 | Button { |
|
130 | Button { | |
123 | text: "clear" |
|
131 | text: "clear" | |
124 | onClicked: series.clear(); |
|
132 | onClicked: series.clear(); | |
125 | } |
|
133 | } | |
126 | } |
|
134 | } |
@@ -1,81 +1,83 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2015 The Qt Company Ltd |
|
3 | ** Copyright (C) 2015 The Qt Company Ltd | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io |
|
5 | ** For any questions to The Qt Company, please use contact form at http://qt.io | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Charts module. |
|
7 | ** This file is part of the Qt Charts module. | |
8 | ** |
|
8 | ** | |
9 | ** Licensees holding valid commercial license for Qt may use this file in |
|
9 | ** Licensees holding valid commercial license for Qt may use this file in | |
10 | ** accordance with the Qt License Agreement provided with the Software |
|
10 | ** accordance with the Qt License Agreement provided with the Software | |
11 | ** or, alternatively, in accordance with the terms contained in a written |
|
11 | ** or, alternatively, in accordance with the terms contained in a written | |
12 | ** agreement between you and The Qt Company. |
|
12 | ** agreement between you and The Qt Company. | |
13 | ** |
|
13 | ** | |
14 | ** If you have questions regarding the use of this file, please use |
|
14 | ** If you have questions regarding the use of this file, please use | |
15 | ** contact form at http://qt.io |
|
15 | ** contact form at http://qt.io | |
16 | ** |
|
16 | ** | |
17 | ****************************************************************************/ |
|
17 | ****************************************************************************/ | |
18 |
|
18 | |||
19 | import QtQuick 2.0 |
|
19 | import QtQuick 2.0 | |
20 | import QtCharts 2.0 |
|
20 | import QtCharts 2.0 | |
21 |
|
21 | |||
22 | ChartView { |
|
22 | ChartView { | |
23 | title: "spline series" |
|
23 | title: "spline series" | |
24 | anchors.fill: parent |
|
24 | anchors.fill: parent | |
25 | property variant series: splineSeries |
|
25 | property variant series: splineSeries | |
26 | animationOptions: ChartView.SeriesAnimations |
|
26 | animationOptions: ChartView.SeriesAnimations | |
27 |
|
27 | |||
28 | SplineSeries { |
|
28 | SplineSeries { | |
29 | id: splineSeries |
|
29 | id: splineSeries | |
30 | name: "spline 1" |
|
30 | name: "spline 1" | |
31 | XYPoint { x: 0; y: 0 } |
|
31 | XYPoint { x: 0; y: 0 } | |
32 | XYPoint { x: 1.1; y: 2.1 } |
|
32 | XYPoint { x: 1.1; y: 2.1 } | |
33 | XYPoint { x: 1.9; y: 3.3 } |
|
33 | XYPoint { x: 1.9; y: 3.3 } | |
34 | XYPoint { x: 2.1; y: 2.1 } |
|
34 | XYPoint { x: 2.1; y: 2.1 } | |
35 | XYPoint { x: 2.9; y: 4.9 } |
|
35 | XYPoint { x: 2.9; y: 4.9 } | |
36 | XYPoint { x: 3.4; y: 3.0 } |
|
36 | XYPoint { x: 3.4; y: 3.0 } | |
37 | XYPoint { x: 4.1; y: 3.3 } |
|
37 | XYPoint { x: 4.1; y: 3.3 } | |
38 |
|
38 | |||
39 | pointLabelsFormat: "@xPoint, @yPoint"; |
|
39 | pointLabelsFormat: "@xPoint, @yPoint"; | |
40 |
|
40 | |||
41 | onNameChanged: console.log("splineSeries.onNameChanged: " + name); |
|
41 | onNameChanged: console.log("splineSeries.onNameChanged: " + name); | |
42 | onVisibleChanged: console.log("splineSeries.onVisibleChanged: " + visible); |
|
42 | onVisibleChanged: console.log("splineSeries.onVisibleChanged: " + visible); | |
43 | onOpacityChanged: console.log(name + ".onOpacityChanged: " + opacity); |
|
43 | onOpacityChanged: console.log(name + ".onOpacityChanged: " + opacity); | |
44 | onClicked: console.log(name + ".onClicked: " + point.x + ", " + point.y); |
|
44 | onClicked: console.log(name + ".onClicked: " + point.x + ", " + point.y); | |
45 | onHovered: console.log(name + ".onHovered: " + point.x + ", " + point.y); |
|
45 | onHovered: console.log(name + ".onHovered: " + point.x + ", " + point.y); | |
46 | onPointReplaced: console.log("splineSeries.onPointReplaced: " + index); |
|
46 | onPointReplaced: console.log("splineSeries.onPointReplaced: " + index); | |
47 | onPointRemoved: console.log("splineSeries.onPointRemoved: " + index); |
|
47 | onPointRemoved: console.log("splineSeries.onPointRemoved: " + index); | |
48 | onPointAdded: console.log("splineSeries.onPointAdded: " + series.at(index).x + ", " + series.at(index).y); |
|
48 | onPointAdded: console.log("splineSeries.onPointAdded: " + series.at(index).x + ", " + series.at(index).y); | |
49 | onColorChanged: console.log("splineSeries.onColorChanged: " + color); |
|
49 | onColorChanged: console.log("splineSeries.onColorChanged: " + color); | |
50 | onWidthChanged: console.log("splineSeries.onWidthChanged: " + width); |
|
50 | onWidthChanged: console.log("splineSeries.onWidthChanged: " + width); | |
51 | onStyleChanged: console.log("splineSeries.onStyleChanged: " + style); |
|
51 | onStyleChanged: console.log("splineSeries.onStyleChanged: " + style); | |
52 | onCapStyleChanged: console.log("splineSeries.onCapStyleChanged: " + capStyle); |
|
52 | onCapStyleChanged: console.log("splineSeries.onCapStyleChanged: " + capStyle); | |
53 | onCountChanged: console.log("splineSeries.onCountChanged: " + count); |
|
53 | onCountChanged: console.log("splineSeries.onCountChanged: " + count); | |
54 | onPointLabelsVisibilityChanged: console.log("splineSeries.onPointLabelsVisibilityChanged: " |
|
54 | onPointLabelsVisibilityChanged: console.log("splineSeries.onPointLabelsVisibilityChanged: " | |
55 | + visible); |
|
55 | + visible); | |
56 | onPointLabelsFormatChanged: console.log("splineSeries.onPointLabelsFormatChanged: " |
|
56 | onPointLabelsFormatChanged: console.log("splineSeries.onPointLabelsFormatChanged: " | |
57 | + format); |
|
57 | + format); | |
58 | onPointLabelsFontChanged: console.log("splineSeries.onPointLabelsFontChanged: " |
|
58 | onPointLabelsFontChanged: console.log("splineSeries.onPointLabelsFontChanged: " | |
59 | + font.family); |
|
59 | + font.family); | |
60 | onPointLabelsColorChanged: console.log("splineSeries.onPointLabelsColorChanged: " |
|
60 | onPointLabelsColorChanged: console.log("splineSeries.onPointLabelsColorChanged: " | |
61 | + color); |
|
61 | + color); | |
|
62 | onPointLabelsClippingChanged: console.log("splineSeries.onPointLabelsClippingChanged: " | |||
|
63 | + clipping); | |||
62 | onPressed: console.log(name + ".onPressed: " + point.x + ", " + point.y); |
|
64 | onPressed: console.log(name + ".onPressed: " + point.x + ", " + point.y); | |
63 | onReleased: console.log(name + ".onReleased: " + point.x + ", " + point.y); |
|
65 | onReleased: console.log(name + ".onReleased: " + point.x + ", " + point.y); | |
64 | onDoubleClicked: console.log(name + ".onDoubleClicked: " + point.x + ", " + point.y); |
|
66 | onDoubleClicked: console.log(name + ".onDoubleClicked: " + point.x + ", " + point.y); | |
65 | } |
|
67 | } | |
66 |
|
68 | |||
67 | SplineSeries { |
|
69 | SplineSeries { | |
68 | name: "spline 2" |
|
70 | name: "spline 2" | |
69 | XYPoint { x: 1.1; y: 1.1 } |
|
71 | XYPoint { x: 1.1; y: 1.1 } | |
70 | XYPoint { x: 1.9; y: 2.3 } |
|
72 | XYPoint { x: 1.9; y: 2.3 } | |
71 | XYPoint { x: 2.1; y: 1.1 } |
|
73 | XYPoint { x: 2.1; y: 1.1 } | |
72 | XYPoint { x: 2.9; y: 3.9 } |
|
74 | XYPoint { x: 2.9; y: 3.9 } | |
73 | XYPoint { x: 3.4; y: 2.0 } |
|
75 | XYPoint { x: 3.4; y: 2.0 } | |
74 | XYPoint { x: 4.1; y: 2.3 } |
|
76 | XYPoint { x: 4.1; y: 2.3 } | |
75 | onClicked: console.log(name + ".onClicked: " + point.x + ", " + point.y); |
|
77 | onClicked: console.log(name + ".onClicked: " + point.x + ", " + point.y); | |
76 | onHovered: console.log(name + ".onHovered: " + point.x + ", " + point.y); |
|
78 | onHovered: console.log(name + ".onHovered: " + point.x + ", " + point.y); | |
77 | onPressed: console.log(name + ".onPressed: " + point.x + ", " + point.y); |
|
79 | onPressed: console.log(name + ".onPressed: " + point.x + ", " + point.y); | |
78 | onReleased: console.log(name + ".onReleased: " + point.x + ", " + point.y); |
|
80 | onReleased: console.log(name + ".onReleased: " + point.x + ", " + point.y); | |
79 | onDoubleClicked: console.log(name + ".onDoubleClicked: " + point.x + ", " + point.y); |
|
81 | onDoubleClicked: console.log(name + ".onDoubleClicked: " + point.x + ", " + point.y); | |
80 | } |
|
82 | } | |
81 | } |
|
83 | } |
General Comments 0
You need to be logged in to leave comments.
Login now