chartpresenter_p.h
67 lines
| 1.7 KiB
| text/x-c
|
CLexer
/ src / chartpresenter_p.h
|
r131 | #ifndef CHARTPRESENTER_H_ | ||
#define CHARTPRESENTER_H_ | ||||
#include "qchartglobal.h" | ||||
|
r143 | #include "qchart.h" //becouse of QChart::ChartThemeId //TODO | ||
|
r176 | #include "qchartaxis.h" | ||
|
r131 | #include <QRectF> | ||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
class ChartItem; | ||||
|
r360 | class QSeries; | ||
|
r131 | class ChartDataSet; | ||
|
r143 | //class QChart; | ||
|
r131 | class Domain; | ||
|
r140 | class AxisItem; | ||
|
r143 | class ChartTheme; | ||
|
r131 | |||
class ChartPresenter: public QObject | ||||
{ | ||||
Q_OBJECT | ||||
public: | ||||
|
r262 | enum ZValues { BackgroundZValue = -1 , ShadesZValue, GridZValue, AxisZValue , LineChartZValue }; | ||
|
r131 | ChartPresenter(QChart* chart,ChartDataSet *dataset); | ||
virtual ~ChartPresenter(); | ||||
|
r139 | |||
void setMargin(int margin); | ||||
int margin() const; | ||||
|
r223 | QRectF geometry() const; | ||
|
r131 | |||
|
r153 | void setChartTheme(QChart::ChartTheme theme); | ||
QChart::ChartTheme chartTheme(); | ||||
|
r143 | |||
|
r298 | void setAnimationOptions(QChart::AnimationOptions options); | ||
QChart::AnimationOptions animationOptions() const; | ||||
|
r131 | private: | ||
|
r140 | void createConnections(); | ||
|
r131 | |||
public slots: | ||||
|
r360 | void handleSeriesAdded(QSeries* series); | ||
void handleSeriesRemoved(QSeries* series); | ||||
|
r223 | void handleAxisAdded(QChartAxis* axis); | ||
void handleAxisRemoved(QChartAxis* axis); | ||||
|
r360 | void handleSeriesDomainChanged(QSeries* series, const Domain& domain); | ||
|
r223 | void handleAxisLabelsChanged(QChartAxis* axis, const QStringList& labels); | ||
|
r360 | void handleSeriesChanged(QSeries* series); | ||
|
r131 | void handleGeometryChanged(); | ||
|
r139 | signals: | ||
void geometryChanged(const QRectF& rect); | ||||
|
r131 | private: | ||
|
r360 | QMap<QSeries*,ChartItem*> m_chartItems; | ||
|
r223 | QMap<QChartAxis*,AxisItem*> m_axisItems; | ||
|
r131 | QChart* m_chart; | ||
ChartDataSet* m_dataset; | ||||
|
r143 | ChartTheme *m_chartTheme; | ||
|
r139 | int m_marginSize; | ||
|
r131 | QRectF m_rect; | ||
|
r298 | QChart::AnimationOptions m_options; | ||
|
r143 | |||
|
r131 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
#endif /* CHARTPRESENTER_H_ */ | ||||