From 698d88c3d4c137e36f15b37c39479b0d520bea44 2012-02-23 14:24:23 From: Marek Rosa Date: 2012-02-23 14:24:23 Subject: [PATCH] Spline initial --- diff --git a/src/chartpresenter.cpp b/src/chartpresenter.cpp index 06ea2a1..18282f7 100644 --- a/src/chartpresenter.cpp +++ b/src/chartpresenter.cpp @@ -10,6 +10,7 @@ #include "qlinechartseries.h" #include "qpieseries.h" #include "qscatterseries.h" +#include "qsplineseries.h" //items #include "axisitem_p.h" #include "barpresenter.h" @@ -19,6 +20,7 @@ #include "linechartanimationitem_p.h" #include "piepresenter.h" #include "scatterpresenter_p.h" +#include "splinepresenter_p.h" QTCOMMERCIALCHART_BEGIN_NAMESPACE @@ -162,6 +164,11 @@ void ChartPresenter::handleSeriesAdded(QChartSeries* series) m_chartItems.insert(series, pie); break; } + case QChartSeries::SeriesTypeSpline: { + QSplineSeries* splineSeries = qobject_cast(series); + SplinePresenter* splinePresenter = new SplinePresenter + break; + } default: { qDebug()<< "Series type" << series->type() << "not implemented."; break; diff --git a/src/qchartseries.h b/src/qchartseries.h index ef07c1e..69c63d0 100644 --- a/src/qchartseries.h +++ b/src/qchartseries.h @@ -19,8 +19,8 @@ public: SeriesTypeStackedBar, SeriesTypePercentBar, SeriesTypePie, - SeriesTypeScatter -// SeriesTypeSpline + SeriesTypeScatter, + SeriesTypeSpline }; protected: diff --git a/src/splinechart/qsplineseries.cpp b/src/splinechart/qsplineseries.cpp new file mode 100644 index 0000000..6f2b975 --- /dev/null +++ b/src/splinechart/qsplineseries.cpp @@ -0,0 +1,6 @@ +#include "qsplineseries.h" + +QSplineSeries::QSplineSeries(QObject *parent) : + QObject(parent) +{ +} diff --git a/src/splinechart/qsplineseries.h b/src/splinechart/qsplineseries.h new file mode 100644 index 0000000..9d8eb4b --- /dev/null +++ b/src/splinechart/qsplineseries.h @@ -0,0 +1,24 @@ +#ifndef QSPLINESERIES_H +#define QSPLINESERIES_H + +#include "qchartseries.h" + +QTCOMMERCIALCHART_BEGIN_NAMESPACE + +class QSplineSeries : public QChartSeries +{ + Q_OBJECT + public: + explicit QSplineSeries(QObject *parent = 0); + + public: // from QChartSeries + QChartSeriesType type() const { return QChartSeries::SeriesTypeSpline; } + signals: + + public slots: + +}; + +QTCOMMERCIALCHART_END_NAMESPACE + +#endif // QSPLINESERIES_H diff --git a/src/splinechart/splinechart.pri b/src/splinechart/splinechart.pri new file mode 100644 index 0000000..541dd82 --- /dev/null +++ b/src/splinechart/splinechart.pri @@ -0,0 +1,15 @@ +INCLUDEPATH += $$PWD +DEPENDPATH += $$PWD + +SOURCES += \ + $$PWD/qsplineseries.cpp \ + splinechart/splinepresenter.cpp + +PRIVATE_HEADERS += + +PUBLIC_HEADERS += \ + $$PWD/qsplineseries.h + +HEADERS += \ + splinechart/qsplineseries.h \ + splinechart/splinepresenter_p.h diff --git a/src/splinechart/splinepresenter.cpp b/src/splinechart/splinepresenter.cpp new file mode 100644 index 0000000..987000c --- /dev/null +++ b/src/splinechart/splinepresenter.cpp @@ -0,0 +1,16 @@ +#include "splinepresenter_p.h" + +SplinePresenter::SplinePresenter(QObject *parent) : + QObject(parent) +{ +} + +void SplinePresenter::handleGeometryChanged(const QRectF&) +{ + // +} + +void SplinePresenter::handleDomainChanged(const Domain& domain) +{ + // +} diff --git a/src/splinechart/splinepresenter_p.h b/src/splinechart/splinepresenter_p.h new file mode 100644 index 0000000..67595cd --- /dev/null +++ b/src/splinechart/splinepresenter_p.h @@ -0,0 +1,26 @@ +#ifndef SPLINEPRESENTER_P_H +#define SPLINEPRESENTER_P_H + +#include "chartitem_p.h" +#include + +QTCOMMERCIALCHART_BEGIN_NAMESPACE + +class SplinePresenter : public QObject, public ChartItem +{ + Q_OBJECT +public: + SplinePresenter(QObject *parent = 0); + + void handleGeometryChanged(const QRectF&); + void handleDomainChanged(const Domain& domain); + +signals: + +public slots: + +}; + +QTCOMMERCIALCHART_END_NAMESPACE + +#endif // SPLINEPRESENTER_P_H diff --git a/src/src.pro b/src/src.pro index e5ab3a2..b78d99e 100644 --- a/src/src.pro +++ b/src/src.pro @@ -15,7 +15,7 @@ SOURCES += \ qchart.cpp \ qchartaxis.cpp \ qchartseries.cpp \ - qchartview.cpp + qchartview.cpp PRIVATE_HEADERS += \ axisitem_p.h \ chartdataset_p.h \ @@ -34,6 +34,7 @@ include(linechart/linechart.pri) include(barchart/barchart.pri) include(piechart/piechart.pri) include(scatterseries/scatter.pri) +include(splinechart/splinechart.pri) THEMES += themes/chartthemeicy_p.h \ themes/chartthemegrayscale_p.h \ @@ -88,5 +89,5 @@ unix:QMAKE_DISTCLEAN += -r \ $$CHART_BUILD_LIB_DIR win32:QMAKE_DISTCLEAN += /Q \ $$CHART_BUILD_HEADER_DIR \ - $$CHART_BUILD_LIB_DIR + $$CHART_BUILD_LIB_DIR