chartpresenter_p.h
76 lines
| 1.8 KiB
| text/x-c
|
CLexer
/ src / chartpresenter_p.h
Michal Klocek
|
r131 | #ifndef CHARTPRESENTER_H_ | ||
#define CHARTPRESENTER_H_ | ||||
#include "qchartglobal.h" | ||||
Michal Klocek
|
r143 | #include "qchart.h" //becouse of QChart::ChartThemeId //TODO | ||
Michal Klocek
|
r176 | #include "qchartaxis.h" | ||
Michal Klocek
|
r131 | #include <QRectF> | ||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
class ChartItem; | ||||
class QChartSeries; | ||||
class ChartDataSet; | ||||
Michal Klocek
|
r143 | //class QChart; | ||
Michal Klocek
|
r131 | class Domain; | ||
Michal Klocek
|
r140 | class AxisItem; | ||
Michal Klocek
|
r143 | class ChartTheme; | ||
Michal Klocek
|
r131 | |||
class ChartPresenter: public QObject | ||||
{ | ||||
Q_OBJECT | ||||
public: | ||||
ChartPresenter(QChart* chart,ChartDataSet *dataset); | ||||
virtual ~ChartPresenter(); | ||||
Michal Klocek
|
r139 | |||
void setMargin(int margin); | ||||
int margin() const; | ||||
void zoomInToRect(const QRectF& rectangle); | ||||
void zoomIn(); | ||||
void zoomOut(); | ||||
void zoomReset(); | ||||
Michal Klocek
|
r131 | |||
Michal Klocek
|
r153 | void setChartTheme(QChart::ChartTheme theme); | ||
QChart::ChartTheme chartTheme(); | ||||
Michal Klocek
|
r143 | |||
Michal Klocek
|
r176 | void setDefaultAxisX(const QChartAxis& axis); | ||
void setDefaultAxisY(const QChartAxis& axis); | ||||
QChartAxis defaultAxisX() const; | ||||
QChartAxis defaultAxisY() const; | ||||
QChartAxis axisY(int id) const; | ||||
int addAxisY(const QChartAxis& axis); | ||||
void removeAxisY(int id); | ||||
Michal Klocek
|
r155 | |||
Michal Klocek
|
r131 | private: | ||
Michal Klocek
|
r140 | void createConnections(); | ||
Michal Klocek
|
r131 | |||
public slots: | ||||
void handleSeriesAdded(QChartSeries* series); | ||||
void handleSeriesRemoved(QChartSeries* series){}; | ||||
void handleSeriesChanged(QChartSeries* series); | ||||
//void handleDomainChanged(Domain oldDomain,Domain newDomain); | ||||
void handleGeometryChanged(); | ||||
Michal Klocek
|
r139 | signals: | ||
void geometryChanged(const QRectF& rect); | ||||
Michal Klocek
|
r131 | private: | ||
QMap<QChartSeries*,ChartItem*> m_chartItems; | ||||
Michal Klocek
|
r176 | QMap<int,AxisItem*> m_axisItems; | ||
QMap<int,QChartAxis> m_axis; | ||||
Michal Klocek
|
r131 | QChart* m_chart; | ||
ChartDataSet* m_dataset; | ||||
Michal Klocek
|
r139 | QVector<Domain> m_domains; | ||
Michal Klocek
|
r143 | ChartTheme *m_chartTheme; | ||
Michal Klocek
|
r176 | QChartAxis m_axisX; | ||
AxisItem* m_axisXItem; | ||||
QChartAxis m_axisY; | ||||
AxisItem* m_axisYItem; | ||||
Michal Klocek
|
r139 | int m_domainIndex; | ||
int m_marginSize; | ||||
Michal Klocek
|
r131 | QRectF m_rect; | ||
Michal Klocek
|
r143 | |||
Michal Klocek
|
r131 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
#endif /* CHARTPRESENTER_H_ */ | ||||