qchartwidget.h
56 lines
| 1.6 KiB
| text/x-c
|
CLexer
/ src / qchartwidget.h
Tero Ahola
|
r19 | #ifndef QCHARTWIDGET_H | ||
#define QCHARTWIDGET_H | ||||
Tero Ahola
|
r30 | #include "qchartglobal.h" | ||
Tero Ahola
|
r19 | #include "qchart.h" | ||
Tero Ahola
|
r55 | #include <QGraphicsView> | ||
Tero Ahola
|
r77 | #include <QRubberBand> | ||
Tero Ahola
|
r19 | |||
Michal Klocek
|
r53 | class QGraphicsScene; | ||
Tero Ahola
|
r77 | class QRubberBand; | ||
Michal Klocek
|
r53 | |||
Tero Ahola
|
r30 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||
Tero Ahola
|
r19 | |||
Michal Klocek
|
r21 | class QChartSeries; | ||
Tero Ahola
|
r19 | class QChartWidgetPrivate; | ||
Tero Ahola
|
r55 | class QTCOMMERCIALCHART_EXPORT QChartWidget : public QGraphicsView | ||
Tero Ahola
|
r19 | { | ||
Q_OBJECT | ||||
public: | ||||
explicit QChartWidget(QWidget *parent = 0); | ||||
~QChartWidget(); | ||||
Tero Ahola
|
r42 | // TODO: addSeries and createSeries are optional solutions | ||
sauimone
|
r56 | // TODO: currently createSeries assumes x, y value pairs. This isn't case with all charts. So is there another createSeries for other types (for example one list of ints)? | ||
Tero Ahola
|
r77 | public Q_SLOTS: | ||
Michal Klocek
|
r21 | void addSeries(QChartSeries* series); | ||
Tero Ahola
|
r61 | QChartSeries* createSeries(QChartSeries::QChartSeriesType type); | ||
Tero Ahola
|
r19 | |||
Tero Ahola
|
r64 | /*! | ||
* Set color theme for the chart. Themes define harmonic colors for the graphical elements of | ||||
* the chart. | ||||
*/ | ||||
Tero Ahola
|
r75 | void setTheme(QChart::ChartThemeId theme); | ||
Tero Ahola
|
r64 | |||
Tero Ahola
|
r77 | void setZoomEnabled(bool enabled); | ||
private: // From QWidget TODO: should these be protected instead? Is QChartWidget meant to be extened by the user? | ||||
void resizeEvent(QResizeEvent *event); | ||||
QSize sizeHint() const; | ||||
void mousePressEvent(QMouseEvent *event); | ||||
void mouseMoveEvent(QMouseEvent *event); | ||||
void mouseReleaseEvent(QMouseEvent *event); | ||||
Tero Ahola
|
r19 | private: | ||
Q_DISABLE_COPY(QChartWidget) | ||||
Tero Ahola
|
r77 | // TODO: move the following to pimpl | ||
Michal Klocek
|
r53 | QGraphicsScene *m_scene; | ||
QChart* m_chart; | ||||
Tero Ahola
|
r77 | QRubberBand m_rubberBand; | ||
Tero Ahola
|
r93 | int m_originX; | ||
Tero Ahola
|
r19 | }; | ||
Tero Ahola
|
r30 | QTCOMMERCIALCHART_END_NAMESPACE | ||
Tero Ahola
|
r19 | |||
#endif // QCHARTWIDGET_H | ||||