From e622b3a8d8a0e502ded6c05941ec48829a3a300a 2012-03-15 12:16:38 From: Tero Ahola Date: 2012-03-15 12:16:38 Subject: [PATCH] Squashed bunch of warnings --- diff --git a/src/areachart/areachartitem.cpp b/src/areachart/areachartitem.cpp index 0e6352b..6a3204f 100644 --- a/src/areachart/areachartitem.cpp +++ b/src/areachart/areachartitem.cpp @@ -95,8 +95,9 @@ void AreaChartItem::handleGeometryChanged(const QRectF& rect) void AreaChartItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { - Q_UNUSED(widget); - Q_UNUSED(option); + Q_UNUSED(widget) + Q_UNUSED(option) + painter->save(); painter->setPen(m_linePen); painter->setBrush(m_brush); diff --git a/src/axis/axisitem.cpp b/src/axis/axisitem.cpp index 301225d..1f8ef16 100644 --- a/src/axis/axisitem.cpp +++ b/src/axis/axisitem.cpp @@ -395,9 +395,9 @@ void AxisItem::handleGeometryChanged(const QRectF& rect) void AxisItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { - Q_UNUSED(painter); - Q_UNUSED(option); - Q_UNUSED(widget); + Q_UNUSED(painter) + Q_UNUSED(option) + Q_UNUSED(widget) } //TODO "nice numbers algorithm" diff --git a/src/barchart/bar.cpp b/src/barchart/bar.cpp index a88cc84..02d1590 100644 --- a/src/barchart/bar.cpp +++ b/src/barchart/bar.cpp @@ -48,6 +48,9 @@ void Bar::setBrush(QBrush brush) void Bar::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { + Q_UNUSED(option) + Q_UNUSED(widget) + if (0 == mHeight) { return; } diff --git a/src/barchart/barpresenterbase.cpp b/src/barchart/barpresenterbase.cpp index 8daf8b4..007e8db 100644 --- a/src/barchart/barpresenterbase.cpp +++ b/src/barchart/barpresenterbase.cpp @@ -129,13 +129,18 @@ void BarPresenterBase::initAxisLabels() void BarPresenterBase::handleModelChanged(int index) { -// qDebug() << "BarPresenterBase::handleModelChanged" << index; + Q_UNUSED(index) dataChanged(); } -void BarPresenterBase::handleDomainChanged(const Domain& domain) +void BarPresenterBase::handleDomainChanged(qreal minX, qreal maxX, qreal minY, qreal maxY) { - qDebug() << "BarPresenterBase::handleDomainChanged"; + // TODO: + Q_UNUSED(minX) + Q_UNUSED(maxX) + Q_UNUSED(minY) + Q_UNUSED(maxY) + /* int count = mSeries->categoryCount(); if (0 == count) { diff --git a/src/barchart/barpresenterbase_p.h b/src/barchart/barpresenterbase_p.h index 8a71b08..5cb1c82 100644 --- a/src/barchart/barpresenterbase_p.h +++ b/src/barchart/barpresenterbase_p.h @@ -38,7 +38,7 @@ protected: public slots: void handleModelChanged(int index); - void handleDomainChanged(const Domain& domain); + void handleDomainChanged(qreal minX, qreal maxX, qreal minY, qreal maxY); void handleGeometryChanged(const QRectF& size); // Internal slots diff --git a/src/barchart/barvalue.cpp b/src/barchart/barvalue.cpp index 9cebf3e..198400a 100644 --- a/src/barchart/barvalue.cpp +++ b/src/barchart/barvalue.cpp @@ -49,6 +49,9 @@ void BarValue::setPos(qreal x, qreal y) void BarValue::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { + Q_UNUSED(option) + Q_UNUSED(widget) + if (isVisible()) { painter->setPen(mPen); painter->drawText(boundingRect(),mValueString); diff --git a/src/barchart/qbarseries.cpp b/src/barchart/qbarseries.cpp index 7fba083..a624401 100644 --- a/src/barchart/qbarseries.cpp +++ b/src/barchart/qbarseries.cpp @@ -227,14 +227,14 @@ bool QBarSeries::setModel(QAbstractItemModel* model) return true; } -void QBarSeries::setModelMappingCategories(int modelColumn) +// TODO +void QBarSeries::setModelMappingCategories(int /*modelColumn*/) { - // } -void QBarSeries::setModelMappingBarRange(int bottomBoundry, int topBoundry) +// TODO +void QBarSeries::setModelMappingBarRange(int /*bottomBoundry*/, int /*topBoundry*/) { - // } #include "moc_qbarseries.cpp" diff --git a/src/barchart/separator.cpp b/src/barchart/separator.cpp index 4fe4155..b260848 100644 --- a/src/barchart/separator.cpp +++ b/src/barchart/separator.cpp @@ -28,6 +28,9 @@ void Separator::setSize(const QSizeF &size) void Separator::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { + Q_UNUSED(option) + Q_UNUSED(widget) + if (isVisible()) { QPen pen(mColor); painter->setPen(pen); diff --git a/src/chartpresenter.cpp b/src/chartpresenter.cpp index d58ed7a..5f416bd 100644 --- a/src/chartpresenter.cpp +++ b/src/chartpresenter.cpp @@ -174,7 +174,7 @@ void ChartPresenter::handleSeriesAdded(QSeries* series,Domain* domain) if(m_options.testFlag(QChart::SeriesAnimations)) { // m_animator->addAnimation(bar); } - m_chartTheme->decorate(bar, barSeries, m_dataset->seriesIndex(barSeries)); + m_chartTheme->decorate(barSeries, m_dataset->seriesIndex(barSeries)); QObject::connect(this,SIGNAL(geometryChanged(const QRectF&)),bar,SLOT(handleGeometryChanged(const QRectF&))); QObject::connect(domain,SIGNAL(domainChanged(qreal,qreal,qreal,qreal)),bar,SLOT(handleDomainChanged(qreal,qreal,qreal,qreal))); item=bar; @@ -187,7 +187,7 @@ void ChartPresenter::handleSeriesAdded(QSeries* series,Domain* domain) if(m_options.testFlag(QChart::SeriesAnimations)) { // m_animator->addAnimation(bar); } - m_chartTheme->decorate(bar, stackedBarSeries, m_dataset->seriesIndex(stackedBarSeries)); + m_chartTheme->decorate(stackedBarSeries, m_dataset->seriesIndex(stackedBarSeries)); QObject::connect(this,SIGNAL(geometryChanged(const QRectF&)),bar,SLOT(handleGeometryChanged(const QRectF&))); QObject::connect(domain,SIGNAL(domainChanged(qreal,qreal,qreal,qreal)),bar,SLOT(handleDomainChanged(qreal,qreal,qreal,qreal))); item=bar; @@ -200,7 +200,7 @@ void ChartPresenter::handleSeriesAdded(QSeries* series,Domain* domain) if(m_options.testFlag(QChart::SeriesAnimations)) { // m_animator->addAnimation(bar); } - m_chartTheme->decorate(bar, percentBarSeries, m_dataset->seriesIndex(percentBarSeries)); + m_chartTheme->decorate(percentBarSeries, m_dataset->seriesIndex(percentBarSeries)); QObject::connect(this,SIGNAL(geometryChanged(const QRectF&)),bar,SLOT(handleGeometryChanged(const QRectF&))); QObject::connect(domain,SIGNAL(domainChanged(qreal,qreal,qreal,qreal)),bar,SLOT(handleDomainChanged(qreal,qreal,qreal,qreal))); item=bar; @@ -226,7 +226,7 @@ void ChartPresenter::handleSeriesAdded(QSeries* series,Domain* domain) if(m_options.testFlag(QChart::SeriesAnimations)) { // m_animator->addAnimation(pie); } - m_chartTheme->decorate(pie, pieSeries, m_dataset->seriesIndex(series)); + m_chartTheme->decorate(pieSeries, m_dataset->seriesIndex(series)); QObject::connect(this,SIGNAL(geometryChanged(const QRectF&)),pie,SLOT(handleGeometryChanged(const QRectF&))); QObject::connect(domain,SIGNAL(domainChanged(qreal,qreal,qreal,qreal)),pie,SLOT(handleDomainChanged(qreal,qreal,qreal,qreal))); // Hide all from background when there is only piechart diff --git a/src/charttheme.cpp b/src/charttheme.cpp index 606dd1a..7444b33 100644 --- a/src/charttheme.cpp +++ b/src/charttheme.cpp @@ -110,7 +110,7 @@ void ChartTheme::decorate(QLineSeries* series,int index) } } -void ChartTheme::decorate(BarPresenter* item, QBarSeries* series,int index) +void ChartTheme::decorate(QBarSeries* series,int index) { QList sets = series->barSets(); for (int i=0; i sets = series->barSets(); for (int i=0; i sets = series->barSets(); for (int i=0; islices().count(); i++) { diff --git a/src/charttheme_p.h b/src/charttheme_p.h index 398b052..3e416ce 100644 --- a/src/charttheme_p.h +++ b/src/charttheme_p.h @@ -45,13 +45,13 @@ public: void decorate(QChart* chart); void decorate(QLegend* legend); //void decorate(ChartItem* item, QSeries* series,int index); - void decorate(BarPresenter* item, QBarSeries* series, int index); - void decorate(StackedBarPresenter* item, QStackedBarSeries* series, int index); - void decorate(PercentBarPresenter* item, QPercentBarSeries* series, int index); + void decorate(QBarSeries* series, int index); + void decorate(QStackedBarSeries* series, int index); + void decorate(QPercentBarSeries* series, int index); void decorate(QLineSeries* series, int index); void decorate(QAreaSeries* series, int index); void decorate(QScatterSeries* series, int index); - void decorate(PieChartItem* item, QPieSeries* series, int index); + void decorate(QPieSeries* series, int index); void decorate(QSplineSeries* series, int index); void decorate(QChartAxis* axis, bool axisX); diff --git a/src/legendmarker.cpp b/src/legendmarker.cpp index 55cb977..27ec6c3 100644 --- a/src/legendmarker.cpp +++ b/src/legendmarker.cpp @@ -87,6 +87,9 @@ QSeries* LegendMarker::series() const void LegendMarker::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { + Q_UNUSED(option) + Q_UNUSED(widget) + painter->setBrush(mBrush); painter->drawRect(mMarkerBoundingRect); } diff --git a/src/linechart/linechartitem.cpp b/src/linechart/linechartitem.cpp index c90a7cd..20487dd 100644 --- a/src/linechart/linechartitem.cpp +++ b/src/linechart/linechartitem.cpp @@ -63,8 +63,9 @@ void LineChartItem::handleUpdated() void LineChartItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { - Q_UNUSED(widget); - Q_UNUSED(option); + Q_UNUSED(widget) + Q_UNUSED(option) + painter->save(); painter->setPen(m_linePen); painter->setClipRect(clipRect()); diff --git a/src/piechart/piechartitem.cpp b/src/piechart/piechartitem.cpp index 1a51cc6..bf4e4cd 100644 --- a/src/piechart/piechartitem.cpp +++ b/src/piechart/piechartitem.cpp @@ -27,6 +27,7 @@ PieChartItem::~PieChartItem() void PieChartItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) { + Q_UNUSED(painter) // TODO: paint shadows for all components // - get paths from items & merge & offset and draw with shadow color? //painter->setBrush(QBrush(Qt::red)); diff --git a/src/piechart/qpieseries.cpp b/src/piechart/qpieseries.cpp index 743ff7f..4b22081 100644 --- a/src/piechart/qpieseries.cpp +++ b/src/piechart/qpieseries.cpp @@ -590,6 +590,8 @@ void QPieSeries::setModelMapping(int modelValuesLine, int modelLabelsLine, Qt::O void QPieSeries::modelUpdated(QModelIndex topLeft, QModelIndex bottomRight) { + Q_UNUSED(bottomRight) + if (m_mapOrientation == Qt::Vertical) { // 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) void QPieSeries::modelDataAdded(QModelIndex parent, int start, int end) { + Q_UNUSED(parent) + Q_UNUSED(end) + QPieSlice* newSlice = new QPieSlice; newSlice->setLabelVisible(true); if (m_mapOrientation == Qt::Vertical) @@ -628,6 +633,8 @@ void QPieSeries::modelDataAdded(QModelIndex parent, int start, int end) void QPieSeries::modelDataRemoved(QModelIndex parent, int start, int end) { + Q_UNUSED(parent) + Q_UNUSED(end) remove(slices().at(start)); } diff --git a/src/qlegend.cpp b/src/qlegend.cpp index c332539..bc92451 100644 --- a/src/qlegend.cpp +++ b/src/qlegend.cpp @@ -31,6 +31,9 @@ QLegend::QLegend(QGraphicsItem *parent) void QLegend::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { + Q_UNUSED(option) + Q_UNUSED(widget) + painter->setBrush(mBackgroundBrush); painter->drawRect(mBoundingRect); } @@ -60,8 +63,10 @@ void QLegend::setMinimumSize(const QSizeF size) mMinimumSize = size; } -void QLegend::handleSeriesAdded(QSeries* series,Domain* domain) +void QLegend::handleSeriesAdded(QSeries* series, Domain* domain) { + Q_UNUSED(domain) + mSeriesList.append(series); createMarkers(series); layoutChanged(); diff --git a/src/scatterseries/scatterchartitem.cpp b/src/scatterseries/scatterchartitem.cpp index 6f27053..7977336 100644 --- a/src/scatterseries/scatterchartitem.cpp +++ b/src/scatterseries/scatterchartitem.cpp @@ -132,9 +132,9 @@ void ScatterChartItem::setLayout(QVector& points) void ScatterChartItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { - Q_UNUSED(painter); - Q_UNUSED(option); - Q_UNUSED(widget); + Q_UNUSED(painter) + Q_UNUSED(option) + Q_UNUSED(widget) } void ScatterChartItem::setPen(const QPen& pen) @@ -175,10 +175,6 @@ void ScatterChartItem::handleUpdated() } -void ScatterChartItem::mousePressEvent( QGraphicsSceneMouseEvent * event ) -{ -} - #include "moc_scatterchartitem_p.cpp" QTCOMMERCIALCHART_END_NAMESPACE diff --git a/src/scatterseries/scatterchartitem_p.h b/src/scatterseries/scatterchartitem_p.h index 8257be2..0d0dbf8 100644 --- a/src/scatterseries/scatterchartitem_p.h +++ b/src/scatterseries/scatterchartitem_p.h @@ -104,8 +104,9 @@ public: protected: - void mousePressEvent( QGraphicsSceneMouseEvent * event ) + void mousePressEvent(QGraphicsSceneMouseEvent *event) { + Q_UNUSED(event) m_parent->markerSelected(this); } diff --git a/src/splinechart/splinechartitem.cpp b/src/splinechart/splinechartitem.cpp index 33fb59c..e584296 100644 --- a/src/splinechart/splinechartitem.cpp +++ b/src/splinechart/splinechartitem.cpp @@ -69,8 +69,9 @@ void SplineChartItem::handleUpdated() void SplineChartItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { - Q_UNUSED(widget); - Q_UNUSED(option); + Q_UNUSED(widget) + Q_UNUSED(option) + painter->save(); painter->setClipRect(clipRect()); painter->setPen(m_linePen); diff --git a/src/xychart/qxyseries.cpp b/src/xychart/qxyseries.cpp index c8d5075..0f0edc0 100644 --- a/src/xychart/qxyseries.cpp +++ b/src/xychart/qxyseries.cpp @@ -268,6 +268,8 @@ QXYSeries& QXYSeries::operator<< (const QList points) void QXYSeries::modelUpdated(QModelIndex topLeft, QModelIndex bottomRight) { + Q_UNUSED(bottomRight) + if (m_mapOrientation == Qt::Vertical) emit pointReplaced(topLeft.row()); else @@ -276,11 +278,15 @@ void QXYSeries::modelUpdated(QModelIndex topLeft, QModelIndex bottomRight) void QXYSeries::modelDataAdded(QModelIndex parent, int start, int end) { + Q_UNUSED(parent) + Q_UNUSED(end) emit pointAdded(start); } void QXYSeries::modelDataRemoved(QModelIndex parent, int start, int end) { + Q_UNUSED(parent) + Q_UNUSED(end) emit pointRemoved(start); }