From 54fd83ddb7eda05ebeb31cd9df033f57ab4bd13c 2013-05-10 08:18:09 From: Miikka Heikkinen Date: 2013-05-10 08:18:09 Subject: [PATCH] Fix some warnings for android build. Change-Id: I05a1afd79813f9ec50ad2145f667edbb78ee4667 Reviewed-by: Mika Salmela --- diff --git a/src/axis/polarchartaxis.cpp b/src/axis/polarchartaxis.cpp index 8bb8042..4dee600 100644 --- a/src/axis/polarchartaxis.cpp +++ b/src/axis/polarchartaxis.cpp @@ -57,6 +57,12 @@ void PolarChartAxis::updateLayout(QVector &layout) if (animation()) { switch (presenter()->state()) { + case ChartPresenter::ZoomInState: + case ChartPresenter::ZoomOutState: + case ChartPresenter::ScrollUpState: + case ChartPresenter::ScrollLeftState: + case ChartPresenter::ScrollDownState: + case ChartPresenter::ScrollRightState: case ChartPresenter::ShowState: animation()->setAnimationType(AxisAnimation::DefaultAnimation); break; diff --git a/src/axis/polarchartaxisangular.cpp b/src/axis/polarchartaxisangular.cpp index 8eed1f9..22b6c8f 100644 --- a/src/axis/polarchartaxisangular.cpp +++ b/src/axis/polarchartaxisangular.cpp @@ -99,11 +99,11 @@ void PolarChartAxisAngular::updateGeometry() if (i == (layout.size() - 1)) farEdge = 360.0; else - farEdge = qMin(360.0, layout.at(i + 1)); + farEdge = qMin(qreal(360.0), layout.at(i + 1)); // Adjust the labelCoordinate to show it if next tick is visible if (nextTickVisible) - labelCoordinate = qMax(0.0, labelCoordinate); + labelCoordinate = qMax(qreal(0.0), labelCoordinate); labelCoordinate = (labelCoordinate + farEdge) / 2.0; // Don't display label once the category gets too small near the axis @@ -316,8 +316,6 @@ qreal PolarChartAxisAngular::preferredAxisRadius(const QSizeF &maxSize) if (maxSize.width() < maxSize.height()) radius = maxSize.width() / 2.0; - int labelHeight = 0; - if (axis()->labelsVisible()) { QVector layout = calculateLayout(); if (layout.isEmpty()) @@ -353,11 +351,11 @@ qreal PolarChartAxisAngular::preferredAxisRadius(const QSizeF &maxSize) if (i == (layout.size() - 1)) farEdge = 360.0; else - farEdge = qMin(360.0, layout.at(i + 1)); + farEdge = qMin(qreal(360.0), layout.at(i + 1)); // Adjust the labelCoordinate to show it if next tick is visible if (nextTickVisible) - labelCoordinate = qMax(0.0, labelCoordinate); + labelCoordinate = qMax(qreal(0.0), labelCoordinate); labelCoordinate = (labelCoordinate + farEdge) / 2.0; } @@ -373,7 +371,6 @@ qreal PolarChartAxisAngular::preferredAxisRadius(const QSizeF &maxSize) } QRectF boundingRect = labelBoundingRect(fm, labelList.at(i)); - labelHeight = boundingRect.height(); QPointF labelPoint = QLineF::fromPolar(radius + tickWidth(), 90.0 - labelCoordinate).p2(); boundingRect = moveLabelToPosition(labelCoordinate, labelPoint, boundingRect); diff --git a/src/axis/polarchartaxisradial.cpp b/src/axis/polarchartaxisradial.cpp index 5592398..995eafc 100644 --- a/src/axis/polarchartaxisradial.cpp +++ b/src/axis/polarchartaxisradial.cpp @@ -97,7 +97,7 @@ void PolarChartAxisRadial::updateGeometry() // Adjust the labelCoordinate to show it if next tick is visible if (nextTickVisible) - labelCoordinate = qMax(0.0, labelCoordinate); + labelCoordinate = qMax(qreal(0.0), labelCoordinate); labelCoordinate = (labelCoordinate + farEdge) / 2.0; if (labelCoordinate > 0.0 && labelCoordinate < radius) diff --git a/src/chartconfig_p.h b/src/chartconfig_p.h index 1261241..732a887 100644 --- a/src/chartconfig_p.h +++ b/src/chartconfig_p.h @@ -67,11 +67,11 @@ public: } QString compilationTime() { - return buildTime; + return QString(buildTime); } QString compilationHead() { - return gitHead; + return QString(gitHead); } private: diff --git a/src/qchart.cpp b/src/qchart.cpp index 76b6299..0948054 100644 --- a/src/qchart.cpp +++ b/src/qchart.cpp @@ -667,11 +667,11 @@ QPointF QChart::mapToPosition(const QPointF &value, QAbstractSeries *series) QChartPrivate::QChartPrivate(QChart *q, QChart::ChartType type): q_ptr(q), - m_type(type), m_legend(0), m_dataset(new ChartDataSet(q)), m_presenter(new ChartPresenter(q, type)), - m_themeManager(new ChartThemeManager(q)) + m_themeManager(new ChartThemeManager(q)), + m_type(type) { QObject::connect(m_dataset, SIGNAL(seriesAdded(QAbstractSeries*)), m_presenter, SLOT(handleSeriesAdded(QAbstractSeries*))); QObject::connect(m_dataset, SIGNAL(seriesRemoved(QAbstractSeries*)), m_presenter, SLOT(handleSeriesRemoved(QAbstractSeries*))); diff --git a/src/qchartview.cpp b/src/qchartview.cpp index 56de254..9e5677a 100644 --- a/src/qchartview.cpp +++ b/src/qchartview.cpp @@ -23,6 +23,7 @@ #include "qchart_p.h" #include #include +#include /*! \enum QChartView::RubberBand @@ -263,7 +264,7 @@ void QChartViewPrivate::resize() { // Flip chart width and height if the view has been rotated // more than 45 degrees from the horizontal so it fits better into the view. - qreal angle = acos(q_ptr->transform().m11()) * rad2deg; + qreal angle = qAcos(q_ptr->transform().m11()) * rad2deg; QSize chartSize = q_ptr->size(); if (angle > 45.0 && angle < 135.0) {