@@ -95,8 +95,9 void AreaChartItem::handleGeometryChanged(const QRectF& rect) | |||
|
95 | 95 | |
|
96 | 96 | void AreaChartItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) |
|
97 | 97 | { |
|
98 |
Q_UNUSED(widget) |
|
|
99 |
Q_UNUSED(option) |
|
|
98 | Q_UNUSED(widget) | |
|
99 | Q_UNUSED(option) | |
|
100 | ||
|
100 | 101 | painter->save(); |
|
101 | 102 | painter->setPen(m_linePen); |
|
102 | 103 | painter->setBrush(m_brush); |
@@ -395,9 +395,9 void AxisItem::handleGeometryChanged(const QRectF& rect) | |||
|
395 | 395 | |
|
396 | 396 | void AxisItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) |
|
397 | 397 | { |
|
398 |
Q_UNUSED(painter) |
|
|
399 |
Q_UNUSED(option) |
|
|
400 |
Q_UNUSED(widget) |
|
|
398 | Q_UNUSED(painter) | |
|
399 | Q_UNUSED(option) | |
|
400 | Q_UNUSED(widget) | |
|
401 | 401 | } |
|
402 | 402 | |
|
403 | 403 | //TODO "nice numbers algorithm" |
@@ -48,6 +48,9 void Bar::setBrush(QBrush brush) | |||
|
48 | 48 | |
|
49 | 49 | void Bar::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) |
|
50 | 50 | { |
|
51 | Q_UNUSED(option) | |
|
52 | Q_UNUSED(widget) | |
|
53 | ||
|
51 | 54 | if (0 == mHeight) { |
|
52 | 55 | return; |
|
53 | 56 | } |
@@ -129,13 +129,18 void BarPresenterBase::initAxisLabels() | |||
|
129 | 129 | |
|
130 | 130 | void BarPresenterBase::handleModelChanged(int index) |
|
131 | 131 | { |
|
132 | // qDebug() << "BarPresenterBase::handleModelChanged" << index; | |
|
132 | Q_UNUSED(index) | |
|
133 | 133 | dataChanged(); |
|
134 | 134 | } |
|
135 | 135 | |
|
136 |
void BarPresenterBase::handleDomainChanged( |
|
|
136 | void BarPresenterBase::handleDomainChanged(qreal minX, qreal maxX, qreal minY, qreal maxY) | |
|
137 | 137 | { |
|
138 | qDebug() << "BarPresenterBase::handleDomainChanged"; | |
|
138 | // TODO: | |
|
139 | Q_UNUSED(minX) | |
|
140 | Q_UNUSED(maxX) | |
|
141 | Q_UNUSED(minY) | |
|
142 | Q_UNUSED(maxY) | |
|
143 | ||
|
139 | 144 | /* |
|
140 | 145 | int count = mSeries->categoryCount(); |
|
141 | 146 | if (0 == count) { |
@@ -38,7 +38,7 protected: | |||
|
38 | 38 | |
|
39 | 39 | public slots: |
|
40 | 40 | void handleModelChanged(int index); |
|
41 |
void handleDomainChanged( |
|
|
41 | void handleDomainChanged(qreal minX, qreal maxX, qreal minY, qreal maxY); | |
|
42 | 42 | void handleGeometryChanged(const QRectF& size); |
|
43 | 43 | |
|
44 | 44 | // Internal slots |
@@ -49,6 +49,9 void BarValue::setPos(qreal x, qreal y) | |||
|
49 | 49 | |
|
50 | 50 | void BarValue::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) |
|
51 | 51 | { |
|
52 | Q_UNUSED(option) | |
|
53 | Q_UNUSED(widget) | |
|
54 | ||
|
52 | 55 | if (isVisible()) { |
|
53 | 56 | painter->setPen(mPen); |
|
54 | 57 | painter->drawText(boundingRect(),mValueString); |
@@ -227,14 +227,14 bool QBarSeries::setModel(QAbstractItemModel* model) | |||
|
227 | 227 | return true; |
|
228 | 228 | } |
|
229 | 229 | |
|
230 | void QBarSeries::setModelMappingCategories(int modelColumn) | |
|
230 | // TODO | |
|
231 | void QBarSeries::setModelMappingCategories(int /*modelColumn*/) | |
|
231 | 232 | { |
|
232 | // | |
|
233 | 233 | } |
|
234 | 234 | |
|
235 | void QBarSeries::setModelMappingBarRange(int bottomBoundry, int topBoundry) | |
|
235 | // TODO | |
|
236 | void QBarSeries::setModelMappingBarRange(int /*bottomBoundry*/, int /*topBoundry*/) | |
|
236 | 237 | { |
|
237 | // | |
|
238 | 238 | } |
|
239 | 239 | |
|
240 | 240 | #include "moc_qbarseries.cpp" |
@@ -28,6 +28,9 void Separator::setSize(const QSizeF &size) | |||
|
28 | 28 | |
|
29 | 29 | void Separator::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) |
|
30 | 30 | { |
|
31 | Q_UNUSED(option) | |
|
32 | Q_UNUSED(widget) | |
|
33 | ||
|
31 | 34 | if (isVisible()) { |
|
32 | 35 | QPen pen(mColor); |
|
33 | 36 | painter->setPen(pen); |
@@ -174,7 +174,7 void ChartPresenter::handleSeriesAdded(QSeries* series,Domain* domain) | |||
|
174 | 174 | if(m_options.testFlag(QChart::SeriesAnimations)) { |
|
175 | 175 | // m_animator->addAnimation(bar); |
|
176 | 176 | } |
|
177 |
m_chartTheme->decorate( |
|
|
177 | m_chartTheme->decorate(barSeries, m_dataset->seriesIndex(barSeries)); | |
|
178 | 178 | QObject::connect(this,SIGNAL(geometryChanged(const QRectF&)),bar,SLOT(handleGeometryChanged(const QRectF&))); |
|
179 | 179 | QObject::connect(domain,SIGNAL(domainChanged(qreal,qreal,qreal,qreal)),bar,SLOT(handleDomainChanged(qreal,qreal,qreal,qreal))); |
|
180 | 180 | item=bar; |
@@ -187,7 +187,7 void ChartPresenter::handleSeriesAdded(QSeries* series,Domain* domain) | |||
|
187 | 187 | if(m_options.testFlag(QChart::SeriesAnimations)) { |
|
188 | 188 | // m_animator->addAnimation(bar); |
|
189 | 189 | } |
|
190 |
m_chartTheme->decorate( |
|
|
190 | m_chartTheme->decorate(stackedBarSeries, m_dataset->seriesIndex(stackedBarSeries)); | |
|
191 | 191 | QObject::connect(this,SIGNAL(geometryChanged(const QRectF&)),bar,SLOT(handleGeometryChanged(const QRectF&))); |
|
192 | 192 | QObject::connect(domain,SIGNAL(domainChanged(qreal,qreal,qreal,qreal)),bar,SLOT(handleDomainChanged(qreal,qreal,qreal,qreal))); |
|
193 | 193 | item=bar; |
@@ -200,7 +200,7 void ChartPresenter::handleSeriesAdded(QSeries* series,Domain* domain) | |||
|
200 | 200 | if(m_options.testFlag(QChart::SeriesAnimations)) { |
|
201 | 201 | // m_animator->addAnimation(bar); |
|
202 | 202 | } |
|
203 |
m_chartTheme->decorate( |
|
|
203 | m_chartTheme->decorate(percentBarSeries, m_dataset->seriesIndex(percentBarSeries)); | |
|
204 | 204 | QObject::connect(this,SIGNAL(geometryChanged(const QRectF&)),bar,SLOT(handleGeometryChanged(const QRectF&))); |
|
205 | 205 | QObject::connect(domain,SIGNAL(domainChanged(qreal,qreal,qreal,qreal)),bar,SLOT(handleDomainChanged(qreal,qreal,qreal,qreal))); |
|
206 | 206 | item=bar; |
@@ -226,7 +226,7 void ChartPresenter::handleSeriesAdded(QSeries* series,Domain* domain) | |||
|
226 | 226 | if(m_options.testFlag(QChart::SeriesAnimations)) { |
|
227 | 227 | // m_animator->addAnimation(pie); |
|
228 | 228 | } |
|
229 |
m_chartTheme->decorate( |
|
|
229 | m_chartTheme->decorate(pieSeries, m_dataset->seriesIndex(series)); | |
|
230 | 230 | QObject::connect(this,SIGNAL(geometryChanged(const QRectF&)),pie,SLOT(handleGeometryChanged(const QRectF&))); |
|
231 | 231 | QObject::connect(domain,SIGNAL(domainChanged(qreal,qreal,qreal,qreal)),pie,SLOT(handleDomainChanged(qreal,qreal,qreal,qreal))); |
|
232 | 232 | // Hide all from background when there is only piechart |
@@ -110,7 +110,7 void ChartTheme::decorate(QLineSeries* series,int index) | |||
|
110 | 110 | } |
|
111 | 111 | } |
|
112 | 112 | |
|
113 |
void ChartTheme::decorate( |
|
|
113 | void ChartTheme::decorate(QBarSeries* series,int index) | |
|
114 | 114 | { |
|
115 | 115 | QList<QBarSet*> sets = series->barSets(); |
|
116 | 116 | for (int i=0; i<sets.count(); i++) { |
@@ -132,7 +132,7 void ChartTheme::decorate(BarPresenter* item, QBarSeries* series,int index) | |||
|
132 | 132 | } |
|
133 | 133 | } |
|
134 | 134 | |
|
135 |
void ChartTheme::decorate( |
|
|
135 | void ChartTheme::decorate(QStackedBarSeries* series,int index) | |
|
136 | 136 | { |
|
137 | 137 | QList<QBarSet*> sets = series->barSets(); |
|
138 | 138 | for (int i=0; i<sets.count(); i++) { |
@@ -151,7 +151,7 void ChartTheme::decorate(StackedBarPresenter* item, QStackedBarSeries* series,i | |||
|
151 | 151 | } |
|
152 | 152 | } |
|
153 | 153 | |
|
154 |
void ChartTheme::decorate( |
|
|
154 | void ChartTheme::decorate(QPercentBarSeries* series,int index) | |
|
155 | 155 | { |
|
156 | 156 | QList<QBarSet*> sets = series->barSets(); |
|
157 | 157 | for (int i=0; i<sets.count(); i++) { |
@@ -188,7 +188,7 void ChartTheme::decorate(QScatterSeries* series, int index) | |||
|
188 | 188 | } |
|
189 | 189 | } |
|
190 | 190 | |
|
191 |
void ChartTheme::decorate( |
|
|
191 | void ChartTheme::decorate(QPieSeries* series, int index) | |
|
192 | 192 | { |
|
193 | 193 | // Get color for a slice from a gradient linearly, beginning from the start of the gradient |
|
194 | 194 | for (int i(0); i < series->slices().count(); i++) { |
@@ -45,13 +45,13 public: | |||
|
45 | 45 | void decorate(QChart* chart); |
|
46 | 46 | void decorate(QLegend* legend); |
|
47 | 47 | //void decorate(ChartItem* item, QSeries* series,int index); |
|
48 |
void decorate( |
|
|
49 |
void decorate( |
|
|
50 |
void decorate( |
|
|
48 | void decorate(QBarSeries* series, int index); | |
|
49 | void decorate(QStackedBarSeries* series, int index); | |
|
50 | void decorate(QPercentBarSeries* series, int index); | |
|
51 | 51 | void decorate(QLineSeries* series, int index); |
|
52 | 52 | void decorate(QAreaSeries* series, int index); |
|
53 | 53 | void decorate(QScatterSeries* series, int index); |
|
54 |
void decorate( |
|
|
54 | void decorate(QPieSeries* series, int index); | |
|
55 | 55 | void decorate(QSplineSeries* series, int index); |
|
56 | 56 | void decorate(QChartAxis* axis, bool axisX); |
|
57 | 57 |
@@ -87,6 +87,9 QSeries* LegendMarker::series() const | |||
|
87 | 87 | |
|
88 | 88 | void LegendMarker::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) |
|
89 | 89 | { |
|
90 | Q_UNUSED(option) | |
|
91 | Q_UNUSED(widget) | |
|
92 | ||
|
90 | 93 | painter->setBrush(mBrush); |
|
91 | 94 | painter->drawRect(mMarkerBoundingRect); |
|
92 | 95 | } |
@@ -63,8 +63,9 void LineChartItem::handleUpdated() | |||
|
63 | 63 | |
|
64 | 64 | void LineChartItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) |
|
65 | 65 | { |
|
66 |
Q_UNUSED(widget) |
|
|
67 |
Q_UNUSED(option) |
|
|
66 | Q_UNUSED(widget) | |
|
67 | Q_UNUSED(option) | |
|
68 | ||
|
68 | 69 | painter->save(); |
|
69 | 70 | painter->setPen(m_linePen); |
|
70 | 71 | painter->setClipRect(clipRect()); |
@@ -27,6 +27,7 PieChartItem::~PieChartItem() | |||
|
27 | 27 | |
|
28 | 28 | void PieChartItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) |
|
29 | 29 | { |
|
30 | Q_UNUSED(painter) | |
|
30 | 31 | // TODO: paint shadows for all components |
|
31 | 32 | // - get paths from items & merge & offset and draw with shadow color? |
|
32 | 33 | //painter->setBrush(QBrush(Qt::red)); |
@@ -590,6 +590,8 void QPieSeries::setModelMapping(int modelValuesLine, int modelLabelsLine, Qt::O | |||
|
590 | 590 | |
|
591 | 591 | void QPieSeries::modelUpdated(QModelIndex topLeft, QModelIndex bottomRight) |
|
592 | 592 | { |
|
593 | Q_UNUSED(bottomRight) | |
|
594 | ||
|
593 | 595 | if (m_mapOrientation == Qt::Vertical) |
|
594 | 596 | { |
|
595 | 597 | // slices().at(topLeft.row())->setValue(m_model->data(m_model->index(topLeft.row(), topLeft.column()), Qt::DisplayRole).toDouble()); |
@@ -610,6 +612,9 void QPieSeries::modelUpdated(QModelIndex topLeft, QModelIndex bottomRight) | |||
|
610 | 612 | |
|
611 | 613 | void QPieSeries::modelDataAdded(QModelIndex parent, int start, int end) |
|
612 | 614 | { |
|
615 | Q_UNUSED(parent) | |
|
616 | Q_UNUSED(end) | |
|
617 | ||
|
613 | 618 | QPieSlice* newSlice = new QPieSlice; |
|
614 | 619 | newSlice->setLabelVisible(true); |
|
615 | 620 | if (m_mapOrientation == Qt::Vertical) |
@@ -628,6 +633,8 void QPieSeries::modelDataAdded(QModelIndex parent, int start, int end) | |||
|
628 | 633 | |
|
629 | 634 | void QPieSeries::modelDataRemoved(QModelIndex parent, int start, int end) |
|
630 | 635 | { |
|
636 | Q_UNUSED(parent) | |
|
637 | Q_UNUSED(end) | |
|
631 | 638 | remove(slices().at(start)); |
|
632 | 639 | } |
|
633 | 640 |
@@ -31,6 +31,9 QLegend::QLegend(QGraphicsItem *parent) | |||
|
31 | 31 | |
|
32 | 32 | void QLegend::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) |
|
33 | 33 | { |
|
34 | Q_UNUSED(option) | |
|
35 | Q_UNUSED(widget) | |
|
36 | ||
|
34 | 37 | painter->setBrush(mBackgroundBrush); |
|
35 | 38 | painter->drawRect(mBoundingRect); |
|
36 | 39 | } |
@@ -62,6 +65,8 void QLegend::setMinimumSize(const QSizeF size) | |||
|
62 | 65 | |
|
63 | 66 | void QLegend::handleSeriesAdded(QSeries* series,Domain* domain) |
|
64 | 67 | { |
|
68 | Q_UNUSED(domain) | |
|
69 | ||
|
65 | 70 | mSeriesList.append(series); |
|
66 | 71 | createMarkers(series); |
|
67 | 72 | layoutChanged(); |
@@ -132,9 +132,9 void ScatterChartItem::setLayout(QVector<QPointF>& points) | |||
|
132 | 132 | |
|
133 | 133 | void ScatterChartItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) |
|
134 | 134 | { |
|
135 |
Q_UNUSED(painter) |
|
|
136 |
Q_UNUSED(option) |
|
|
137 |
Q_UNUSED(widget) |
|
|
135 | Q_UNUSED(painter) | |
|
136 | Q_UNUSED(option) | |
|
137 | Q_UNUSED(widget) | |
|
138 | 138 | } |
|
139 | 139 | |
|
140 | 140 | void ScatterChartItem::setPen(const QPen& pen) |
@@ -175,10 +175,6 void ScatterChartItem::handleUpdated() | |||
|
175 | 175 | |
|
176 | 176 | } |
|
177 | 177 | |
|
178 | void ScatterChartItem::mousePressEvent( QGraphicsSceneMouseEvent * event ) | |
|
179 | { | |
|
180 | } | |
|
181 | ||
|
182 | 178 | #include "moc_scatterchartitem_p.cpp" |
|
183 | 179 | |
|
184 | 180 | QTCOMMERCIALCHART_END_NAMESPACE |
@@ -106,6 +106,7 protected: | |||
|
106 | 106 | |
|
107 | 107 |
void mousePressEvent( |
|
108 | 108 | { |
|
109 | Q_UNUSED(event) | |
|
109 | 110 | m_parent->markerSelected(this); |
|
110 | 111 | } |
|
111 | 112 |
@@ -69,8 +69,9 void SplineChartItem::handleUpdated() | |||
|
69 | 69 | |
|
70 | 70 | void SplineChartItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) |
|
71 | 71 | { |
|
72 |
Q_UNUSED(widget) |
|
|
73 |
Q_UNUSED(option) |
|
|
72 | Q_UNUSED(widget) | |
|
73 | Q_UNUSED(option) | |
|
74 | ||
|
74 | 75 | painter->save(); |
|
75 | 76 | painter->setClipRect(clipRect()); |
|
76 | 77 | painter->setPen(m_linePen); |
@@ -268,6 +268,8 QXYSeries& QXYSeries::operator<< (const QList<QPointF> points) | |||
|
268 | 268 | |
|
269 | 269 | void QXYSeries::modelUpdated(QModelIndex topLeft, QModelIndex bottomRight) |
|
270 | 270 | { |
|
271 | Q_UNUSED(bottomRight) | |
|
272 | ||
|
271 | 273 | if (m_mapOrientation == Qt::Vertical) |
|
272 | 274 | emit pointReplaced(topLeft.row()); |
|
273 | 275 | else |
@@ -276,11 +278,15 void QXYSeries::modelUpdated(QModelIndex topLeft, QModelIndex bottomRight) | |||
|
276 | 278 | |
|
277 | 279 | void QXYSeries::modelDataAdded(QModelIndex parent, int start, int end) |
|
278 | 280 | { |
|
281 | Q_UNUSED(parent) | |
|
282 | Q_UNUSED(end) | |
|
279 | 283 | emit pointAdded(start); |
|
280 | 284 | } |
|
281 | 285 | |
|
282 | 286 | void QXYSeries::modelDataRemoved(QModelIndex parent, int start, int end) |
|
283 | 287 | { |
|
288 | Q_UNUSED(parent) | |
|
289 | Q_UNUSED(end) | |
|
284 | 290 | emit pointRemoved(start); |
|
285 | 291 | } |
|
286 | 292 |
General Comments 0
You need to be logged in to leave comments.
Login now