qchartview.h
68 lines
| 1.6 KiB
| text/x-c
|
CLexer
/ src / qchartview.h
|
r58 | #ifndef QCHARTWIDGET_H | ||
#define QCHARTWIDGET_H | ||||
#include "qchartglobal.h" | ||||
#include "qchartseries.h" | ||||
|
r86 | #include "qchart.h" | ||
|
r58 | #include <QGraphicsView> | ||
class QGraphicsScene; | ||||
|
r136 | class QRubberBand; | ||
|
r58 | |||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
class QChart; | ||||
class QTCOMMERCIALCHART_EXPORT QChartView : public QGraphicsView | ||||
{ | ||||
public: | ||||
|
r136 | enum RubberBandPolicy { NoRubberBand, VerticalRubberBand, HorizonalRubberBand, RectangleRubberBand }; | ||
|
r58 | explicit QChartView(QWidget *parent = 0); | ||
~QChartView(); | ||||
//implement from QWidget | ||||
void resizeEvent(QResizeEvent *event); | ||||
void addSeries(QChartSeries* series); | ||||
|
r136 | |||
|
r61 | // Convenience function | ||
QChartSeries* createSeries(QChartSeries::QChartSeriesType type); | ||||
|
r58 | |||
|
r67 | int margin() const; | ||
|
r136 | |||
|
r69 | void setTitle(const QString& title); | ||
|
r122 | void setChartBackgroundBrush(const QBrush& brush); | ||
void setChartBackgroundPen(const QPen& pen); | ||||
|
r67 | void zoomInToRect(const QRect& rectangle); | ||
void zoomIn(); | ||||
void zoomOut(); | ||||
|
r58 | |||
|
r136 | void setRubberBandPolicy(const RubberBandPolicy ); | ||
RubberBandPolicy rubberBandPolicy() const; | ||||
void setTheme(QChart::ChartThemeId theme); | ||||
protected: | ||||
void mousePressEvent(QMouseEvent *event); | ||||
void mouseMoveEvent(QMouseEvent *event); | ||||
void mouseReleaseEvent(QMouseEvent *event); | ||||
void keyPressEvent(QKeyEvent *event); | ||||
|
r58 | private: | ||
QGraphicsScene *m_scene; | ||||
QChart* m_chart; | ||||
|
r136 | QPoint m_rubberBandOrigin; | ||
QRubberBand* m_rubberBand; | ||||
bool m_verticalRubberBand; | ||||
bool m_horizonalRubberBand; | ||||
|
r58 | Q_DISABLE_COPY(QChartView) | ||
}; | ||||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
#endif // QCHARTWIDGET_H | ||||