@@ -35,11 +35,7 QTCOMMERCIALCHART_USE_NAMESPACE | |||||
35 | class Chart |
|
35 | class Chart | |
36 | { |
|
36 | { | |
37 | public: |
|
37 | public: | |
38 | Chart(); |
|
38 | virtual ~Chart(){}; | |
39 |
|
||||
40 | virtual ~Chart(); |
|
|||
41 |
|
||||
42 | virtual void initialize(); |
|
|||
43 | virtual QChart* createChart(const DataTable& table) = 0; |
|
39 | virtual QChart* createChart(const DataTable& table) = 0; | |
44 | virtual QString name() = 0; |
|
40 | virtual QString name() = 0; | |
45 | virtual QString category() = 0; |
|
41 | virtual QString category() = 0; | |
@@ -81,6 +77,17 inline void addChart(Chart* chart) | |||||
81 | } |
|
77 | } | |
82 | } |
|
78 | } | |
83 |
|
79 | |||
84 | #define DECLARE_CHART(chartName) static chartName t; |
|
80 | template <class T> | |
|
81 | class ChartWrapper | |||
|
82 | { | |||
|
83 | public: | |||
|
84 | QSharedPointer<T> chart; | |||
|
85 | ChartWrapper() : chart(new T) | |||
|
86 | { | |||
|
87 | Charts::addChart(chart.data()); | |||
|
88 | } | |||
|
89 | }; | |||
|
90 | ||||
|
91 | #define DECLARE_CHART(chartName) static ChartWrapper<chartName> t; | |||
85 |
|
92 | |||
86 | #endif |
|
93 | #endif |
@@ -26,11 +26,6 | |||||
26 | class AreaChart: public Chart |
|
26 | class AreaChart: public Chart | |
27 | { |
|
27 | { | |
28 | public: |
|
28 | public: | |
29 |
|
||||
30 | AreaChart(){ |
|
|||
31 | initialize(); |
|
|||
32 | } |
|
|||
33 |
|
||||
34 | QString name() { return QObject::tr("AreaChart"); } |
|
29 | QString name() { return QObject::tr("AreaChart"); } | |
35 | QString category() { return QObject::tr("XYSeries"); } |
|
30 | QString category() { return QObject::tr("XYSeries"); } | |
36 | QString subCategory() { return QString::null; } |
|
31 | QString subCategory() { return QString::null; } |
@@ -26,11 +26,6 | |||||
26 | class HorizontalBarChart: public Chart |
|
26 | class HorizontalBarChart: public Chart | |
27 | { |
|
27 | { | |
28 | public: |
|
28 | public: | |
29 |
|
||||
30 | HorizontalBarChart(){ |
|
|||
31 | initialize(); |
|
|||
32 | } |
|
|||
33 |
|
||||
34 | QString name() { return QObject::tr("HorizontalBarChart"); } |
|
29 | QString name() { return QObject::tr("HorizontalBarChart"); } | |
35 | QString category() { return QObject::tr("BarSeries"); } |
|
30 | QString category() { return QObject::tr("BarSeries"); } | |
36 | QString subCategory() { return QObject::tr("Vertical"); } |
|
31 | QString subCategory() { return QObject::tr("Vertical"); } |
@@ -26,11 +26,6 | |||||
26 | class HorizontalStackedBarChart: public Chart |
|
26 | class HorizontalStackedBarChart: public Chart | |
27 | { |
|
27 | { | |
28 | public: |
|
28 | public: | |
29 |
|
||||
30 | HorizontalStackedBarChart(){ |
|
|||
31 | initialize(); |
|
|||
32 | } |
|
|||
33 |
|
||||
34 | QString name() { return QObject::tr("HorizontalStackedBarChart"); } |
|
29 | QString name() { return QObject::tr("HorizontalStackedBarChart"); } | |
35 | QString category() { return QObject::tr("BarSeries"); } |
|
30 | QString category() { return QObject::tr("BarSeries"); } | |
36 | QString subCategory() { return QObject::tr("Vertical"); } |
|
31 | QString subCategory() { return QObject::tr("Vertical"); } |
@@ -25,11 +25,6 | |||||
25 | class LineChart: public Chart |
|
25 | class LineChart: public Chart | |
26 | { |
|
26 | { | |
27 | public: |
|
27 | public: | |
28 |
|
||||
29 | LineChart(){ |
|
|||
30 | initialize(); |
|
|||
31 | } |
|
|||
32 |
|
||||
33 | QString name() { return QObject::tr("LineChart"); } |
|
28 | QString name() { return QObject::tr("LineChart"); } | |
34 | QString category() { return QObject::tr("XYSeries"); } |
|
29 | QString category() { return QObject::tr("XYSeries"); } | |
35 | QString subCategory() { return QString::null; } |
|
30 | QString subCategory() { return QString::null; } |
@@ -25,11 +25,6 | |||||
25 | class PieChart: public Chart |
|
25 | class PieChart: public Chart | |
26 | { |
|
26 | { | |
27 | public: |
|
27 | public: | |
28 |
|
||||
29 | PieChart(){ |
|
|||
30 | initialize(); |
|
|||
31 | } |
|
|||
32 |
|
||||
33 | QString name() { return QObject::tr("PieChart"); } |
|
28 | QString name() { return QObject::tr("PieChart"); } | |
34 | QString category() { return QString::null; } |
|
29 | QString category() { return QString::null; } | |
35 | QString subCategory() { return QString::null; } |
|
30 | QString subCategory() { return QString::null; } |
@@ -25,11 +25,6 | |||||
25 | class ScatterChart: public Chart |
|
25 | class ScatterChart: public Chart | |
26 | { |
|
26 | { | |
27 | public: |
|
27 | public: | |
28 |
|
||||
29 | ScatterChart(){ |
|
|||
30 | initialize(); |
|
|||
31 | } |
|
|||
32 |
|
||||
33 | QString name() { return QObject::tr("ScatterChart"); } |
|
28 | QString name() { return QObject::tr("ScatterChart"); } | |
34 | QString category() { return QObject::tr("XYSeries"); } |
|
29 | QString category() { return QObject::tr("XYSeries"); } | |
35 | QString subCategory() { return QString::null; } |
|
30 | QString subCategory() { return QString::null; } |
@@ -25,11 +25,6 | |||||
25 | class SplineChart: public Chart |
|
25 | class SplineChart: public Chart | |
26 | { |
|
26 | { | |
27 | public: |
|
27 | public: | |
28 |
|
||||
29 | SplineChart(){ |
|
|||
30 | initialize(); |
|
|||
31 | } |
|
|||
32 |
|
||||
33 | QString name() { return QObject::tr("SplineChart"); } |
|
28 | QString name() { return QObject::tr("SplineChart"); } | |
34 | QString category() { return QObject::tr("XYSeries"); } |
|
29 | QString category() { return QObject::tr("XYSeries"); } | |
35 | QString subCategory() { return QString::null; } |
|
30 | QString subCategory() { return QString::null; } |
@@ -26,11 +26,6 | |||||
26 | class VerticalBarChart: public Chart |
|
26 | class VerticalBarChart: public Chart | |
27 | { |
|
27 | { | |
28 | public: |
|
28 | public: | |
29 |
|
||||
30 | VerticalBarChart(){ |
|
|||
31 | initialize(); |
|
|||
32 | } |
|
|||
33 |
|
||||
34 | QString name() { return QObject::tr("VerticalBarChart"); } |
|
29 | QString name() { return QObject::tr("VerticalBarChart"); } | |
35 | QString category() { return QObject::tr("BarSeries"); } |
|
30 | QString category() { return QObject::tr("BarSeries"); } | |
36 | QString subCategory() { return QObject::tr("Vertical"); } |
|
31 | QString subCategory() { return QObject::tr("Vertical"); } |
@@ -26,11 +26,6 | |||||
26 | class VerticalStackedBarChart: public Chart |
|
26 | class VerticalStackedBarChart: public Chart | |
27 | { |
|
27 | { | |
28 | public: |
|
28 | public: | |
29 |
|
||||
30 | VerticalStackedBarChart(){ |
|
|||
31 | initialize(); |
|
|||
32 | } |
|
|||
33 |
|
||||
34 | QString name() { return QObject::tr("VerticalStackedBarChart"); } |
|
29 | QString name() { return QObject::tr("VerticalStackedBarChart"); } | |
35 | QString category() { return QObject::tr("BarSeries"); } |
|
30 | QString category() { return QObject::tr("BarSeries"); } | |
36 | QString subCategory() { return QObject::tr("Vertical"); } |
|
31 | QString subCategory() { return QObject::tr("Vertical"); } |
@@ -3,6 +3,6 include(charts/charts.pri) | |||||
3 | TARGET = chartviewer |
|
3 | TARGET = chartviewer | |
4 | QT += opengl |
|
4 | QT += opengl | |
5 | INCLUDEPATH += . |
|
5 | INCLUDEPATH += . | |
6 |
SOURCES += main.cpp window.cpp view.cpp |
|
6 | SOURCES += main.cpp window.cpp view.cpp | |
7 | HEADERS += window.h view.h charts.h model.h |
|
7 | HEADERS += window.h view.h charts.h model.h | |
8 |
|
8 |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now