##// END OF EJS Templates
Fixed area series handling in chartwidgettest
Fixed area series handling in chartwidgettest

File last commit:

r490:5facde66eb08
r517:ff848436837e
Show More
chartpresenter_p.h
82 lines | 1.8 KiB | text/x-c | CLexer
/ src / chartpresenter_p.h
#ifndef CHARTPRESENTER_H_
#define CHARTPRESENTER_H_
#include "qchartglobal.h"
#include "qchart.h" //becouse of QChart::ChartThemeId //TODO
#include "qchartaxis.h"
#include <QRectF>
QTCOMMERCIALCHART_BEGIN_NAMESPACE
class ChartItem;
class QSeries;
class ChartDataSet;
//class QChart;
class Domain;
class AxisItem;
class ChartTheme;
class ChartPresenter: public QObject
{
Q_OBJECT
public:
enum ZValues {
BackgroundZValue = -1,
ShadesZValue,
GridZValue,
AxisZValue,
LineChartZValue,
ScatterSeriesZValue,
PieSeriesZValue
};
ChartPresenter(QChart* chart,ChartDataSet *dataset);
virtual ~ChartPresenter();
void setMargin(int margin);
int margin() const;
QRectF geometry() const;
void setChartTheme(QChart::ChartTheme theme);
QChart::ChartTheme chartTheme();
void setAnimationOptions(QChart::AnimationOptions options);
QChart::AnimationOptions animationOptions() const;
void zoomIn();
void zoomIn(const QRectF& rect);
void zoomOut();
void zoomReset();
private:
void createConnections();
public slots:
void handleSeriesAdded(QSeries* series,Domain* domain);
void handleSeriesRemoved(QSeries* series);
void handleAxisAdded(QChartAxis* axis,Domain* domain);
void handleAxisRemoved(QChartAxis* axis);
void handleGeometryChanged();
signals:
void geometryChanged(const QRectF& rect);
private:
QChart* m_chart;
ChartDataSet* m_dataset;
ChartTheme *m_chartTheme;
int m_zoomIndex;
int m_marginSize;
QMap<QSeries*,ChartItem*> m_chartItems;
QMap<QChartAxis*,AxisItem*> m_axisItems;
QVector<QRectF> m_zoomStack;
QRectF m_rect;
QChart::AnimationOptions m_options;
};
QTCOMMERCIALCHART_END_NAMESPACE
#endif /* CHARTPRESENTER_H_ */