@@ -1,5 +1,5 | |||||
1 |
#ifndef |
|
1 | #ifndef BARPRESENTER_H | |
2 |
#define |
|
2 | #define BARPRESENTER_H | |
3 |
|
3 | |||
4 | #include "barpresenterbase.h" |
|
4 | #include "barpresenterbase.h" | |
5 | #include "qbarchartseries.h" |
|
5 | #include "qbarchartseries.h" | |
@@ -16,7 +16,7 public: | |||||
16 |
|
16 | |||
17 | private: |
|
17 | private: | |
18 |
|
18 | |||
19 |
// From Bar |
|
19 | // From BarPresenterBase | |
20 | void layoutChanged(); // layout has changed -> need to recalculate bar sizes |
|
20 | void layoutChanged(); // layout has changed -> need to recalculate bar sizes | |
21 |
|
21 | |||
22 | private: |
|
22 | private: | |
@@ -25,4 +25,4 private: | |||||
25 |
|
25 | |||
26 | QTCOMMERCIALCHART_END_NAMESPACE |
|
26 | QTCOMMERCIALCHART_END_NAMESPACE | |
27 |
|
27 | |||
28 |
#endif // |
|
28 | #endif // BARPRESENTER_H |
@@ -46,17 +46,7 void BarPresenterBase::setBarWidth( int w ) | |||||
46 | { |
|
46 | { | |
47 | mBarDefaultWidth = w; |
|
47 | mBarDefaultWidth = w; | |
48 | } |
|
48 | } | |
49 | /* |
|
|||
50 | void BarGroupBase::resetBrushes() |
|
|||
51 | { |
|
|||
52 | mBrushes.clear(); |
|
|||
53 | } |
|
|||
54 |
|
49 | |||
55 | void BarGroupBase::addBrush(QBrush brush) |
|
|||
56 | { |
|
|||
57 | mBrushes.append(brush); |
|
|||
58 | } |
|
|||
59 | */ |
|
|||
60 | void BarPresenterBase::dataChanged() |
|
50 | void BarPresenterBase::dataChanged() | |
61 | { |
|
51 | { | |
62 | // TODO: performance optimizations. Do we really need to delete and create items every time data is changed or can we reuse them? |
|
52 | // TODO: performance optimizations. Do we really need to delete and create items every time data is changed or can we reuse them? |
@@ -1,5 +1,5 | |||||
1 |
#ifndef BAR |
|
1 | #ifndef BARPRESENTERBASE_H | |
2 |
#define BAR |
|
2 | #define BARPRESENTERBASE_H | |
3 |
|
3 | |||
4 | #include "chartitem_p.h" |
|
4 | #include "chartitem_p.h" | |
5 | #include "barchartmodel_p.h" |
|
5 | #include "barchartmodel_p.h" | |
@@ -26,16 +26,12 public: | |||||
26 | // TODO: these may change with layout awarness. |
|
26 | // TODO: these may change with layout awarness. | |
27 | void setBarWidth( int w ); |
|
27 | void setBarWidth( int w ); | |
28 |
|
28 | |||
29 | // void resetBrushes(); |
|
|||
30 | // void addBrush(QBrush brush); |
|
|||
31 |
|
||||
32 | void setPen(QPen pen); |
|
29 | void setPen(QPen pen); | |
33 | QPen pen(); |
|
30 | QPen pen(); | |
34 |
|
31 | |||
35 | void setBrush(QBrush brush); |
|
32 | void setBrush(QBrush brush); | |
36 | QBrush brush(); |
|
33 | QBrush brush(); | |
37 |
|
34 | |||
38 |
|
||||
39 | // TODO: Consider the domain for layoutChanged. May be use case, may not be. If it is, then the derived classes need to implement it |
|
35 | // TODO: Consider the domain for layoutChanged. May be use case, may not be. If it is, then the derived classes need to implement it | |
40 | virtual void dataChanged(); // data of series has changed -> need to recalculate bar sizes |
|
36 | virtual void dataChanged(); // data of series has changed -> need to recalculate bar sizes | |
41 | virtual void layoutChanged() = 0; // layout has changed -> need to recalculate bar sizes |
|
37 | virtual void layoutChanged() = 0; // layout has changed -> need to recalculate bar sizes | |
@@ -60,9 +56,8 protected: | |||||
60 | BarChartModel& mModel; |
|
56 | BarChartModel& mModel; | |
61 |
|
57 | |||
62 | QPen mPen; |
|
58 | QPen mPen; | |
63 | // QList<QBrush> mBrushes; |
|
|||
64 | }; |
|
59 | }; | |
65 |
|
60 | |||
66 | QTCOMMERCIALCHART_END_NAMESPACE |
|
61 | QTCOMMERCIALCHART_END_NAMESPACE | |
67 |
|
62 | |||
68 |
#endif // BAR |
|
63 | #endif // BARPRESENTERBASE_H |
@@ -1,5 +1,5 | |||||
1 |
#ifndef PERCENTBAR |
|
1 | #ifndef PERCENTBARPRESENTER_H | |
2 |
#define PERCENTBAR |
|
2 | #define PERCENTBARPRESENTER_H | |
3 |
|
3 | |||
4 | #include "chartitem_p.h" |
|
4 | #include "chartitem_p.h" | |
5 | #include "bar_p.h" |
|
5 | #include "bar_p.h" | |
@@ -25,4 +25,4 private: | |||||
25 |
|
25 | |||
26 | QTCOMMERCIALCHART_END_NAMESPACE |
|
26 | QTCOMMERCIALCHART_END_NAMESPACE | |
27 |
|
27 | |||
28 |
#endif // PERCENTBAR |
|
28 | #endif // PERCENTBARPRESENTER_H |
@@ -9,7 +9,6 QTCOMMERCIALCHART_BEGIN_NAMESPACE | |||||
9 |
|
9 | |||
10 | class QBarCategory; |
|
10 | class QBarCategory; | |
11 | class QBarSet; |
|
11 | class QBarSet; | |
12 | class BarPresenter; |
|
|||
13 | class BarChartModel; |
|
12 | class BarChartModel; | |
14 |
|
13 | |||
15 | // Container for series |
|
14 | // Container for series | |
@@ -46,9 +45,7 public Q_SLOTS: | |||||
46 |
|
45 | |||
47 | private: |
|
46 | private: | |
48 |
|
47 | |||
49 | BarPresenter* mBarGroup; |
|
|||
50 | BarChartModel* mModel; |
|
48 | BarChartModel* mModel; | |
51 |
|
||||
52 | }; |
|
49 | }; | |
53 |
|
50 | |||
54 | QTCOMMERCIALCHART_END_NAMESPACE |
|
51 | QTCOMMERCIALCHART_END_NAMESPACE |
@@ -7,7 +7,6 | |||||
7 |
|
7 | |||
8 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
8 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
9 |
|
9 | |||
10 | class PercentBarPresenter; |
|
|||
11 | class QBarCategory; |
|
10 | class QBarCategory; | |
12 | class QBarSet; |
|
11 | class QBarSet; | |
13 | class BarChartModel; |
|
12 | class BarChartModel; | |
@@ -47,7 +46,6 public Q_SLOTS: | |||||
47 |
|
46 | |||
48 | private: |
|
47 | private: | |
49 |
|
48 | |||
50 | PercentBarPresenter* mPercentBarGroup; |
|
|||
51 | BarChartModel* mModel; |
|
49 | BarChartModel* mModel; | |
52 |
|
50 | |||
53 | }; |
|
51 | }; |
@@ -7,7 +7,6 | |||||
7 |
|
7 | |||
8 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
8 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
9 |
|
9 | |||
10 | class StackedBarPresenter; |
|
|||
11 | class QBarCategory; |
|
10 | class QBarCategory; | |
12 | class QBarSet; |
|
11 | class QBarSet; | |
13 | class BarChartModel; |
|
12 | class BarChartModel; | |
@@ -46,7 +45,6 public Q_SLOTS: | |||||
46 |
|
45 | |||
47 | private: |
|
46 | private: | |
48 |
|
47 | |||
49 | StackedBarPresenter* mStackedBarGroup; |
|
|||
50 | BarChartModel* mModel; |
|
48 | BarChartModel* mModel; | |
51 | }; |
|
49 | }; | |
52 |
|
50 |
@@ -38,6 +38,10 PRIVATE_HEADERS += linechart/linechartitem_p.h \ | |||||
38 | barchart/bar_p.h \ |
|
38 | barchart/bar_p.h \ | |
39 | barchart/separator_p.h \ |
|
39 | barchart/separator_p.h \ | |
40 | barchart/barchartmodel_p.h \ |
|
40 | barchart/barchartmodel_p.h \ | |
|
41 | barchart/barpresenter.h \ | |||
|
42 | barchart/stackedbarpresenter.h \ | |||
|
43 | barchart/percentbarpresenter.h \ | |||
|
44 | barchart/barpresenterbase.h \ | |||
41 | axisitem_p.h \ |
|
45 | axisitem_p.h \ | |
42 | chartitem_p.h \ |
|
46 | chartitem_p.h \ | |
43 | charttheme_p.h \ |
|
47 | charttheme_p.h \ | |
@@ -46,12 +50,8 PRIVATE_HEADERS += linechart/linechartitem_p.h \ | |||||
46 | domain_p.h |
|
50 | domain_p.h | |
47 | PUBLIC_HEADERS += linechart/qlinechartseries.h \ |
|
51 | PUBLIC_HEADERS += linechart/qlinechartseries.h \ | |
48 | barchart/qbarchartseries.h \ |
|
52 | barchart/qbarchartseries.h \ | |
49 | barchart/barpresenter.h \ |
|
|||
50 | barchart/qstackedbarchartseries.h \ |
|
53 | barchart/qstackedbarchartseries.h \ | |
51 | barchart/stackedbarpresenter.h \ |
|
|||
52 | barchart/qpercentbarchartseries.h \ |
|
54 | barchart/qpercentbarchartseries.h \ | |
53 | barchart/percentbarpresenter.h \ |
|
|||
54 | barchart/barpresenterbase.h \ |
|
|||
55 | barchart/qbarset.h \ |
|
55 | barchart/qbarset.h \ | |
56 | barchart/qbarcategory.h \ |
|
56 | barchart/qbarcategory.h \ | |
57 | qchartseries.h \ |
|
57 | qchartseries.h \ |
General Comments 0
You need to be logged in to leave comments.
Login now