chartpresenter_p.h
85 lines
| 1.9 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; | ||
class Domain; | ||||
|
r140 | class AxisItem; | ||
|
r143 | class ChartTheme; | ||
|
r530 | class ChartAnimator; | ||
|
r131 | |||
class ChartPresenter: public QObject | ||||
{ | ||||
Q_OBJECT | ||||
public: | ||||
|
r375 | enum ZValues { | ||
BackgroundZValue = -1, | ||||
ShadesZValue, | ||||
GridZValue, | ||||
AxisZValue, | ||||
LineChartZValue, | ||||
|
r490 | ScatterSeriesZValue, | ||
|
r540 | PieSeriesZValue, | ||
LegendZValue | ||||
|
r375 | }; | ||
|
r262 | |||
|
r131 | ChartPresenter(QChart* chart,ChartDataSet *dataset); | ||
virtual ~ChartPresenter(); | ||||
|
r139 | |||
void setMargin(int margin); | ||||
int margin() const; | ||||
|
r223 | QRectF geometry() const; | ||
|
r530 | ChartAnimator* animator() const {return m_animator;}; | ||
|
r131 | |||
|
r153 | void setChartTheme(QChart::ChartTheme theme); | ||
QChart::ChartTheme chartTheme(); | ||||
|
r143 | |||
|
r298 | void setAnimationOptions(QChart::AnimationOptions options); | ||
QChart::AnimationOptions animationOptions() const; | ||||
|
r439 | void zoomIn(); | ||
void zoomIn(const QRectF& rect); | ||||
void zoomOut(); | ||||
void zoomReset(); | ||||
|
r531 | void scroll(int dx,int dy); | ||
|
r131 | private: | ||
|
r140 | void createConnections(); | ||
|
r531 | void resetAllElements(); | ||
|
r131 | |||
public slots: | ||||
|
r439 | void handleSeriesAdded(QSeries* series,Domain* domain); | ||
|
r360 | void handleSeriesRemoved(QSeries* series); | ||
|
r439 | void handleAxisAdded(QChartAxis* axis,Domain* domain); | ||
|
r223 | void handleAxisRemoved(QChartAxis* axis); | ||
|
r131 | void handleGeometryChanged(); | ||
|
r439 | |||
|
r139 | signals: | ||
void geometryChanged(const QRectF& rect); | ||||
|
r439 | |||
|
r131 | private: | ||
QChart* m_chart; | ||||
|
r530 | ChartAnimator* m_animator; | ||
|
r131 | ChartDataSet* m_dataset; | ||
|
r143 | ChartTheme *m_chartTheme; | ||
|
r439 | int m_zoomIndex; | ||
|
r139 | int m_marginSize; | ||
|
r439 | QMap<QSeries*,ChartItem*> m_chartItems; | ||
QMap<QChartAxis*,AxisItem*> m_axisItems; | ||||
QVector<QRectF> m_zoomStack; | ||||
|
r131 | QRectF m_rect; | ||
|
r298 | QChart::AnimationOptions m_options; | ||
|
r143 | |||
|
r131 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
#endif /* CHARTPRESENTER_H_ */ | ||||