qchart.h
67 lines
| 1.7 KiB
| text/x-c
|
CLexer
/ src / qchart.h
|
r12 | #ifndef CHART_H | ||
#define CHART_H | ||||
|
r30 | #include <qchartglobal.h> | ||
|
r42 | #include <qchartseries.h> | ||
|
r48 | #include <QGraphicsObject> | ||
|
r12 | |||
|
r30 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||
|
r12 | |||
|
r21 | class Axis; | ||
class XYGrid; | ||||
class QChartSeries; | ||||
|
r25 | class XYPlotDomain; | ||
|
r53 | class XYLineChartItem; | ||
|
r56 | class BarGroup; | ||
|
r21 | |||
|
r42 | // TODO: We don't need to have QChart tied to QGraphicsItem: | ||
//class QTCOMMERCIALCHART_EXPORT QChart | ||||
//class QTCOMMERCIALCHART_EXPORT QChartGraphicsItem : public QGraphicsItem { | ||||
// public: QChartGraphicsItem(QChart &chart); | ||||
/*! | ||||
* TODO: define the responsibilities | ||||
*/ | ||||
|
r48 | class QTCOMMERCIALCHART_EXPORT QChart : public QGraphicsObject | ||
|
r38 | { | ||
|
r48 | Q_OBJECT | ||
|
r12 | public: | ||
|
r48 | QChart(QGraphicsObject* parent = 0); | ||
~QChart(); | ||||
|
r12 | |||
|
r21 | //from QGraphicsItem | ||
|
r48 | QRectF boundingRect() const; | ||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget){}; | ||||
|
r21 | |||
void addSeries(QChartSeries* series); | ||||
|
r42 | //TODO: QChartSeries* createSeries(QSeriesData *data, QChartSeries::QChartSeriesType type); | ||
// TODO: who owns the series now? maybe owned by chart and returned a reference instead... | ||||
|
r61 | QChartSeries* createSeries(QChartSeries::QChartSeriesType type); | ||
|
r12 | |||
|
r21 | virtual void setSize(const QSizeF& rect); | ||
|
r12 | void setMargin(int margin); | ||
|
r28 | int margin() const; | ||
|
r48 | signals: | ||
|
r54 | void sizeChanged(QRectF rect); | ||
void scaleChanged(qreal xscale, qreal yscale); | ||||
|
r12 | |||
private: | ||||
|
r28 | Q_DISABLE_COPY(QChart) | ||
|
r53 | Axis* m_axisX; | ||
Axis* m_axisY; | ||||
XYGrid* m_grid; | ||||
QRect m_rect; | ||||
QList<const QChartSeries*> m_series; | ||||
QList<XYPlotDomain> m_plotDomainList; | ||||
QList<XYLineChartItem*> m_xyLineChartItems; | ||||
QList<QGraphicsItem*> m_items; | ||||
int m_plotDataIndex; | ||||
int m_marginSize; | ||||
|
r56 | |||
QList<BarGroup*> m_BarGroupItems; | ||||
|
r12 | }; | ||
|
r30 | QTCOMMERCIALCHART_END_NAMESPACE | ||
|
r12 | |||
#endif | ||||