##// END OF EJS Templates
Refactored series creation with QChart
Refactored series creation with QChart

File last commit:

r61:45d3de5e814a
r61:45d3de5e814a
Show More
qchartview.h
46 lines | 1004 B | text/x-c | CLexer
#ifndef QCHARTWIDGET_H
#define QCHARTWIDGET_H
#include "qchartglobal.h"
#include "qchartseries.h"
#include <QGraphicsView>
class QGraphicsScene;
class QRubberBand;
QTCOMMERCIALCHART_BEGIN_NAMESPACE
class QChart;
class QTCOMMERCIALCHART_EXPORT QChartView : public QGraphicsView
{
public:
explicit QChartView(QWidget *parent = 0);
~QChartView();
//implement from QWidget
void resizeEvent(QResizeEvent *event);
void addSeries(QChartSeries* series);
// Convenience function
QChartSeries* createSeries(QChartSeries::QChartSeriesType type);
protected:
void mouseMoveEvent (QMouseEvent *event);
void mousePressEvent (QMouseEvent *event);
void mouseReleaseEvent (QMouseEvent *event);
private:
QGraphicsScene *m_scene;
QChart* m_chart;
QRubberBand *m_rubberBand;
QPoint m_origin;
bool m_showRubberBand;
Q_DISABLE_COPY(QChartView)
};
QTCOMMERCIALCHART_END_NAMESPACE
#endif // QCHARTWIDGET_H