diff --git a/src/qchart.cpp b/src/qchart.cpp index ab80291..8b3a3e2 100644 --- a/src/qchart.cpp +++ b/src/qchart.cpp @@ -1,6 +1,7 @@ #include "qchart.h" #include "qchartseries.h" #include "xylinechartitem_p.h" +#include "xyplotdata_p.h" #include "axis_p.h" #include "xygrid_p.h" #include @@ -18,19 +19,21 @@ m_plotDataIndex(0) // set axis m_axisY->rotate(90); - XYPlotData data; - data.m_minX = 0.0; - data.m_maxX = 100.0; - data.m_minY = 0.0; - data.m_maxY = 100.0; - data.m_ticksX=4; - data.m_ticksY=4; + + //TODO hardcoded values , to removed soon + XYPlotData* data = new XYPlotData(); + data->m_minX = 0.0; + data->m_maxX = 100.0; + data->m_minY = 0.0; + data->m_maxY = 100.0; + data->m_ticksX=4; + data->m_ticksY=4; m_plotDataList.clear(); m_plotDataList << data; m_grid->setZValue(10); - m_grid->setXYPlotData(m_plotDataList.at(0)); + m_grid->setXYPlotData(*m_plotDataList.at(0)); } QChart::~QChart(){} @@ -47,9 +50,8 @@ void QChart::addSeries(QChartSeries* series) switch(series->type()) { case QChartSeries::LINE: - qDebug()<<"xyline added"; XYLineChartItem* item = new XYLineChartItem(reinterpret_cast(series),this); - item->setXYPlotData(m_plotDataList.at(0)); + item->setXYPlotData(*m_plotDataList.at(0)); m_items< -//TODO: temporary class -#include #include QCHART_BEGIN_NAMESPACE @@ -11,6 +9,7 @@ QCHART_BEGIN_NAMESPACE class Axis; class XYGrid; class QChartSeries; +class XYPlotData; class QCHART_EXPORT QChart : public QGraphicsItem { @@ -35,7 +34,7 @@ private: Axis* m_axisX; Axis* m_axisY; XYGrid* m_grid; - QList m_plotDataList; + QList m_plotDataList; QList m_items; int m_plotDataIndex; int m_marginSize; diff --git a/src/src.pro b/src/src.pro index e337848..b6cc1ae 100644 --- a/src/src.pro +++ b/src/src.pro @@ -16,6 +16,7 @@ SOURCES += \ PRIVATE_HEADERS += \ xylinechart/xylinechartitem_p.h \ + xylinechart/xyplotdata_p.h \# to be removed xylinechart/xygrid_p.h \ axis_p.h @@ -24,8 +25,7 @@ PUBLIC_HEADERS += \ qchart.h \ qchartwidget.h \ qchartconfig.h \ - xylinechart/qxychartseries.h \ - xylinechart/xyplotdata_p.h # to be removed + xylinechart/qxychartseries.h HEADERS += $$PUBLIC_HEADERS HEADERS += $$PRIVATE_HEADERS