From a8ef6d6db8bfc72a0ae19b78cb814491a815d6ec 2012-04-12 10:29:08 From: Michal Klocek Date: 2012-04-12 10:29:08 Subject: [PATCH] Changes QChartAxis -> QAxis --- diff --git a/demos/dynamicspline/chart.cpp b/demos/dynamicspline/chart.cpp index 5d8cc28..2464ad4 100644 --- a/demos/dynamicspline/chart.cpp +++ b/demos/dynamicspline/chart.cpp @@ -19,7 +19,7 @@ ****************************************************************************/ #include "chart.h" -#include +#include #include #include diff --git a/examples/customchart/main.cpp b/examples/customchart/main.cpp index 88f48d6..ee650b0 100644 --- a/examples/customchart/main.cpp +++ b/examples/customchart/main.cpp @@ -60,8 +60,8 @@ int main(int argc, char *argv[]) //![2] //![3] - QChartAxis* axisX = chart->axisX(); - QChartAxis* axisY = chart->axisY(); + QAxis* axisX = chart->axisX(); + QAxis* axisY = chart->axisY(); // Customize axis label font QFont labelsFont; diff --git a/examples/stackedbarchartdrilldown/drilldownchart.cpp b/examples/stackedbarchartdrilldown/drilldownchart.cpp index 87ce145..870af4b 100644 --- a/examples/stackedbarchartdrilldown/drilldownchart.cpp +++ b/examples/stackedbarchartdrilldown/drilldownchart.cpp @@ -19,7 +19,7 @@ ****************************************************************************/ #include "drilldownchart.h" -#include +#include QTCOMMERCIALCHART_USE_NAMESPACE diff --git a/src/animations/axisanimation.cpp b/src/animations/axisanimation.cpp index 73b2590..9f694ed 100644 --- a/src/animations/axisanimation.cpp +++ b/src/animations/axisanimation.cpp @@ -26,7 +26,7 @@ Q_DECLARE_METATYPE(QVector) QTCOMMERCIALCHART_BEGIN_NAMESPACE -AxisAnimation::AxisAnimation(Axis *axis): ChartAnimation(axis), +AxisAnimation::AxisAnimation(ChartAxis *axis): ChartAnimation(axis), m_axis(axis) { } diff --git a/src/animations/axisanimation_p.h b/src/animations/axisanimation_p.h index 9e6dd18..ff2317c 100644 --- a/src/animations/axisanimation_p.h +++ b/src/animations/axisanimation_p.h @@ -21,7 +21,7 @@ #ifndef AXISANIMATION_H #define AXISANIMATION_H -#include "axis_p.h" +#include "chartaxis_p.h" #include "chartanimation_p.h" @@ -30,13 +30,13 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE class AxisAnimation: public ChartAnimation { public: - AxisAnimation(Axis *axis); + AxisAnimation(ChartAxis *axis); ~AxisAnimation(); protected: QVariant interpolated(const QVariant &from, const QVariant &to, qreal progress ) const; void updateCurrentValue(const QVariant &value ); private: - Axis *m_axis; + ChartAxis *m_axis; }; QTCOMMERCIALCHART_END_NAMESPACE diff --git a/src/animations/chartanimator.cpp b/src/animations/chartanimator.cpp index c5f831e..62270c2 100644 --- a/src/animations/chartanimator.cpp +++ b/src/animations/chartanimator.cpp @@ -48,7 +48,7 @@ ChartAnimator::~ChartAnimator() { } -void ChartAnimator::addAnimation(Axis *item) +void ChartAnimator::addAnimation(ChartAxis *item) { ChartAnimation *animation = m_animations.value(item); @@ -127,7 +127,7 @@ void ChartAnimator::removeAnimation(Chart *item) m_animations.remove(item); } -void ChartAnimator::updateLayout(Axis *item , QVector &newLayout) +void ChartAnimator::updateLayout(ChartAxis *item , QVector &newLayout) { AxisAnimation *animation = static_cast(m_animations.value(item)); @@ -144,13 +144,13 @@ void ChartAnimator::updateLayout(Axis *item , QVector &newLayout) oldLayout.resize(newLayout.count()); for(int i = 0, j = oldLayout.count() - 1; i < (oldLayout.count() + 1) / 2; ++i, --j) { - oldLayout[i] = item->axisType() == Axis::X_AXIS ? rect.left() : rect.bottom(); - oldLayout[j] = item->axisType() == Axis::X_AXIS ? rect.right() : rect.top(); + oldLayout[i] = item->axisType() == ChartAxis::X_AXIS ? rect.left() : rect.bottom(); + oldLayout[j] = item->axisType() == ChartAxis::X_AXIS ? rect.right() : rect.top(); } } break; case ZoomInState: { - int index = qMin(oldLayout.count() * (item->axisType() == Axis::X_AXIS ? m_point.x() : (1 - m_point.y())), newLayout.count() - 1.0); + int index = qMin(oldLayout.count() * (item->axisType() == ChartAxis::X_AXIS ? m_point.x() : (1 - m_point.y())), newLayout.count() - 1.0); oldLayout.resize(newLayout.count()); for(int i = 0; i < oldLayout.count(); i++) @@ -177,7 +177,7 @@ void ChartAnimator::updateLayout(Axis *item , QVector &newLayout) oldLayout.resize(newLayout.count()); QRectF rect = item->geometry(); for(int i = 0, j = oldLayout.count() - 1; i < oldLayout.count(); ++i, --j) - oldLayout[i] = item->axisType() == Axis::X_AXIS ? rect.left() : rect.top(); + oldLayout[i] = item->axisType() == ChartAxis::X_AXIS ? rect.left() : rect.top(); } break; } diff --git a/src/animations/chartanimator_p.h b/src/animations/chartanimator_p.h index 7571f51..3b976f0 100644 --- a/src/animations/chartanimator_p.h +++ b/src/animations/chartanimator_p.h @@ -30,7 +30,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE class ChartItem; -class Axis; +class ChartAxis; class AreaChartItem; class SplineChartItem; class ScatterChartItem; @@ -46,7 +46,7 @@ public: ChartAnimator(QObject *parent = 0); virtual ~ChartAnimator(); - void addAnimation(Axis *item); + void addAnimation(ChartAxis *item); void addAnimation(PieChartItem *item); void addAnimation(ScatterChartItem *item); void addAnimation(LineChartItem *item); @@ -57,7 +57,7 @@ public: void animationStarted(); void updateLayout(XYChartItem *item, QVector &oldLayout, QVector &newLayout, int index); void updateLayout(SplineChartItem *item, QVector &oldPoints, QVector &newPoints, QVector &oldControlPoints, QVector &newContorlPoints, int index); - void updateLayout(Axis *item, QVector &layout); + void updateLayout(ChartAxis *item, QVector &layout); void addAnimation(PieChartItem *item, QPieSlice *slice, const PieSliceData &sliceData, bool isEmpty); void removeAnimation(PieChartItem *item, QPieSlice *slice); diff --git a/src/axis/axis.pri b/src/axis/axis.pri index 4a7637b..8a78b3b 100644 --- a/src/axis/axis.pri +++ b/src/axis/axis.pri @@ -2,15 +2,15 @@ INCLUDEPATH += $$PWD DEPENDPATH += $$PWD SOURCES += \ - $$PWD/axis.cpp \ - $$PWD/qchartaxis.cpp \ + $$PWD/chartaxis.cpp \ + $$PWD/qaxis.cpp \ $$PWD/qchartaxiscategories.cpp PRIVATE_HEADERS += \ - $$PWD/axis_p.h \ - $$PWD/qchartaxis_p.h \ + $$PWD/chartaxis_p.h \ + $$PWD/qaxis_p.h \ $$PWD/qchartaxiscategories_p.h PUBLIC_HEADERS += \ - $$PWD/qchartaxis.h \ + $$PWD/qaxis.h \ $$PWD/qchartaxiscategories.h \ No newline at end of file diff --git a/src/axis/axis.cpp b/src/axis/chartaxis.cpp similarity index 82% rename from src/axis/axis.cpp rename to src/axis/chartaxis.cpp index 9feed2b..8243c6c 100644 --- a/src/axis/axis.cpp +++ b/src/axis/chartaxis.cpp @@ -18,9 +18,9 @@ ** ****************************************************************************/ -#include "axis_p.h" -#include "qchartaxis.h" -#include "qchartaxis_p.h" +#include "chartaxis_p.h" +#include "qaxis.h" +#include "qaxis_p.h" #include "qchartaxiscategories_p.h" #include "chartpresenter_p.h" #include "chartanimator_p.h" @@ -32,7 +32,7 @@ static int label_padding = 5; QTCOMMERCIALCHART_BEGIN_NAMESPACE -Axis::Axis(QChartAxis *axis,ChartPresenter *presenter,AxisType type) : Chart(presenter), +ChartAxis::ChartAxis(QAxis *axis,ChartPresenter *presenter,AxisType type) : Chart(presenter), m_chartAxis(axis), m_type(type), m_labelsAngle(0), @@ -57,11 +57,11 @@ Axis::Axis(QChartAxis *axis,ChartPresenter *presenter,AxisType type) : Chart(pre handleAxisUpdated(); } -Axis::~Axis() +ChartAxis::~ChartAxis() { } -void Axis::createItems(int count) +void ChartAxis::createItems(int count) { if (m_axis->children().size() == 0) @@ -74,7 +74,7 @@ void Axis::createItems(int count) } } -void Axis::deleteItems(int count) +void ChartAxis::deleteItems(int count) { QList lines = m_grid->childItems(); QList labels = m_labels->childItems(); @@ -89,7 +89,7 @@ void Axis::deleteItems(int count) } } -void Axis::updateLayout(QVector &layout) +void ChartAxis::updateLayout(QVector &layout) { if (animator()) { animator()->updateLayout(this,layout); @@ -98,7 +98,7 @@ void Axis::updateLayout(QVector &layout) } } -bool Axis::createLabels(QStringList &labels,qreal min, qreal max,int ticks) const +bool ChartAxis::createLabels(QStringList &labels,qreal min, qreal max,int ticks) const { Q_ASSERT(max>=min); Q_ASSERT(ticks>1); @@ -132,47 +132,47 @@ bool Axis::createLabels(QStringList &labels,qreal min, qreal max,int ticks) cons return category; } -void Axis::setAxisOpacity(qreal opacity) +void ChartAxis::setAxisOpacity(qreal opacity) { m_axis->setOpacity(opacity); } -qreal Axis::axisOpacity() const +qreal ChartAxis::axisOpacity() const { return m_axis->opacity(); } -void Axis::setGridOpacity(qreal opacity) +void ChartAxis::setGridOpacity(qreal opacity) { m_grid->setOpacity(opacity); } -qreal Axis::gridOpacity() const +qreal ChartAxis::gridOpacity() const { return m_grid->opacity(); } -void Axis::setLabelsOpacity(qreal opacity) +void ChartAxis::setLabelsOpacity(qreal opacity) { m_labels->setOpacity(opacity); } -qreal Axis::labelsOpacity() const +qreal ChartAxis::labelsOpacity() const { return m_labels->opacity(); } -void Axis::setShadesOpacity(qreal opacity) +void ChartAxis::setShadesOpacity(qreal opacity) { m_shades->setOpacity(opacity); } -qreal Axis::shadesOpacity() const +qreal ChartAxis::shadesOpacity() const { return m_shades->opacity(); } -void Axis::setLabelsAngle(int angle) +void ChartAxis::setLabelsAngle(int angle) { foreach(QGraphicsItem* item , m_labels->childItems()) { item->setRotation(angle); @@ -181,56 +181,56 @@ void Axis::setLabelsAngle(int angle) m_labelsAngle=angle; } -void Axis::setLabelsPen(const QPen &pen) +void ChartAxis::setLabelsPen(const QPen &pen) { foreach(QGraphicsItem* item , m_labels->childItems()) { static_cast(item)->setPen(pen); } } -void Axis::setLabelsBrush(const QBrush &brush) +void ChartAxis::setLabelsBrush(const QBrush &brush) { foreach(QGraphicsItem* item , m_labels->childItems()) { static_cast(item)->setBrush(brush); } } -void Axis::setLabelsFont(const QFont &font) +void ChartAxis::setLabelsFont(const QFont &font) { foreach(QGraphicsItem* item , m_labels->childItems()) { static_cast(item)->setFont(font); } } -void Axis::setShadesBrush(const QBrush &brush) +void ChartAxis::setShadesBrush(const QBrush &brush) { foreach(QGraphicsItem* item , m_shades->childItems()) { static_cast(item)->setBrush(brush); } } -void Axis::setShadesPen(const QPen &pen) +void ChartAxis::setShadesPen(const QPen &pen) { foreach(QGraphicsItem* item , m_shades->childItems()) { static_cast(item)->setPen(pen); } } -void Axis::setAxisPen(const QPen &pen) +void ChartAxis::setAxisPen(const QPen &pen) { foreach(QGraphicsItem* item , m_axis->childItems()) { static_cast(item)->setPen(pen); } } -void Axis::setGridPen(const QPen &pen) +void ChartAxis::setGridPen(const QPen &pen) { foreach(QGraphicsItem* item , m_grid->childItems()) { static_cast(item)->setPen(pen); } } -QVector Axis::calculateLayout() const +QVector ChartAxis::calculateLayout() const { Q_ASSERT(m_ticksCount>=2); @@ -261,7 +261,7 @@ QVector Axis::calculateLayout() const return points; } -void Axis::setLayout(QVector &layout) +void ChartAxis::setLayout(QVector &layout) { int diff = m_layoutVector.size() - layout.size(); @@ -377,20 +377,20 @@ void Axis::setLayout(QVector &layout) } -bool Axis::isEmpty() +bool ChartAxis::isEmpty() { return m_rect.isEmpty() || qFuzzyIsNull(m_min - m_max) || m_ticksCount==0; } //handlers -void Axis::handleAxisCategoriesUpdated() +void ChartAxis::handleAxisCategoriesUpdated() { if (isEmpty()) return; updateLayout(m_layoutVector); } -void Axis::handleAxisUpdated() +void ChartAxis::handleAxisUpdated() { if (isEmpty()) return; @@ -430,7 +430,7 @@ void Axis::handleAxisUpdated() } -void Axis::handleRangeChanged(qreal min, qreal max,int tickCount) +void ChartAxis::handleRangeChanged(qreal min, qreal max,int tickCount) { if (qFuzzyIsNull(min - max) || tickCount < 2) return; @@ -445,7 +445,7 @@ void Axis::handleRangeChanged(qreal min, qreal max,int tickCount) } -void Axis::handleGeometryChanged(const QRectF &rect) +void ChartAxis::handleGeometryChanged(const QRectF &rect) { if(m_rect != rect) { @@ -456,11 +456,11 @@ void Axis::handleGeometryChanged(const QRectF &rect) } } -void Axis::axisSelected() +void ChartAxis::axisSelected() { qDebug()<<"TODO: axis clicked"; } -#include "moc_axis_p.cpp" +#include "moc_chartaxis_p.cpp" QTCOMMERCIALCHART_END_NAMESPACE diff --git a/src/axis/axis_p.h b/src/axis/chartaxis_p.h similarity index 91% rename from src/axis/axis_p.h rename to src/axis/chartaxis_p.h index aa40498..bb6c661 100644 --- a/src/axis/axis_p.h +++ b/src/axis/chartaxis_p.h @@ -27,17 +27,17 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE -class QChartAxis; +class QAxis; class ChartPresenter; -class Axis : public Chart +class ChartAxis : public Chart { Q_OBJECT public: enum AxisType{X_AXIS,Y_AXIS}; - Axis(QChartAxis *axis, ChartPresenter *presenter, AxisType type = X_AXIS); - ~Axis(); + ChartAxis(QAxis *axis, ChartPresenter *presenter, AxisType type = X_AXIS); + ~ChartAxis(); AxisType axisType() const { return m_type; } @@ -89,7 +89,7 @@ private: void axisSelected(); private: - QChartAxis* m_chartAxis; + QAxis* m_chartAxis; AxisType m_type; QRectF m_rect; int m_labelsAngle; @@ -111,7 +111,7 @@ class AxisItem: public QGraphicsLineItem { public: - explicit AxisItem(Axis *axis, QGraphicsItem *parent = 0) : QGraphicsLineItem(parent), m_axis(axis) {} + explicit AxisItem(ChartAxis *axis, QGraphicsItem *parent = 0) : QGraphicsLineItem(parent), m_axis(axis) {} protected: void mousePressEvent(QGraphicsSceneMouseEvent *event) @@ -129,12 +129,12 @@ protected: { QPainterPath path = QGraphicsLineItem::shape(); QRectF rect = path.boundingRect(); - path.addRect(rect.adjusted(0,0,m_axis->axisType()!=Axis::X_AXIS?8:0,m_axis->axisType()!=Axis::Y_AXIS?8:0)); + path.addRect(rect.adjusted(0,0,m_axis->axisType()!=ChartAxis::X_AXIS?8:0,m_axis->axisType()!=ChartAxis::Y_AXIS?8:0)); return path; } private: - Axis* m_axis; + ChartAxis* m_axis; }; diff --git a/src/axis/qchartaxis.cpp b/src/axis/qaxis.cpp similarity index 77% rename from src/axis/qchartaxis.cpp rename to src/axis/qaxis.cpp index 803b13c..92c03a8 100644 --- a/src/axis/qchartaxis.cpp +++ b/src/axis/qaxis.cpp @@ -18,8 +18,8 @@ ** ****************************************************************************/ -#include "qchartaxis.h" -#include "qchartaxis_p.h" +#include "qaxis.h" +#include "qaxis_p.h" QTCOMMERCIALCHART_BEGIN_NAMESPACE @@ -36,123 +36,123 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE */ /*! - \fn bool QChartAxis::isAxisVisible() const + \fn bool QAxis::isAxisVisible() const \brief Returns if axis is visible \sa setAxisVisible() */ /*! - \fn QPen QChartAxis::axisPen() const + \fn QPen QAxis::axisPen() const \brief Returns pen used to draw axis and ticks. \sa setAxisPen() */ /*! - \fn bool QChartAxis::isGridLineVisible() const + \fn bool QAxis::isGridLineVisible() const \brief Returns if grid is visible \sa setGridLineVisible() */ /*! - \fn QPen QChartAxis::gridLinePen() const + \fn QPen QAxis::gridLinePen() const \brief Returns pen used to draw grid. \sa setGridLinePen() */ /*! - \fn bool QChartAxis::labelsVisible() const + \fn bool QAxis::labelsVisible() const \brief Returns if grid is visible \sa setLabelsVisible() */ /*! - \fn QPen QChartAxis::labelsPen() const + \fn QPen QAxis::labelsPen() const \brief Returns the pen used to labels. \sa setLabelsPen() */ /*! - \fn QBrush QChartAxis::labelsBrush() const + \fn QBrush QAxis::labelsBrush() const \brief Returns brush used to draw labels. \sa setLabelsBrush() */ /*! - \fn QFont QChartAxis::labelsFont() const + \fn QFont QAxis::labelsFont() const \brief Returns font used to draw labels. \sa setLabelsFont() */ /*! - \fn QFont QChartAxis::labelsAngle() const + \fn QFont QAxis::labelsAngle() const \brief Returns angle used to draw labels. \sa setLabelsAngle() */ /*! - \fn bool QChartAxis::shadesVisible() const + \fn bool QAxis::shadesVisible() const \brief Returns if shades are visible. \sa setShadesVisible() */ /*! - \fn qreal QChartAxis::shadesOpacity() const + \fn qreal QAxis::shadesOpacity() const \brief Returns opacity of shades. */ /*! - \fn QPen QChartAxis::shadesPen() const + \fn QPen QAxis::shadesPen() const \brief Returns pen used to draw shades. \sa setShadesPen() */ /*! - \fn QBrush QChartAxis::shadesBrush() const + \fn QBrush QAxis::shadesBrush() const \brief Returns brush used to draw shades. \sa setShadesBrush() */ /*! - \fn qreal QChartAxis::min() const + \fn qreal QAxis::min() const \brief Returns minimum value on the axis. \sa setMin() */ /*! - \fn qreal QChartAxis::max() const + \fn qreal QAxis::max() const \brief Returns maximim value on the axis. \sa setMax() */ /*! - \fn void QChartAxis::minChanged(qreal min) + \fn void QAxis::minChanged(qreal min) \brief Axis emits signal when \a min of axis has changed. */ /*! - \fn void QChartAxis::maxChanged(qreal max) + \fn void QAxis::maxChanged(qreal max) \brief Axis emits signal when \a max of axis has changed. */ /*! - \fn void QChartAxis::rangeChanged(qreal min, qreal max) + \fn void QAxis::rangeChanged(qreal min, qreal max) \brief Axis emits signal when \a min or \a max of axis has changed. */ /*! - \fn int QChartAxis::ticksCount() const + \fn int QAxis::ticksCount() const \brief Return number of ticks on the axis \sa setTicksCount() */ /*! - \fn QChartAxisCategories* QChartAxis::categories() + \fn QChartAxisCategories* QAxis::categories() \brief Returns pointer to the list of categories which correspond to the values on the axis. */ /*! - \fn void QChartAxis::ticksCountChanged(int count) + \fn void QAxis::ticksCountChanged(int count) \brief Emits the new \a count of ticks on the axis Signal is emitted when the number of the ticks on the axis has been changed to a different value. Parementer count\a count is the new number of ticks on the axis. @@ -163,8 +163,8 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE QChatView or QChart when axis added. */ -QChartAxis::QChartAxis(QObject *parent) : QObject(parent), -d_ptr(new QChartAxisPrivate(this)) +QAxis::QAxis(QObject *parent) : QObject(parent), +d_ptr(new QAxisPrivate(this)) { } @@ -173,14 +173,14 @@ d_ptr(new QChartAxisPrivate(this)) Destructor of the axis object. When axis is added to chart, chart object takes ownership. */ -QChartAxis::~QChartAxis() +QAxis::~QAxis() { } /*! Sets \a pen used to draw axis line and ticks. */ -void QChartAxis::setAxisPen(const QPen &pen) +void QAxis::setAxisPen(const QPen &pen) { if (d_ptr->m_axisPen!=pen) { d_ptr->m_axisPen = pen; @@ -188,7 +188,7 @@ void QChartAxis::setAxisPen(const QPen &pen) } } -QPen QChartAxis::axisPen() const +QPen QAxis::axisPen() const { return d_ptr->m_axisPen; } @@ -196,7 +196,7 @@ QPen QChartAxis::axisPen() const /*! Sets if axis and ticks are \a visible. */ -void QChartAxis::setAxisVisible(bool visible) +void QAxis::setAxisVisible(bool visible) { if (d_ptr->m_axisVisible != visible) { d_ptr->m_axisVisible = visible; @@ -204,7 +204,7 @@ void QChartAxis::setAxisVisible(bool visible) } } -bool QChartAxis::isAxisVisible() const +bool QAxis::isAxisVisible() const { return d_ptr->m_axisVisible; } @@ -212,7 +212,7 @@ bool QChartAxis::isAxisVisible() const /*! Sets if grid line is \a visible. */ -void QChartAxis::setGridLineVisible(bool visible) +void QAxis::setGridLineVisible(bool visible) { if (d_ptr->m_gridLineVisible != visible) { d_ptr->m_gridLineVisible = visible; @@ -220,14 +220,14 @@ void QChartAxis::setGridLineVisible(bool visible) } } -bool QChartAxis::isGridLineVisible() const +bool QAxis::isGridLineVisible() const { return d_ptr->m_gridLineVisible; } /*! Sets \a pen used to draw grid line. */ -void QChartAxis::setGridLinePen(const QPen &pen) +void QAxis::setGridLinePen(const QPen &pen) { if (d_ptr->m_gridLinePen != pen) { d_ptr->m_gridLinePen = pen; @@ -235,7 +235,7 @@ void QChartAxis::setGridLinePen(const QPen &pen) } } -QPen QChartAxis::gridLinePen() const +QPen QAxis::gridLinePen() const { return d_ptr->m_gridLinePen; } @@ -243,7 +243,7 @@ QPen QChartAxis::gridLinePen() const /*! Sets if axis' labels are \a visible. */ -void QChartAxis::setLabelsVisible(bool visible) +void QAxis::setLabelsVisible(bool visible) { if (d_ptr->m_labelsVisible != visible) { d_ptr->m_labelsVisible = visible; @@ -251,14 +251,14 @@ void QChartAxis::setLabelsVisible(bool visible) } } -bool QChartAxis::labelsVisible() const +bool QAxis::labelsVisible() const { return d_ptr->m_labelsVisible; } /*! Sets \a pen used to draw labels. */ -void QChartAxis::setLabelsPen(const QPen &pen) +void QAxis::setLabelsPen(const QPen &pen) { if (d_ptr->m_labelsPen != pen) { d_ptr->m_labelsPen = pen; @@ -266,7 +266,7 @@ void QChartAxis::setLabelsPen(const QPen &pen) } } -QPen QChartAxis::labelsPen() const +QPen QAxis::labelsPen() const { return d_ptr->m_labelsPen; } @@ -274,7 +274,7 @@ QPen QChartAxis::labelsPen() const /*! Sets \a brush used to draw labels. */ -void QChartAxis::setLabelsBrush(const QBrush &brush) +void QAxis::setLabelsBrush(const QBrush &brush) { if (d_ptr->m_labelsBrush != brush) { d_ptr->m_labelsBrush = brush; @@ -282,7 +282,7 @@ void QChartAxis::setLabelsBrush(const QBrush &brush) } } -QBrush QChartAxis::labelsBrush() const +QBrush QAxis::labelsBrush() const { return d_ptr->m_labelsBrush; } @@ -290,7 +290,7 @@ QBrush QChartAxis::labelsBrush() const /*! Sets \a font used to draw labels. */ -void QChartAxis::setLabelsFont(const QFont &font) +void QAxis::setLabelsFont(const QFont &font) { if (d_ptr->m_labelsFont != font) { d_ptr->m_labelsFont = font; @@ -298,7 +298,7 @@ void QChartAxis::setLabelsFont(const QFont &font) } } -QFont QChartAxis::labelsFont() const +QFont QAxis::labelsFont() const { return d_ptr->m_labelsFont; } @@ -306,7 +306,7 @@ QFont QChartAxis::labelsFont() const /*! Sets \a angle for all the labels on given axis. */ -void QChartAxis::setLabelsAngle(int angle) +void QAxis::setLabelsAngle(int angle) { if (d_ptr->m_labelsAngle != angle) { d_ptr->m_labelsAngle = angle; @@ -314,7 +314,7 @@ void QChartAxis::setLabelsAngle(int angle) } } -int QChartAxis::labelsAngle() const +int QAxis::labelsAngle() const { return d_ptr->m_labelsAngle; } @@ -322,7 +322,7 @@ int QChartAxis::labelsAngle() const /*! Sets if shades are \a visible. */ -void QChartAxis::setShadesVisible(bool visible) +void QAxis::setShadesVisible(bool visible) { if (d_ptr->m_shadesVisible != visible) { d_ptr->m_shadesVisible = visible; @@ -330,7 +330,7 @@ void QChartAxis::setShadesVisible(bool visible) } } -bool QChartAxis::shadesVisible() const +bool QAxis::shadesVisible() const { return d_ptr->m_shadesVisible; } @@ -338,7 +338,7 @@ bool QChartAxis::shadesVisible() const /*! Sets \a pen used to draw shades. */ -void QChartAxis::setShadesPen(const QPen &pen) +void QAxis::setShadesPen(const QPen &pen) { if (d_ptr->m_shadesPen != pen) { d_ptr->m_shadesPen = pen; @@ -346,7 +346,7 @@ void QChartAxis::setShadesPen(const QPen &pen) } } -QPen QChartAxis::shadesPen() const +QPen QAxis::shadesPen() const { return d_ptr->m_shadesPen; } @@ -354,7 +354,7 @@ QPen QChartAxis::shadesPen() const /*! Sets \a brush used to draw shades. */ -void QChartAxis::setShadesBrush(const QBrush &brush) +void QAxis::setShadesBrush(const QBrush &brush) { if (d_ptr->m_shadesBrush != brush) { d_ptr->m_shadesBrush = brush; @@ -362,7 +362,7 @@ void QChartAxis::setShadesBrush(const QBrush &brush) } } -QBrush QChartAxis::shadesBrush() const +QBrush QAxis::shadesBrush() const { return d_ptr->m_shadesBrush; } @@ -370,7 +370,7 @@ QBrush QChartAxis::shadesBrush() const /*! Sets \a opacity of the shades. */ -void QChartAxis::setShadesOpacity(qreal opacity) +void QAxis::setShadesOpacity(qreal opacity) { if (d_ptr->m_shadesOpacity != opacity) { d_ptr->m_shadesOpacity=opacity; @@ -378,7 +378,7 @@ void QChartAxis::setShadesOpacity(qreal opacity) } } -qreal QChartAxis::shadesOpacity() const +qreal QAxis::shadesOpacity() const { return d_ptr->m_shadesOpacity; } @@ -386,12 +386,12 @@ qreal QChartAxis::shadesOpacity() const /*! Sets \a min value on the axis. */ -void QChartAxis::setMin(qreal min) +void QAxis::setMin(qreal min) { setRange(min,d_ptr->m_max); } -qreal QChartAxis::min() const +qreal QAxis::min() const { return d_ptr->m_min; } @@ -399,12 +399,12 @@ qreal QChartAxis::min() const /*! Sets \a max value on the axis. */ -void QChartAxis::setMax(qreal max) +void QAxis::setMax(qreal max) { setRange(d_ptr->m_min,max); } -qreal QChartAxis::max() const +qreal QAxis::max() const { return d_ptr->m_max; } @@ -412,7 +412,7 @@ qreal QChartAxis::max() const /*! Sets range from \a min to \a max on the axis. */ -void QChartAxis::setRange(qreal min, qreal max) +void QAxis::setRange(qreal min, qreal max) { bool changed = false; if (!qFuzzyIsNull(d_ptr->m_min - min)) { @@ -436,7 +436,7 @@ void QChartAxis::setRange(qreal min, qreal max) /*! Sets \a count for ticks on the axis. */ -void QChartAxis::setTicksCount(int count) +void QAxis::setTicksCount(int count) { if (d_ptr->m_ticksCount != count) { d_ptr->m_ticksCount = count; @@ -445,7 +445,7 @@ void QChartAxis::setTicksCount(int count) } } -int QChartAxis::ticksCount() const +int QAxis::ticksCount() const { return d_ptr->m_ticksCount; } @@ -453,7 +453,7 @@ int QChartAxis::ticksCount() const /*! Sets axis, shades, labels and grid lines to be visible. */ -void QChartAxis::show() +void QAxis::show() { d_ptr->m_axisVisible=true; d_ptr->m_gridLineVisible=true; @@ -465,7 +465,7 @@ void QChartAxis::show() /*! Sets axis, shades, labels and grid lines to not be visible. */ -void QChartAxis::hide() +void QAxis::hide() { d_ptr->m_axisVisible = false; d_ptr->m_gridLineVisible = false; @@ -477,7 +477,7 @@ void QChartAxis::hide() /*! Sets the nice numbers state to \a enable */ -void QChartAxis::setNiceNumbersEnabled(bool enable) +void QAxis::setNiceNumbersEnabled(bool enable) { if (d_ptr->m_niceNumbers != enable){ d_ptr->m_niceNumbers = enable; @@ -488,19 +488,19 @@ void QChartAxis::setNiceNumbersEnabled(bool enable) /*! Returns whether nice numbers are enabled or not. */ -bool QChartAxis::niceNumbersEnabled() const +bool QAxis::niceNumbersEnabled() const { return d_ptr->m_niceNumbers; } -QChartAxisCategories* QChartAxis::categories() +QChartAxisCategories* QAxis::categories() { return &d_ptr->m_category; } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -QChartAxisPrivate::QChartAxisPrivate(QChartAxis* q): +QAxisPrivate::QAxisPrivate(QAxis* q): q_ptr(q), m_axisVisible(true), m_gridLineVisible(true), @@ -516,18 +516,18 @@ m_niceNumbers(false) } -QChartAxisPrivate::~QChartAxisPrivate() +QAxisPrivate::~QAxisPrivate() { } -void QChartAxisPrivate::handleAxisRangeChanged(qreal min, qreal max,int count) +void QAxisPrivate::handleAxisRangeChanged(qreal min, qreal max,int count) { q_ptr->setRange(min,max); q_ptr->setTicksCount(count); } -#include "moc_qchartaxis.cpp" -#include "moc_qchartaxis_p.cpp" +#include "moc_qaxis.cpp" +#include "moc_qaxis_p.cpp" QTCOMMERCIALCHART_END_NAMESPACE diff --git a/src/axis/qchartaxis.h b/src/axis/qaxis.h similarity index 90% rename from src/axis/qchartaxis.h rename to src/axis/qaxis.h index 0b02295..4078161 100644 --- a/src/axis/qchartaxis.h +++ b/src/axis/qaxis.h @@ -18,8 +18,8 @@ ** ****************************************************************************/ -#ifndef QCHARTAXIS_H -#define QCHARTAXIS_H +#ifndef QAXIS_H +#define QAXIS_H #include #include @@ -28,15 +28,15 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE -class QChartAxisPrivate; +class QAxisPrivate; -class QTCOMMERCIALCHART_EXPORT QChartAxis : public QObject +class QTCOMMERCIALCHART_EXPORT QAxis : public QObject { Q_OBJECT public: - QChartAxis(QObject *parent =0); - ~QChartAxis(); + QAxis(QObject *parent =0); + ~QAxis(); //axis handling bool isAxisVisible() const; @@ -98,10 +98,10 @@ Q_SIGNALS: void ticksCountChanged(int count); private: - QScopedPointer d_ptr; - Q_DISABLE_COPY(QChartAxis); + QScopedPointer d_ptr; + Q_DISABLE_COPY(QAxis); friend class ChartDataSet; - friend class Axis; + friend class ChartAxis; }; QTCOMMERCIALCHART_END_NAMESPACE diff --git a/src/axis/qchartaxis_p.h b/src/axis/qaxis_p.h similarity index 88% rename from src/axis/qchartaxis_p.h rename to src/axis/qaxis_p.h index f31b903..e6941a3 100644 --- a/src/axis/qchartaxis_p.h +++ b/src/axis/qaxis_p.h @@ -27,19 +27,19 @@ // // We mean it. -#ifndef QCHARTAXIS_P_H -#define QCHARTAXIS_P_H +#ifndef QAXIS_P_H +#define QAXIS_P_H -#include "qchartaxis.h" +#include "qaxis.h" QTCOMMERCIALCHART_BEGIN_NAMESPACE -class QChartAxisPrivate : public QObject +class QAxisPrivate : public QObject { Q_OBJECT public: - QChartAxisPrivate(QChartAxis *q); - ~QChartAxisPrivate(); + QAxisPrivate(QAxis *q); + ~QAxisPrivate(); Q_SIGNALS: void updated(); @@ -49,7 +49,7 @@ public Q_SLOTS: void handleAxisRangeChanged(qreal min, qreal max,int count); private: - QChartAxis *q_ptr; + QAxis *q_ptr; bool m_axisVisible; QPen m_axisPen; @@ -77,7 +77,7 @@ private: bool m_niceNumbers; - friend class QChartAxis; + friend class QAxis; }; QTCOMMERCIALCHART_END_NAMESPACE diff --git a/src/axis/qchartaxiscategories.h b/src/axis/qchartaxiscategories.h index 4a6e947..09cc99b 100644 --- a/src/axis/qchartaxiscategories.h +++ b/src/axis/qchartaxiscategories.h @@ -46,8 +46,8 @@ public: private: QScopedPointer d_ptr; - friend class QChartAxisPrivate; - friend class Axis; + friend class QAxisPrivate; + friend class ChartAxis; }; diff --git a/src/barchart/barchartitem.cpp b/src/barchart/barchartitem.cpp index 87a5627..e482697 100644 --- a/src/barchart/barchartitem.cpp +++ b/src/barchart/barchartitem.cpp @@ -26,7 +26,7 @@ #include "qbarseries.h" #include "qbarseries_p.h" #include "qchart.h" -#include "qchartaxis.h" +//#include "qchartaxis.h" #include "qchartaxiscategories.h" #include "chartpresenter_p.h" #include "chartanimator_p.h" diff --git a/src/chartdataset.cpp b/src/chartdataset.cpp index e67532b..ce68fc7 100644 --- a/src/chartdataset.cpp +++ b/src/chartdataset.cpp @@ -19,8 +19,8 @@ ****************************************************************************/ #include "chartdataset_p.h" -#include "qchartaxis.h" -#include "qchartaxis_p.h" +#include "qaxis.h" +#include "qaxis_p.h" #include "qabstractseries_p.h" #include "qbarseries.h" #include "qstackedbarseries.h" @@ -30,8 +30,8 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE ChartDataSet::ChartDataSet(QObject *parent):QObject(parent), - m_axisX(new QChartAxis(this)), - m_axisY(new QChartAxis(this)), + m_axisX(new QAxis(this)), + m_axisY(new QAxis(this)), m_domainIndex(0), m_axisXInitialized(false) { @@ -41,11 +41,11 @@ ChartDataSet::~ChartDataSet() { } -void ChartDataSet::addSeries(QAbstractSeries* series, QChartAxis *axisY) +void ChartDataSet::addSeries(QAbstractSeries* series, QAxis *axisY) { if(axisY==0) axisY = m_axisY; - QChartAxis* axis = m_seriesAxisMap.value(series); + QAxis* axis = m_seriesAxisMap.value(series); if(axis) { qWarning() << "Can not add series. Series already on the chart"; @@ -106,9 +106,9 @@ void ChartDataSet::addSeries(QAbstractSeries* series, QChartAxis *axisY) } -QChartAxis* ChartDataSet::removeSeries(QAbstractSeries* series) +QAxis* ChartDataSet::removeSeries(QAbstractSeries* series) { - QChartAxis* axis = m_seriesAxisMap.value(series); + QAxis* axis = m_seriesAxisMap.value(series); if(!axis){ qWarning()<<"Can not remove series. Series not found on the chart."; @@ -124,7 +124,7 @@ QChartAxis* ChartDataSet::removeSeries(QAbstractSeries* series) m_indexSeriesMap.remove(key); series->setParent(0); - QList axes = m_seriesAxisMap.values(); + QList axes = m_seriesAxisMap.values(); int i = axes.indexOf(axis); @@ -149,9 +149,9 @@ QChartAxis* ChartDataSet::removeSeries(QAbstractSeries* series) void ChartDataSet::removeAllSeries() { QList series = m_seriesAxisMap.keys(); - QList axes; + QList axes; foreach(QAbstractSeries *s , series) { - QChartAxis* axis = removeSeries(s); + QAxis* axis = removeSeries(s); if(axis==axisY()) continue; int i = axes.indexOf(axis); if(i==-1){ @@ -175,7 +175,7 @@ void ChartDataSet::setupCategories(QBarSeries* series) void ChartDataSet::zoomInDomain(const QRectF& rect, const QSizeF& size) { - QMapIterator i(m_axisDomainMap); + QMapIterator i(m_axisDomainMap); while (i.hasNext()) { i.next(); i.value()->zoomIn(rect,size); @@ -184,7 +184,7 @@ void ChartDataSet::zoomInDomain(const QRectF& rect, const QSizeF& size) void ChartDataSet::zoomOutDomain(const QRectF& rect, const QSizeF& size) { - QMapIterator i(m_axisDomainMap); + QMapIterator i(m_axisDomainMap); while (i.hasNext()) { i.next(); i.value()->zoomOut(rect,size); @@ -194,7 +194,7 @@ void ChartDataSet::zoomOutDomain(const QRectF& rect, const QSizeF& size) int ChartDataSet::seriesCount(QAbstractSeries::QSeriesType type) { int count=0; - QMapIterator i(m_seriesAxisMap); + QMapIterator i(m_seriesAxisMap); while (i.hasNext()) { i.next(); if(i.key()->type()==type) count++; @@ -213,7 +213,7 @@ int ChartDataSet::seriesIndex(QAbstractSeries *series) return -1; } -QChartAxis* ChartDataSet::axisY(QAbstractSeries *series) const +QAxis* ChartDataSet::axisY(QAbstractSeries *series) const { if(series == 0) return m_axisY; return m_seriesAxisMap.value(series); @@ -221,14 +221,14 @@ QChartAxis* ChartDataSet::axisY(QAbstractSeries *series) const Domain* ChartDataSet::domain(QAbstractSeries *series) const { - QChartAxis* axis = m_seriesAxisMap.value(series); + QAxis* axis = m_seriesAxisMap.value(series); if(axis){ return m_axisDomainMap.value(axis); }else return 0; } -Domain* ChartDataSet::domain(QChartAxis* axis) const +Domain* ChartDataSet::domain(QAxis* axis) const { if(!axis || axis==axisX()) { return m_axisDomainMap.value(axisY()); @@ -240,7 +240,7 @@ Domain* ChartDataSet::domain(QChartAxis* axis) const void ChartDataSet::scrollDomain(int dx,int dy,const QSizeF& size) { - QMapIterator i( m_axisDomainMap); + QMapIterator i( m_axisDomainMap); while (i.hasNext()) { i.next(); i.value()->move(dx,dy,size); diff --git a/src/chartdataset_p.h b/src/chartdataset_p.h index 9b1441b..0782088 100644 --- a/src/chartdataset_p.h +++ b/src/chartdataset_p.h @@ -36,7 +36,7 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE -class QChartAxis; +class QAxis; class QBarSeries; class ChartDataSet : public QObject @@ -46,8 +46,8 @@ public: ChartDataSet(QObject* parent=0); virtual ~ChartDataSet(); - void addSeries(QAbstractSeries* series,QChartAxis *axisY = 0); - QChartAxis* removeSeries(QAbstractSeries* series); + void addSeries(QAbstractSeries* series,QAxis *axisY = 0); + QAxis* removeSeries(QAbstractSeries* series); void removeAllSeries(); void zoomInDomain(const QRectF& rect, const QSizeF& size); @@ -58,28 +58,28 @@ public: int seriesIndex(QAbstractSeries *series); Domain* domain(QAbstractSeries* series) const; - Domain* domain(QChartAxis* axis) const; + Domain* domain(QAxis* axis) const; - QChartAxis* axisX() const { return m_axisX; } - QChartAxis* axisY(QAbstractSeries *series = 0) const; + QAxis* axisX() const { return m_axisX; } + QAxis* axisY(QAbstractSeries *series = 0) const; Q_SIGNALS: void seriesAdded(QAbstractSeries* series, Domain* domain); void seriesRemoved(QAbstractSeries* series); - void axisAdded(QChartAxis* axis,Domain* domain); - void axisRemoved(QChartAxis* axis); + void axisAdded(QAxis* axis,Domain* domain); + void axisRemoved(QAxis* axis); private: - QStringList createLabels(QChartAxis* axis,qreal min, qreal max); + QStringList createLabels(QAxis* axis,qreal min, qreal max); void calculateDomain(QAbstractSeries* series,Domain* domain); void setupCategories(QBarSeries* series); private: - QMap m_seriesAxisMap; - QMap m_axisDomainMap; + QMap m_seriesAxisMap; + QMap m_axisDomainMap; QMap m_indexSeriesMap; - QChartAxis* m_axisX; - QChartAxis* m_axisY; + QAxis* m_axisX; + QAxis* m_axisY; int m_domainIndex; bool m_axisXInitialized; diff --git a/src/chartpresenter.cpp b/src/chartpresenter.cpp index 4ba8b03..22eed90 100644 --- a/src/chartpresenter.cpp +++ b/src/chartpresenter.cpp @@ -20,14 +20,15 @@ #include "chartpresenter_p.h" #include "qchart.h" #include "qchart_p.h" -#include "qchartaxis.h" +#include "qaxis.h" #include "chartdataset_p.h" #include "charttheme_p.h" #include "chartanimator_p.h" #include "qabstractseries_p.h" #include "qareaseries.h" -#include "axis_p.h" +#include "chartaxis_p.h" #include "areachartitem_p.h" +#include "chartbackground_p.h" QTCOMMERCIALCHART_BEGIN_NAMESPACE @@ -61,10 +62,10 @@ void ChartPresenter::setGeometry(const QRectF& rect) updateLayout(); } -void ChartPresenter::setMinimumMarginWidth(Axis* axis, qreal width) +void ChartPresenter::setMinimumMarginWidth(ChartAxis* axis, qreal width) { switch(axis->axisType()){ - case Axis::X_AXIS: + case ChartAxis::X_AXIS: { if(width>m_chartRect.width()+ m_chartMargins.left()) { m_minLeftMargin= width - m_chartRect.width(); @@ -72,7 +73,7 @@ void ChartPresenter::setMinimumMarginWidth(Axis* axis, qreal width) } break; } - case Axis::Y_AXIS: + case ChartAxis::Y_AXIS: { if(m_minLeftMargin!=width){ @@ -85,10 +86,10 @@ void ChartPresenter::setMinimumMarginWidth(Axis* axis, qreal width) } } -void ChartPresenter::setMinimumMarginHeight(Axis* axis, qreal height) +void ChartPresenter::setMinimumMarginHeight(ChartAxis* axis, qreal height) { switch(axis->axisType()){ - case Axis::X_AXIS: + case ChartAxis::X_AXIS: { if(m_minBottomMargin!=height) { m_minBottomMargin= height; @@ -96,7 +97,7 @@ void ChartPresenter::setMinimumMarginHeight(Axis* axis, qreal height) } break; } - case Axis::Y_AXIS: + case ChartAxis::Y_AXIS: { if(height>m_chartMargins.bottom()+m_chartRect.height()){ @@ -109,9 +110,9 @@ void ChartPresenter::setMinimumMarginHeight(Axis* axis, qreal height) } } -void ChartPresenter::handleAxisAdded(QChartAxis* axis,Domain* domain) +void ChartPresenter::handleAxisAdded(QAxis* axis,Domain* domain) { - Axis* item = new Axis(axis,this,axis==m_dataset->axisX()?Axis::X_AXIS : Axis::Y_AXIS); + ChartAxis* item = new ChartAxis(axis,this,axis==m_dataset->axisX()?ChartAxis::X_AXIS : ChartAxis::Y_AXIS); if(m_options.testFlag(QChart::GridAxisAnimations)){ m_animator->addAnimation(item); @@ -137,9 +138,9 @@ void ChartPresenter::handleAxisAdded(QChartAxis* axis,Domain* domain) m_axisItems.insert(axis, item); } -void ChartPresenter::handleAxisRemoved(QChartAxis* axis) +void ChartPresenter::handleAxisRemoved(QAxis* axis) { - Axis* item = m_axisItems.take(axis); + ChartAxis* item = m_axisItems.take(axis); Q_ASSERT(item); if(m_animator) m_animator->removeAnimation(item); delete item; @@ -207,10 +208,10 @@ void ChartPresenter::setAnimationOptions(QChart::AnimationOptions options) void ChartPresenter::resetAllElements() { - QList axisList = m_axisItems.uniqueKeys(); + QList axisList = m_axisItems.uniqueKeys(); QList seriesList = m_chartItems.uniqueKeys(); - foreach(QChartAxis *axis, axisList) { + foreach(QAxis *axis, axisList) { handleAxisRemoved(axis); handleAxisAdded(axis,m_dataset->domain(axis)); } diff --git a/src/chartpresenter_p.h b/src/chartpresenter_p.h index cdcc1b8..27a44c5 100644 --- a/src/chartpresenter_p.h +++ b/src/chartpresenter_p.h @@ -22,9 +22,7 @@ #define CHARTPRESENTER_H #include "qchartglobal.h" -#include "chartbackground_p.h" //TODO fix me #include "qchart.h" //becouse of QChart::ChartThemeId //TODO -#include "qchartaxis.h" #include QTCOMMERCIALCHART_BEGIN_NAMESPACE @@ -33,9 +31,10 @@ class Chart; class QAbstractSeries; class ChartDataSet; class Domain; -class Axis; +class ChartAxis; class ChartTheme; class ChartAnimator; +class ChartBackground; class ChartPresenter: public QObject { @@ -75,8 +74,8 @@ public: void setGeometry(const QRectF& rect); QRectF chartGeometry() const { return m_chartRect; } - void setMinimumMarginHeight(Axis* axis, qreal height); - void setMinimumMarginWidth(Axis* axis, qreal width); + void setMinimumMarginHeight(ChartAxis* axis, qreal height); + void setMinimumMarginWidth(ChartAxis* axis, qreal width); qreal minimumLeftMargin() const { return m_minLeftMargin; } qreal minimumBottomMargin() const { return m_minBottomMargin; } @@ -89,8 +88,8 @@ public: //TODO: fix me public Q_SLOTS: void handleSeriesAdded(QAbstractSeries* series,Domain* domain); void handleSeriesRemoved(QAbstractSeries* series); - void handleAxisAdded(QChartAxis* axis,Domain* domain); - void handleAxisRemoved(QChartAxis* axis); + void handleAxisAdded(QAxis* axis,Domain* domain); + void handleAxisRemoved(QAxis* axis); void updateLayout(); Q_SIGNALS: @@ -103,7 +102,7 @@ private: ChartDataSet* m_dataset; ChartTheme *m_chartTheme; QMap m_chartItems; - QMap m_axisItems; + QMap m_axisItems; QRectF m_rect; QRectF m_chartRect; QChart::AnimationOptions m_options; diff --git a/src/charttheme.cpp b/src/charttheme.cpp index d395d64..daf50a4 100644 --- a/src/charttheme.cpp +++ b/src/charttheme.cpp @@ -23,7 +23,7 @@ #include "qchart_p.h" #include "qchartview.h" #include "qlegend.h" -#include "qchartaxis.h" +#include "qaxis.h" #include //series @@ -39,7 +39,7 @@ #include "qsplineseries.h" //items -#include "axis_p.h" +#include "chartaxis_p.h" #include "barchartitem_p.h" #include "stackedbarchartitem_p.h" #include "percentbarchartitem_p.h" @@ -264,7 +264,7 @@ void ChartTheme::decorate(QSplineSeries *series, int index) } } -void ChartTheme::decorate(QChartAxis *axis,bool axisX) +void ChartTheme::decorate(QAxis *axis,bool axisX) { QPen pen; QBrush brush; diff --git a/src/charttheme_p.h b/src/charttheme_p.h index 019fdf6..e11e004 100644 --- a/src/charttheme_p.h +++ b/src/charttheme_p.h @@ -69,7 +69,7 @@ public: void decorate(QScatterSeries *series, int index); void decorate(QPieSeries *series, int index); void decorate(QSplineSeries *series, int index); - void decorate(QChartAxis *axis, bool axisX); + void decorate(QAxis *axis, bool axisX); void setForced(bool enabled); bool isForced() { return m_force; } diff --git a/src/qchart.cpp b/src/qchart.cpp index 5be3f49..5c307cb 100644 --- a/src/qchart.cpp +++ b/src/qchart.cpp @@ -22,6 +22,8 @@ #include "qchart_p.h" #include "legendscroller_p.h" #include "qlegend_p.h" +#include "chartbackground_p.h" +#include "qaxis.h" #include #include @@ -91,7 +93,7 @@ QChart::~QChart() If auto scaling is enabled, re-scales the axes the series is bound to (both the x axis and the y axis). */ -void QChart::addSeries(QAbstractSeries *series, QChartAxis *axisY) +void QChart::addSeries(QAbstractSeries *series, QAxis *axisY) { Q_ASSERT(series); d_ptr->m_dataset->addSeries(series, axisY); @@ -273,7 +275,7 @@ void QChart::zoomOut() /*! Returns the pointer to the x axis object of the chart */ -QChartAxis* QChart::axisX() const +QAxis* QChart::axisX() const { return d_ptr->m_dataset->axisX(); } @@ -282,7 +284,7 @@ QChartAxis* QChart::axisX() const Returns the pointer to the y axis object of the \a series If no \a series is provided then default Y axis of the chart is returned. */ -QChartAxis* QChart::axisY(QAbstractSeries *series) const +QAxis* QChart::axisY(QAbstractSeries *series) const { return d_ptr->m_dataset->axisY(series); } @@ -425,8 +427,8 @@ void QChartPrivate::createConnections() QObject::connect(m_dataset,SIGNAL(seriesAdded(QAbstractSeries *, Domain *)),m_presenter,SLOT(handleSeriesAdded(QAbstractSeries *, Domain *))); QObject::connect(m_dataset,SIGNAL(seriesRemoved(QAbstractSeries *)),m_presenter,SLOT(handleSeriesRemoved(QAbstractSeries *))); - QObject::connect(m_dataset,SIGNAL(axisAdded(QChartAxis*,Domain*)),m_presenter,SLOT(handleAxisAdded(QChartAxis*,Domain*))); - QObject::connect(m_dataset,SIGNAL(axisRemoved(QChartAxis*)),m_presenter,SLOT(handleAxisRemoved(QChartAxis*))); + QObject::connect(m_dataset,SIGNAL(axisAdded(QAxis*,Domain*)),m_presenter,SLOT(handleAxisAdded(QAxis*,Domain*))); + QObject::connect(m_dataset,SIGNAL(axisRemoved(QAxis*)),m_presenter,SLOT(handleAxisRemoved(QAxis*))); } #include "moc_qchart.cpp" diff --git a/src/qchart.h b/src/qchart.h index 2a45700..433d8bc 100644 --- a/src/qchart.h +++ b/src/qchart.h @@ -30,7 +30,7 @@ class QGraphicsSceneResizeEvent; QTCOMMERCIALCHART_BEGIN_NAMESPACE class QAbstractSeries; -class QChartAxis; +class QAxis; class QLegend; struct QChartPrivate; @@ -63,7 +63,7 @@ public: explicit QChart(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0); ~QChart(); - void addSeries(QAbstractSeries *series, QChartAxis *axisY = 0); + void addSeries(QAbstractSeries *series, QAxis *axisY = 0); void removeSeries(QAbstractSeries *series); void removeAllSeries(); @@ -97,8 +97,8 @@ public: void scrollUp(); void scrollDown(); - QChartAxis* axisX() const; - QChartAxis* axisY(QAbstractSeries* series = 0) const; + QAxis* axisX() const; + QAxis* axisY(QAbstractSeries* series = 0) const; QLegend* legend() const; QRectF margins() const; diff --git a/src/qchartview.h b/src/qchartview.h index ee6b524..9058586 100644 --- a/src/qchartview.h +++ b/src/qchartview.h @@ -21,7 +21,7 @@ #ifndef QCHARTVIEW_H #define QCHARTVIEW_H -#include +#include #include #include #include diff --git a/test/auto/chartdataset/tst_chartdataset.cpp b/test/auto/chartdataset/tst_chartdataset.cpp index 6c3c46d..4f04a20 100644 --- a/test/auto/chartdataset/tst_chartdataset.cpp +++ b/test/auto/chartdataset/tst_chartdataset.cpp @@ -19,7 +19,7 @@ ****************************************************************************/ #include -#include +#include #include #include #include @@ -27,7 +27,7 @@ QTCOMMERCIALCHART_USE_NAMESPACE Q_DECLARE_METATYPE(Domain *) -Q_DECLARE_METATYPE(QChartAxis *) +Q_DECLARE_METATYPE(QAxis *) Q_DECLARE_METATYPE(QAbstractSeries *) Q_DECLARE_METATYPE(QLineSeries *) @@ -69,7 +69,7 @@ private Q_SLOTS: void tst_ChartDataSet::initTestCase() { qRegisterMetaType(); - qRegisterMetaType(); + qRegisterMetaType(); qRegisterMetaType(); } @@ -104,40 +104,40 @@ void tst_ChartDataSet::chartdataset() void tst_ChartDataSet::addSeries_data() { QTest::addColumn("series0"); - QTest::addColumn("axis0"); + QTest::addColumn("axis0"); QTest::addColumn("series1"); - QTest::addColumn("axis1"); + QTest::addColumn("axis1"); QTest::addColumn("series2"); - QTest::addColumn("axis2"); + QTest::addColumn("axis2"); QTest::addColumn("axisCount"); QLineSeries* series0 = new QLineSeries(this); QLineSeries* series1 = new QLineSeries(this); QLineSeries* series2 = new QLineSeries(this); - QChartAxis* axis0 = new QChartAxis(this); - QChartAxis* axis1 = new QChartAxis(this); - QChartAxis* axis2 = new QChartAxis(this); + QAxis* axis0 = new QAxis(this); + QAxis* axis1 = new QAxis(this); + QAxis* axis2 = new QAxis(this); - QTest::newRow("default axis Y: series0,series1,series2") << series0 << (QChartAxis*)0 << series1 << (QChartAxis*)0 << series2 << (QChartAxis*)0 << 2; - QTest::newRow("default axis Y: series0, axis 0: series1,series2") << series0 << (QChartAxis*)0 << series1 << axis0 << series2 << axis0 << 3; + QTest::newRow("default axis Y: series0,series1,series2") << series0 << (QAxis*)0 << series1 << (QAxis*)0 << series2 << (QAxis*)0 << 2; + QTest::newRow("default axis Y: series0, axis 0: series1,series2") << series0 << (QAxis*)0 << series1 << axis0 << series2 << axis0 << 3; QTest::newRow("axis0: series0, axis1: series1, axis2: series2") << series0 << axis0 << series1 << axis1 << series2 << axis2 << 4; } void tst_ChartDataSet::addSeries() { QFETCH(QLineSeries*, series0); - QFETCH(QChartAxis*, axis0); + QFETCH(QAxis*, axis0); QFETCH(QLineSeries*, series1); - QFETCH(QChartAxis*, axis1); + QFETCH(QAxis*, axis1); QFETCH(QLineSeries*, series2); - QFETCH(QChartAxis*, axis2); + QFETCH(QAxis*, axis2); QFETCH(int, axisCount); ChartDataSet dataSet; - QSignalSpy spy0(&dataSet, SIGNAL(axisAdded(QChartAxis*,Domain*))); - QSignalSpy spy1(&dataSet, SIGNAL(axisRemoved(QChartAxis*))); + QSignalSpy spy0(&dataSet, SIGNAL(axisAdded(QAxis*,Domain*))); + QSignalSpy spy1(&dataSet, SIGNAL(axisRemoved(QAxis*))); QSignalSpy spy2(&dataSet, SIGNAL(seriesAdded(QAbstractSeries *,Domain*))); QSignalSpy spy3(&dataSet, SIGNAL(seriesRemoved(QAbstractSeries *))); @@ -167,11 +167,11 @@ void tst_ChartDataSet::removeSeries_data() void tst_ChartDataSet::removeSeries() { QFETCH(QLineSeries*, series0); - QFETCH(QChartAxis*, axis0); + QFETCH(QAxis*, axis0); QFETCH(QLineSeries*, series1); - QFETCH(QChartAxis*, axis1); + QFETCH(QAxis*, axis1); QFETCH(QLineSeries*, series2); - QFETCH(QChartAxis*, axis2); + QFETCH(QAxis*, axis2); QFETCH(int, axisCount); ChartDataSet dataSet; @@ -180,8 +180,8 @@ void tst_ChartDataSet::removeSeries() dataSet.addSeries(series1,axis1); dataSet.addSeries(series2,axis2); - QSignalSpy spy0(&dataSet, SIGNAL(axisAdded(QChartAxis *, Domain *))); - QSignalSpy spy1(&dataSet, SIGNAL(axisRemoved(QChartAxis *))); + QSignalSpy spy0(&dataSet, SIGNAL(axisAdded(QAxis *, Domain *))); + QSignalSpy spy1(&dataSet, SIGNAL(axisRemoved(QAxis *))); QSignalSpy spy2(&dataSet, SIGNAL(seriesAdded(QAbstractSeries *, Domain *))); QSignalSpy spy3(&dataSet, SIGNAL(seriesRemoved(QAbstractSeries *))); @@ -206,9 +206,9 @@ void tst_ChartDataSet::removeAllSeries() QLineSeries* series1 = new QLineSeries(this); QLineSeries* series2 = new QLineSeries(this); - QChartAxis* axis0 = new QChartAxis(this); - QChartAxis* axis1 = new QChartAxis(this); - QChartAxis* axis2 = new QChartAxis(this); + QAxis* axis0 = new QAxis(this); + QAxis* axis1 = new QAxis(this); + QAxis* axis2 = new QAxis(this); ChartDataSet dataSet; @@ -217,8 +217,8 @@ void tst_ChartDataSet::removeAllSeries() dataSet.addSeries(series1, axis1); dataSet.addSeries(series2, axis2); - QSignalSpy spy0(&dataSet, SIGNAL(axisAdded(QChartAxis *, Domain *))); - QSignalSpy spy1(&dataSet, SIGNAL(axisRemoved(QChartAxis *))); + QSignalSpy spy0(&dataSet, SIGNAL(axisAdded(QAxis *, Domain *))); + QSignalSpy spy1(&dataSet, SIGNAL(axisRemoved(QAxis *))); QSignalSpy spy2(&dataSet, SIGNAL(seriesAdded(QAbstractSeries *, Domain *))); QSignalSpy spy3(&dataSet, SIGNAL(seriesRemoved(QAbstractSeries *))); @@ -233,22 +233,22 @@ void tst_ChartDataSet::removeAllSeries() void tst_ChartDataSet::axisY_data() { - QTest::addColumn("axis0"); - QTest::addColumn("axis1"); - QTest::addColumn("axis2"); - QTest::newRow("1 defualt, 2 optional") << (QChartAxis*)0 << new QChartAxis() << new QChartAxis(); - QTest::newRow("3 optional") << new QChartAxis() << new QChartAxis() << new QChartAxis(); + QTest::addColumn("axis0"); + QTest::addColumn("axis1"); + QTest::addColumn("axis2"); + QTest::newRow("1 defualt, 2 optional") << (QAxis*)0 << new QAxis() << new QAxis(); + QTest::newRow("3 optional") << new QAxis() << new QAxis() << new QAxis(); } void tst_ChartDataSet::axisY() { - QFETCH(QChartAxis*, axis0); - QFETCH(QChartAxis*, axis1); - QFETCH(QChartAxis*, axis2); + QFETCH(QAxis*, axis0); + QFETCH(QAxis*, axis1); + QFETCH(QAxis*, axis2); ChartDataSet dataSet; - QChartAxis* defaultAxisY = dataSet.axisY(); + QAxis* defaultAxisY = dataSet.axisY(); QVERIFY2(defaultAxisY, "Missing axisY."); @@ -279,11 +279,11 @@ void tst_ChartDataSet::seriesCount_data() void tst_ChartDataSet::seriesCount() { QFETCH(QLineSeries*, series0); - QFETCH(QChartAxis*, axis0); + QFETCH(QAxis*, axis0); QFETCH(QLineSeries*, series1); - QFETCH(QChartAxis*, axis1); + QFETCH(QAxis*, axis1); QFETCH(QLineSeries*, series2); - QFETCH(QChartAxis*, axis2); + QFETCH(QAxis*, axis2); QFETCH(int, axisCount); Q_UNUSED(axisCount); @@ -293,8 +293,8 @@ void tst_ChartDataSet::seriesCount() dataSet.addSeries(series1, axis1); dataSet.addSeries(series2, axis2); - QSignalSpy spy0(&dataSet, SIGNAL(axisAdded(QChartAxis *, Domain *))); - QSignalSpy spy1(&dataSet, SIGNAL(axisRemoved(QChartAxis *))); + QSignalSpy spy0(&dataSet, SIGNAL(axisAdded(QAxis *, Domain *))); + QSignalSpy spy1(&dataSet, SIGNAL(axisRemoved(QAxis *))); QSignalSpy spy2(&dataSet, SIGNAL(seriesAdded(QAbstractSeries *, Domain *))); QSignalSpy spy3(&dataSet, SIGNAL(seriesRemoved(QAbstractSeries *))); @@ -319,11 +319,11 @@ void tst_ChartDataSet::seriesIndex() //TODO: rewrite this series_index_data to match better QFETCH(QLineSeries*, series0); - QFETCH(QChartAxis*, axis0); + QFETCH(QAxis*, axis0); QFETCH(QLineSeries*, series1); - QFETCH(QChartAxis*, axis1); + QFETCH(QAxis*, axis1); QFETCH(QLineSeries*, series2); - QFETCH(QChartAxis*, axis2); + QFETCH(QAxis*, axis2); QFETCH(int, axisCount); Q_UNUSED(axisCount); @@ -333,8 +333,8 @@ void tst_ChartDataSet::seriesIndex() dataSet.addSeries(series1, axis1); dataSet.addSeries(series2, axis2); - QSignalSpy spy0(&dataSet, SIGNAL(axisAdded(QChartAxis*,Domain*))); - QSignalSpy spy1(&dataSet, SIGNAL(axisRemoved(QChartAxis*))); + QSignalSpy spy0(&dataSet, SIGNAL(axisAdded(QAxis*,Domain*))); + QSignalSpy spy1(&dataSet, SIGNAL(axisRemoved(QAxis*))); QSignalSpy spy2(&dataSet, SIGNAL(seriesAdded(QSeries*,Domain*))); QSignalSpy spy3(&dataSet, SIGNAL(seriesRemoved(QSeries*))); @@ -408,11 +408,11 @@ void tst_ChartDataSet::domain_data() void tst_ChartDataSet::domain() { QFETCH(QLineSeries*, series0); - QFETCH(QChartAxis*, axis0); + QFETCH(QAxis*, axis0); QFETCH(QLineSeries*, series1); - QFETCH(QChartAxis*, axis1); + QFETCH(QAxis*, axis1); QFETCH(QLineSeries*, series2); - QFETCH(QChartAxis*, axis2); + QFETCH(QAxis*, axis2); QFETCH(int, axisCount); Q_UNUSED(axisCount); @@ -422,8 +422,8 @@ void tst_ChartDataSet::domain() dataSet.addSeries(series1, axis1); dataSet.addSeries(series2, axis2); - QSignalSpy spy0(&dataSet, SIGNAL(axisAdded(QChartAxis *, Domain *))); - QSignalSpy spy1(&dataSet, SIGNAL(axisRemoved(QChartAxis *))); + QSignalSpy spy0(&dataSet, SIGNAL(axisAdded(QAxis *, Domain *))); + QSignalSpy spy1(&dataSet, SIGNAL(axisRemoved(QAxis *))); QSignalSpy spy2(&dataSet, SIGNAL(seriesAdded(QAbstractSeries *, Domain *))); QSignalSpy spy3(&dataSet, SIGNAL(seriesRemoved(QAbstractSeries *))); @@ -448,11 +448,11 @@ void tst_ChartDataSet::zoomInDomain_data() void tst_ChartDataSet::zoomInDomain() { QFETCH(QLineSeries*, series0); - QFETCH(QChartAxis*, axis0); + QFETCH(QAxis*, axis0); QFETCH(QLineSeries*, series1); - QFETCH(QChartAxis*, axis1); + QFETCH(QAxis*, axis1); QFETCH(QLineSeries*, series2); - QFETCH(QChartAxis*, axis2); + QFETCH(QAxis*, axis2); QFETCH(int, axisCount); Q_UNUSED(axisCount); @@ -489,11 +489,11 @@ void tst_ChartDataSet::zoomOutDomain_data() void tst_ChartDataSet::zoomOutDomain() { QFETCH(QLineSeries*, series0); - QFETCH(QChartAxis*, axis0); + QFETCH(QAxis*, axis0); QFETCH(QLineSeries*, series1); - QFETCH(QChartAxis*, axis1); + QFETCH(QAxis*, axis1); QFETCH(QLineSeries*, series2); - QFETCH(QChartAxis*, axis2); + QFETCH(QAxis*, axis2); QFETCH(int, axisCount); Q_UNUSED(axisCount); @@ -531,11 +531,11 @@ void tst_ChartDataSet::scrollDomain_data() void tst_ChartDataSet::scrollDomain() { QFETCH(QLineSeries*, series0); - QFETCH(QChartAxis*, axis0); + QFETCH(QAxis*, axis0); QFETCH(QLineSeries*, series1); - QFETCH(QChartAxis*, axis1); + QFETCH(QAxis*, axis1); QFETCH(QLineSeries*, series2); - QFETCH(QChartAxis*, axis2); + QFETCH(QAxis*, axis2); QFETCH(int, axisCount); Q_UNUSED(axisCount); diff --git a/test/auto/domain/tst_domain.cpp b/test/auto/domain/tst_domain.cpp index ca021ae..dcf5352 100644 --- a/test/auto/domain/tst_domain.cpp +++ b/test/auto/domain/tst_domain.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include QTCOMMERCIALCHART_USE_NAMESPACE diff --git a/test/auto/qchart/tst_qchart.cpp b/test/auto/qchart/tst_qchart.cpp index 0e8f7ce..8c36c8d 100644 --- a/test/auto/qchart/tst_qchart.cpp +++ b/test/auto/qchart/tst_qchart.cpp @@ -11,7 +11,7 @@ QTCOMMERCIALCHART_USE_NAMESPACE -Q_DECLARE_METATYPE(QChartAxis *) +Q_DECLARE_METATYPE(QAxis *) Q_DECLARE_METATYPE(QAbstractSeries *) Q_DECLARE_METATYPE(QChart::AnimationOption) Q_DECLARE_METATYPE(QBrush) @@ -157,7 +157,7 @@ void tst_QChart::qchart() void tst_QChart::addSeries_data() { QTest::addColumn("series"); - QTest::addColumn("axis"); + QTest::addColumn("axis"); QAbstractSeries* series0 = new QLineSeries(this); QAbstractSeries* series1 = new QAreaSeries(static_cast(series0)); @@ -168,23 +168,23 @@ void tst_QChart::addSeries_data() QAbstractSeries* series6 = new QPercentBarSeries(QBarCategories(),this); QAbstractSeries* series7 = new QStackedBarSeries(QBarCategories(),this); - QChartAxis* axis = new QChartAxis(this); + QAxis* axis = new QAxis(this); - QTest::newRow("default axis: lineSeries") << series0 << (QChartAxis*) 0; + QTest::newRow("default axis: lineSeries") << series0 << (QAxis*) 0; QTest::newRow("axis0: lineSeries") << series0 << axis; - QTest::newRow("default axis: areaSeries") << series1 << (QChartAxis*) 0; + QTest::newRow("default axis: areaSeries") << series1 << (QAxis*) 0; QTest::newRow("axis: areaSeries") << series1 << axis; - QTest::newRow("default axis: scatterSeries") << series2 << (QChartAxis*) 0; + QTest::newRow("default axis: scatterSeries") << series2 << (QAxis*) 0; QTest::newRow("axis1: scatterSeries") << series2 << axis; - QTest::newRow("default axis: splineSeries") << series3 << (QChartAxis*) 0; + QTest::newRow("default axis: splineSeries") << series3 << (QAxis*) 0; QTest::newRow("axis: splineSeries") << series3 << axis; - QTest::newRow("default axis: pieSeries") << series4 << (QChartAxis*) 0; + QTest::newRow("default axis: pieSeries") << series4 << (QAxis*) 0; QTest::newRow("axis: pieSeries") << series4 << axis; - QTest::newRow("default axis: barSeries") << series5 << (QChartAxis*) 0; + QTest::newRow("default axis: barSeries") << series5 << (QAxis*) 0; QTest::newRow("axis: barSeries") << series5 << axis; - QTest::newRow("default axis: percentBarSeries") << series6 << (QChartAxis*) 0; + QTest::newRow("default axis: percentBarSeries") << series6 << (QAxis*) 0; QTest::newRow("axis: barSeries") << series6 << axis; - QTest::newRow("default axis: stackedBarSeries") << series7 << (QChartAxis*) 0; + QTest::newRow("default axis: stackedBarSeries") << series7 << (QAxis*) 0; QTest::newRow("axis: barSeries") << series7 << axis; } @@ -192,7 +192,7 @@ void tst_QChart::addSeries_data() void tst_QChart::addSeries() { QFETCH(QAbstractSeries *, series); - QFETCH(QChartAxis *, axis); + QFETCH(QAxis *, axis); m_view->show(); QTest::qWaitForWindowShown(m_view); if(!axis) axis = m_chart->axisY(); @@ -227,7 +227,7 @@ void tst_QChart::axisX_data() void tst_QChart::axisX() { QVERIFY(m_chart->axisX()); - QChartAxis* axis = m_chart->axisX(); + QAxis* axis = m_chart->axisX(); createTestData(); //it should be the same axis QCOMPARE(axis,m_chart->axisX()); @@ -235,21 +235,21 @@ void tst_QChart::axisX() void tst_QChart::axisY_data() { - QTest::addColumn("axis0"); - QTest::addColumn("axis1"); - QTest::addColumn("axis2"); - QTest::newRow("1 defualt, 2 optional") << (QChartAxis*)0 << new QChartAxis() << new QChartAxis(); - QTest::newRow("3 optional") << new QChartAxis() << new QChartAxis() << new QChartAxis(); + QTest::addColumn("axis0"); + QTest::addColumn("axis1"); + QTest::addColumn("axis2"); + QTest::newRow("1 defualt, 2 optional") << (QAxis*)0 << new QAxis() << new QAxis(); + QTest::newRow("3 optional") << new QAxis() << new QAxis() << new QAxis(); } void tst_QChart::axisY() { - QFETCH(QChartAxis*, axis0); - QFETCH(QChartAxis*, axis1); - QFETCH(QChartAxis*, axis2); + QFETCH(QAxis*, axis0); + QFETCH(QAxis*, axis1); + QFETCH(QAxis*, axis2); - QChartAxis* defaultAxisY = m_chart->axisY(); + QAxis* defaultAxisY = m_chart->axisY(); QVERIFY2(defaultAxisY, "Missing axisY."); @@ -385,7 +385,7 @@ void tst_QChart::removeSeries_data() void tst_QChart::removeSeries() { QFETCH(QAbstractSeries *, series); - QFETCH(QChartAxis *, axis); + QFETCH(QAxis *, axis); m_view->show(); QTest::qWaitForWindowShown(m_view); if(!axis) axis = m_chart->axisY(); diff --git a/test/auto/qchartview/tst_qchartview.cpp b/test/auto/qchartview/tst_qchartview.cpp index 422c898..543749d 100644 --- a/test/auto/qchartview/tst_qchartview.cpp +++ b/test/auto/qchartview/tst_qchartview.cpp @@ -145,9 +145,9 @@ void tst_QChartView::rubberBand() //this is hack since view does not get events otherwise m_view->setMouseTracking(true); - QChartAxis* axisY = m_view->chart()->axisY(); + QAxis* axisY = m_view->chart()->axisY(); QSignalSpy spy0(axisY, SIGNAL(rangeChanged(qreal,qreal))); - QChartAxis* axisX = m_view->chart()->axisX(); + QAxis* axisX = m_view->chart()->axisX(); QSignalSpy spy1(axisX, SIGNAL(rangeChanged(qreal,qreal))); QTest::qWaitForWindowShown(m_view); @@ -197,9 +197,9 @@ void tst_QChartView::keys() m_view->resize(100 + padding.left() + padding.right(), 100 + padding.top()+ padding.bottom()); m_view->show(); - QChartAxis* axisY = m_view->chart()->axisY(); + QAxis* axisY = m_view->chart()->axisY(); QSignalSpy spy0(axisY, SIGNAL(rangeChanged(qreal,qreal))); - QChartAxis* axisX = m_view->chart()->axisX(); + QAxis* axisX = m_view->chart()->axisX(); QSignalSpy spy1(axisX, SIGNAL(rangeChanged(qreal,qreal))); QTest::keyPress(m_view, key); diff --git a/test/gdpbarchart/widget.cpp b/test/gdpbarchart/widget.cpp index c219685..dfd6673 100644 --- a/test/gdpbarchart/widget.cpp +++ b/test/gdpbarchart/widget.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include diff --git a/test/tablemodelchart/tablewidget.cpp b/test/tablemodelchart/tablewidget.cpp index 70501c0..28f6e5a 100644 --- a/test/tablemodelchart/tablewidget.cpp +++ b/test/tablemodelchart/tablewidget.cpp @@ -143,7 +143,7 @@ void TableWidget::updateChartType(bool toggle) // renable axes of the chart (pie hides them) // x axis - QChartAxis *axis = m_chart->axisX(); + QAxis *axis = m_chart->axisX(); axis->setAxisVisible(true); axis->setGridLineVisible(true); axis->setLabelsVisible(true); @@ -332,5 +332,5 @@ void TableWidget::updateChartType(bool toggle) TableWidget::~TableWidget() { - + }