charttheme_p.h
71 lines
| 2.2 KiB
| text/x-c
|
CLexer
/ src / charttheme_p.h
|
r103 | #ifndef CHARTTHEME_H | ||
#define CHARTTHEME_H | ||||
#include "qchartglobal.h" | ||||
|
r143 | #include "qchart.h" | ||
|
r103 | #include <QColor> | ||
|
r494 | #include <QGradientStops> | ||
|
r103 | |||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
|
r143 | class ChartItem; | ||
|
r360 | class QSeries; | ||
|
r145 | class LineChartItem; | ||
|
r349 | class QLineSeries; | ||
|
r216 | class BarPresenter; | ||
|
r338 | class QBarSeries; | ||
|
r216 | class StackedBarPresenter; | ||
|
r338 | class QStackedBarSeries; | ||
class QPercentBarSeries; | ||||
|
r216 | class PercentBarPresenter; | ||
|
r182 | class QScatterSeries; | ||
|
r470 | class ScatterChartItem; | ||
|
r163 | class PiePresenter; | ||
class QPieSeries; | ||||
|
r460 | class SplineChartItem; | ||
|
r401 | class QSplineSeries; | ||
|
r421 | class AreaChartItem; | ||
class QAreaSeries; | ||||
|
r143 | |||
class ChartTheme | ||||
|
r103 | { | ||
|
r143 | protected: | ||
|
r153 | explicit ChartTheme(QChart::ChartTheme id = QChart::ChartThemeDefault); | ||
|
r103 | public: | ||
|
r153 | static ChartTheme* createTheme(QChart::ChartTheme theme); | ||
QChart::ChartTheme id() const {return m_id;} | ||||
|
r143 | void decorate(QChart* chart); | ||
|
r360 | void decorate(ChartItem* item, QSeries* series,int count); | ||
|
r338 | void decorate(BarPresenter* item, QBarSeries* series,int count); | ||
void decorate(StackedBarPresenter* item, QStackedBarSeries* series,int count); | ||||
void decorate(PercentBarPresenter* item, QPercentBarSeries* series,int count); | ||||
|
r421 | void decorate(LineChartItem* item, QLineSeries* series,int count); | ||
void decorate(AreaChartItem* item, QAreaSeries* series,int count); | ||||
|
r470 | void decorate(ScatterChartItem* presenter, QScatterSeries* series, int count); | ||
|
r163 | void decorate(PiePresenter* item, QPieSeries* series, int count); | ||
|
r223 | void decorate(QChartAxis* axis,AxisItem* item); | ||
|
r460 | void decorate(SplineChartItem* presenter, QSplineSeries* series, int count); | ||
|
r143 | |||
|
r494 | public: // utils | ||
|
r507 | void generateSeriesGradients(); | ||
|
r494 | static QColor colorAt(const QColor &start, const QColor &end, qreal pos); | ||
static QColor colorAt(const QGradient &gradient, qreal pos); | ||||
|
r143 | protected: | ||
|
r153 | QChart::ChartTheme m_id; | ||
|
r494 | QList<QColor> m_seriesColors; | ||
QList<QGradient> m_seriesGradients; | ||||
QLinearGradient m_backgroundGradient; | ||||
|
r507 | |||
// TODO: Add something like the following to themes: | ||||
// QPen axisLinePen; | ||||
// QPen backgroundHorizontalGridPen; | ||||
// QPen backgroundVerticalGridPen; | ||||
// // FillAll, FillEverySecondRow, FillEverySecondColumn, FillEverySecondRowAndColumn, FillNone | ||||
// int backgroundType; | ||||
// QFont masterFont; | ||||
|
r103 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
#endif // CHARTTHEME_H | ||||