qchart.h
54 lines
| 1.4 KiB
| text/x-c
|
CLexer
/ src / qchart.h
|
r12 | #ifndef CHART_H | ||
#define CHART_H | ||||
|
r30 | #include <qchartglobal.h> | ||
|
r38 | #include <qchartseries.h> | ||
|
r12 | #include <QGraphicsItem> | ||
|
r30 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||
|
r12 | |||
|
r21 | class Axis; | ||
class XYGrid; | ||||
class QChartSeries; | ||||
|
r25 | class XYPlotDomain; | ||
|
r28 | class QChartPrivate; | ||
|
r21 | |||
|
r38 | // 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); | ||||
|
r12 | |||
|
r38 | /*! | ||
* TODO: define the responsibilities | ||||
*/ | ||||
class QTCOMMERCIALCHART_EXPORT QChart : public QGraphicsItem, public QObject | ||||
{ | ||||
|
r12 | public: | ||
|
r21 | QChart(QGraphicsItem* parent = 0); | ||
|
r12 | virtual ~QChart(); | ||
|
r21 | //from QGraphicsItem | ||
virtual QRectF boundingRect() const; | ||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget){}; | ||||
void addSeries(QChartSeries* series); | ||||
|
r38 | //TODO: QChartSeries* createSeries(QSeriesData *data, QChartSeries::QChartSeriesType type); | ||
// TODO: who owns the series now? maybe owned by chart and returned a reference instead... | ||||
QChartSeries* createSeries(QList<qreal> x, QList<qreal> y, QChartSeries::QChartSeriesType type); | ||||
|
r12 | |||
|
r21 | virtual void setSize(const QSizeF& rect); | ||
|
r12 | void setMargin(int margin); | ||
|
r28 | int margin() const; | ||
protected: | ||||
QChartPrivate * const d_ptr; | ||||
|
r12 | |||
private: | ||||
|
r28 | Q_DISABLE_COPY(QChart) | ||
Q_DECLARE_PRIVATE(QChart) | ||||
|
r12 | }; | ||
|
r30 | QTCOMMERCIALCHART_END_NAMESPACE | ||
|
r12 | |||
#endif | ||||