##// END OF EJS Templates
Adds missing ids to theme classes
Michal Klocek -
r153:04be7b528347
parent child
Show More
@@ -28,7 +28,7 m_domainIndex(0),
28 28 m_marginSize(0),
29 29 m_rect(QRectF(QPoint(0,0),m_chart->size()))
30 30 {
31 setTheme(QChart::ChartThemeDefault);
31 setChartTheme(QChart::ChartThemeDefault);
32 32 createConnections();
33 33 createDeafultAxis();
34 34 }
@@ -203,7 +203,7 void ChartPresenter::zoomReset()
203 203 m_dataset->clearDomains();
204 204 }
205 205
206 void ChartPresenter::setTheme(QChart::ChartThemeId theme)
206 void ChartPresenter::setChartTheme(QChart::ChartTheme theme)
207 207 {
208 208 delete m_chartTheme;
209 209
@@ -221,9 +221,19 void ChartPresenter::setTheme(QChart::ChartThemeId theme)
221 221 }
222 222
223 223
224 QChart::ChartThemeId ChartPresenter::theme()
224 QChart::ChartTheme ChartPresenter::chartTheme()
225 225 {
226 return (QChart::ChartThemeId) 0;
226 return m_chartTheme->id();
227 }
228
229 void ChartPresenter::setAxisX(QChartAxis* axis)
230 {
231
232 }
233
234 void ChartPresenter::addAxisY(QChartAxis* axis)
235 {
236
227 237 }
228 238
229 239 /*
@@ -21,13 +21,6 class ChartPresenter: public QObject
21 21 public:
22 22 ChartPresenter(QChart* chart,ChartDataSet *dataset);
23 23 virtual ~ChartPresenter();
24 /*
25 void setAxisX(const QChartAxis& axis);
26 void setAxisY(const QChartAxis& axis);
27 void setAxisY(const QList<QChartAxis>& axis);
28
29
30 */
31 24
32 25 void setMargin(int margin);
33 26 int margin() const;
@@ -37,9 +30,11 public:
37 30 void zoomOut();
38 31 void zoomReset();
39 32
40 void setTheme(QChart::ChartThemeId theme);
41 QChart::ChartThemeId theme();
33 void setChartTheme(QChart::ChartTheme theme);
34 QChart::ChartTheme chartTheme();
42 35
36 void setAxisX(QChartAxis* axis);
37 void addAxisY(QChartAxis* axis);
43 38 private:
44 39 void createConnections();
45 40 void createDeafultAxis();
@@ -35,8 +35,9 QTCOMMERCIALCHART_BEGIN_NAMESPACE
35 35 m_gradientEndColor = QColor(QRgb(0xffafafaf));
36 36 */
37 37
38 ChartTheme::ChartTheme()
38 ChartTheme::ChartTheme(QChart::ChartTheme id)
39 39 {
40 m_id = id;
40 41 m_seriesColor.append(QRgb(0xff000000));
41 42 m_seriesColor.append(QRgb(0xff707070));
42 43 m_gradientStartColor = QColor(QRgb(0xffffffff));
@@ -44,7 +45,7 ChartTheme::ChartTheme()
44 45 }
45 46
46 47
47 ChartTheme* ChartTheme::createTheme(QChart::ChartThemeId theme)
48 ChartTheme* ChartTheme::createTheme(QChart::ChartTheme theme)
48 49 {
49 50 switch(theme) {
50 51 case QChart::ChartThemeDefault:
@@ -21,9 +21,10 class PercentBarGroup;
21 21 class ChartTheme
22 22 {
23 23 protected:
24 explicit ChartTheme();
24 explicit ChartTheme(QChart::ChartTheme id = QChart::ChartThemeDefault);
25 25 public:
26 static ChartTheme* createTheme(QChart::ChartThemeId theme);
26 static ChartTheme* createTheme(QChart::ChartTheme theme);
27 QChart::ChartTheme id() const {return m_id;}
27 28 void decorate(QChart* chart);
28 29 void decorate(ChartItem* item, QChartSeries* series,int count);
29 30 void decorate(LineChartItem* item, QLineChartSeries*, int count);
@@ -32,6 +33,7 public:
32 33 void decorate(PercentBarGroup* item, PercentBarChartSeries* series,int count);
33 34
34 35 protected:
36 QChart::ChartTheme m_id;
35 37 QColor m_gradientStartColor;
36 38 QColor m_gradientEndColor;
37 39 QList<QColor> m_seriesColor;
@@ -115,14 +115,14 void QChart::setMargin(int margin)
115 115 m_presenter->setMargin(margin);
116 116 }
117 117
118 void QChart::setTheme(QChart::ChartThemeId theme)
118 void QChart::setChartTheme(QChart::ChartTheme theme)
119 119 {
120 m_presenter->setTheme(theme);
120 m_presenter->setChartTheme(theme);
121 121 }
122 122
123 QChart::ChartThemeId QChart::theme()
123 QChart::ChartTheme QChart::chartTheme() const
124 124 {
125 return m_presenter->theme();
125 return m_presenter->chartTheme();
126 126 }
127 127
128 128 void QChart::zoomInToRect(const QRectF& rectangle)
@@ -145,23 +145,13 void QChart::zoomReset()
145 145 m_presenter->zoomReset();
146 146 }
147 147
148 void QChart::setAxisX(const QChartAxis& axis)
148 void QChart::setAxisX(QChartAxis* axis)
149 149 {
150
150 m_presenter->setAxisX(axis);
151 151 }
152 void QChart::setAxisY(const QChartAxis& axis)
153 {
154
155 }
156
157 void QChart::setAxisY(const QList<QChartAxis>& axis)
152 void QChart::addAxisY(QChartAxis* axis)
158 153 {
159 //TODO not implemented
160 }
161
162 void QChart::setAxis(AxisItem *item, const QChartAxis& axis)
163 {
164
154 m_presenter->addAxisY(axis);
165 155 }
166 156
167 157 void QChart::resizeEvent(QGraphicsSceneResizeEvent *event)
@@ -33,8 +33,7 class QTCOMMERCIALCHART_EXPORT QChart : public QGraphicsWidget
33 33 {
34 34 Q_OBJECT
35 35 public:
36 enum ChartThemeId {
37 ChartThemeInvalid = -1,
36 enum ChartTheme {
38 37 /*! The default theme follows the GUI style of the Operating System */
39 38 ChartThemeDefault,
40 39 ChartThemeVanilla,
@@ -56,8 +55,8 public:
56 55
57 56 void setMargin(int margin);
58 57 int margin() const;
59 void setTheme(QChart::ChartThemeId theme);
60 QChart::ChartThemeId theme();
58 void setChartTheme(QChart::ChartTheme theme);
59 QChart::ChartTheme chartTheme() const;
61 60
62 61 void setTitle(const QString& title,const QFont& font = QFont());
63 62 void setChartBackgroundBrush(const QBrush& brush);
@@ -68,9 +67,8 public:
68 67 void zoomOut();
69 68 void zoomReset();
70 69
71 void setAxisX(const QChartAxis& axis);
72 void setAxisY(const QChartAxis& axis);
73 void setAxisY(const QList<QChartAxis>& axis);
70 void setAxisX(QChartAxis* axis);
71 void addAxisY(QChartAxis* axis);
74 72
75 73 protected:
76 74 void resizeEvent(QGraphicsSceneResizeEvent *event);
@@ -189,10 +189,14 void QChartView::keyPressEvent(QKeyEvent *event)
189 189 }
190 190 }
191 191
192 void QChartView::setTheme(QChart::ChartThemeId theme)
192 void QChartView::setChartTheme(QChart::ChartTheme theme)
193 193 {
194 m_chart->setTheme(theme);
194 m_chart->setChartTheme(theme);
195 195 }
196 196
197 QChart::ChartTheme QChartView::chartTheme() const
198 {
199 return m_chart->chartTheme();
200 }
197 201
198 202 QTCOMMERCIALCHART_END_NAMESPACE
@@ -42,7 +42,8 public:
42 42 void setRubberBandPolicy(const RubberBandPolicy );
43 43 RubberBandPolicy rubberBandPolicy() const;
44 44
45 void setTheme(QChart::ChartThemeId theme);
45 void setChartTheme(QChart::ChartTheme theme);
46 QChart::ChartTheme chartTheme() const;
46 47
47 48 protected:
48 49 void mousePressEvent(QMouseEvent *event);
@@ -5,7 +5,7 QTCOMMERCIALCHART_BEGIN_NAMESPACE
5 5 class ChartThemeGrayscale: public ChartTheme
6 6 {
7 7 public:
8 ChartThemeGrayscale()
8 ChartThemeGrayscale():ChartTheme(QChart::ChartThemeGrayscale)
9 9 {
10 10 m_seriesColor.append(QRgb(0xFF869299));
11 11 m_seriesColor.append(QRgb(0xFFA5BDCC));
@@ -5,7 +5,7 QTCOMMERCIALCHART_BEGIN_NAMESPACE
5 5 class ChartThemeIcy: public ChartTheme
6 6 {
7 7 public:
8 ChartThemeIcy()
8 ChartThemeIcy():ChartTheme(QChart::ChartThemeIcy)
9 9 {
10 10 m_seriesColor.append(QRgb(0xFF0D2673));
11 11 m_seriesColor.append(QRgb(0xFF2685BF));
@@ -5,7 +5,7 QTCOMMERCIALCHART_BEGIN_NAMESPACE
5 5 class ChartThemeScientific: public ChartTheme
6 6 {
7 7 public:
8 ChartThemeScientific()
8 ChartThemeScientific():ChartTheme(QChart::ChartThemeScientific)
9 9 {
10 10 m_seriesColor.append(QRgb(0xFF000000));
11 11 m_seriesColor.append(QRgb(0xFFFFAD00));
@@ -5,7 +5,7 QTCOMMERCIALCHART_BEGIN_NAMESPACE
5 5 class ChartThemeVanilla: public ChartTheme
6 6 {
7 7 public:
8 ChartThemeVanilla()
8 ChartThemeVanilla():ChartTheme(QChart::ChartThemeVanilla)
9 9 {
10 10 m_seriesColor.append(QColor(217, 197, 116));
11 11 m_seriesColor.append(QColor(214, 168, 150));
General Comments 0
You need to be logged in to leave comments. Login now