qchartview.h
82 lines
| 2.2 KiB
| text/x-c
|
CLexer
/ src / qchartview.h
Michal Klocek
|
r58 | #ifndef QCHARTWIDGET_H | ||
#define QCHARTWIDGET_H | ||||
#include "qchartglobal.h" | ||||
Michal Klocek
|
r553 | #include "qchartaxis.h" | ||
Michal Klocek
|
r360 | #include "qseries.h" | ||
Michal Klocek
|
r86 | #include "qchart.h" | ||
Michal Klocek
|
r58 | #include <QGraphicsView> | ||
class QGraphicsScene; | ||||
Michal Klocek
|
r136 | class QRubberBand; | ||
Michal Klocek
|
r58 | |||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
class QChart; | ||||
class QTCOMMERCIALCHART_EXPORT QChartView : public QGraphicsView | ||||
{ | ||||
public: | ||||
Michal Klocek
|
r136 | enum RubberBandPolicy { NoRubberBand, VerticalRubberBand, HorizonalRubberBand, RectangleRubberBand }; | ||
Michal Klocek
|
r58 | explicit QChartView(QWidget *parent = 0); | ||
~QChartView(); | ||||
//implement from QWidget | ||||
void resizeEvent(QResizeEvent *event); | ||||
Tero Ahola
|
r495 | |||
Michal Klocek
|
r360 | void addSeries(QSeries* series,QChartAxis* axisY=0);// takes series ownership , takes axis ownership | ||
void removeSeries(QSeries* series); //returns ownership , deletes axis if no series attached | ||||
Michal Klocek
|
r258 | void removeAllSeries(); // deletes series and axis | ||
Michal Klocek
|
r67 | int margin() const; | ||
Michal Klocek
|
r136 | |||
Michal Klocek
|
r192 | void setChartTitle(const QString& title); | ||
Michal Klocek
|
r476 | QString chartTitle() const; | ||
Michal Klocek
|
r192 | void setChartTitleFont(const QFont& font); | ||
Tero Ahola
|
r495 | void setChartTitleBrush(const QBrush &brush); | ||
QBrush chartTitleBrush(); | ||||
Michal Klocek
|
r122 | void setChartBackgroundBrush(const QBrush& brush); | ||
void setChartBackgroundPen(const QPen& pen); | ||||
Michal Klocek
|
r67 | void zoomIn(); | ||
Michal Klocek
|
r223 | void zoomIn(const QRect& rect); | ||
Michal Klocek
|
r67 | void zoomOut(); | ||
Michal Klocek
|
r58 | |||
Michal Klocek
|
r531 | void scroll(int dx,int dy); | ||
Michal Klocek
|
r136 | void setRubberBandPolicy(const RubberBandPolicy ); | ||
RubberBandPolicy rubberBandPolicy() const; | ||||
Michal Klocek
|
r153 | void setChartTheme(QChart::ChartTheme theme); | ||
QChart::ChartTheme chartTheme() const; | ||||
Michal Klocek
|
r136 | |||
Michal Klocek
|
r298 | void setAnimationOptions(QChart::AnimationOptions options); | ||
QChart::AnimationOptions animationOptions() const; | ||||
Michal Klocek
|
r223 | QChartAxis* axisX() const; | ||
QChartAxis* axisY() const; | ||||
Michal Klocek
|
r155 | |||
sauimone
|
r529 | QLegend* legend() const; | ||
Michal Klocek
|
r136 | protected: | ||
void mousePressEvent(QMouseEvent *event); | ||||
void mouseMoveEvent(QMouseEvent *event); | ||||
void mouseReleaseEvent(QMouseEvent *event); | ||||
void keyPressEvent(QKeyEvent *event); | ||||
Michal Klocek
|
r58 | private: | ||
QGraphicsScene *m_scene; | ||||
QChart* m_chart; | ||||
Michal Klocek
|
r136 | QPoint m_rubberBandOrigin; | ||
QRubberBand* m_rubberBand; | ||||
bool m_verticalRubberBand; | ||||
bool m_horizonalRubberBand; | ||||
Michal Klocek
|
r58 | Q_DISABLE_COPY(QChartView) | ||
}; | ||||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
#endif // QCHARTWIDGET_H | ||||