chartdataset_p.h
60 lines
| 1.6 KiB
| text/x-c
|
CLexer
/ src / chartdataset_p.h
|
r223 | #ifndef CHARTDATASET_P_H_ | ||
#define CHARTDATASET_P_H_ | ||||
|
r131 | |||
|
r360 | #include "qseries.h" | ||
|
r131 | #include "domain_p.h" | ||
#include <QVector> | ||||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
|
r223 | class QChartAxis; | ||
|
r131 | class ChartDataSet : public QObject | ||
{ | ||||
Q_OBJECT | ||||
public: | ||||
|
r223 | ChartDataSet(QObject* parent=0); | ||
|
r131 | virtual ~ChartDataSet(); | ||
|
r360 | void addSeries(QSeries* series,QChartAxis *axisY = 0); | ||
void removeSeries(QSeries* series); | ||||
|
r258 | void removeAllSeries(); | ||
|
r223 | void addDomain(const QRectF& rect, const QRectF& viewport); | ||
|
r139 | bool nextDomain(); | ||
bool previousDomain(); | ||||
|
r223 | void clearDomains(int toIndex =0); | ||
const Domain domain(QChartAxis *axisY) const; | ||||
int domainIndex() const {return m_domainIndex;} | ||||
|
r298 | void setDomain(int index); | ||
|
r223 | |||
QChartAxis* axisX() const { return m_axisX;}; | ||||
|
r360 | QChartAxis* axisY(QSeries* series = 0) const; | ||
|
r131 | |||
signals: | ||||
|
r360 | void seriesAdded(QSeries* series); | ||
void seriesRemoved(QSeries* series); | ||||
|
r223 | void axisAdded(QChartAxis* axis); | ||
void axisRemoved(QChartAxis* axis); | ||||
void axisLabelsChanged(QChartAxis* axis, const QStringList& labels); | ||||
|
r360 | void seriesDomainChanged(QSeries* series,const Domain& domain); | ||
|
r223 | |||
private slots: | ||||
void handleMinChanged(qreal min); | ||||
void handleMaxChanged(qreal max); | ||||
void handleTickChanged(QChartAxis*); | ||||
private: | ||||
QStringList createLabels(QChartAxis* axis,qreal min, qreal max); | ||||
|
r131 | |||
private: | ||||
|
r223 | QMultiMap<QChartAxis*, Domain> m_domainMap; | ||
|
r360 | QMultiMap<QChartAxis*, QSeries*> m_seriesMap; | ||
|
r223 | QChartAxis* m_axisX; | ||
QChartAxis* m_axisY; | ||||
|
r131 | int m_domainIndex; | ||
|
r223 | bool m_axisXInitialized; | ||
|
r131 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
#endif /* CHARTENGINE_P_H_ */ | ||||