##// END OF EJS Templates
Fix grid animation to do not go out of bound
Fix grid animation to do not go out of bound

File last commit:

r476:b6fb05e4e56f
r504:142210a64aff
Show More
linechartitem_p.h
54 lines | 1.1 KiB | text/x-c | CLexer
#ifndef LINECHARTITEM_H
#define LINECHARTITEM_H
#include "qchartglobal.h"
#include "xychartitem_p.h"
#include "xychartanimationitem_p.h"
#include <QPen>
QTCOMMERCIALCHART_BEGIN_NAMESPACE
class ChartPresenter;
class QLineSeries;
class LineChartItem : public XYChartItem
{
Q_OBJECT
public:
explicit LineChartItem(QLineSeries* series,QGraphicsItem *parent = 0);
~ LineChartItem(){};
//from QGraphicsItem
QRectF boundingRect() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
QPainterPath shape() const;
void setLinePen(const QPen& pen);
void setPointsVisible(bool visible);
public slots:
void handleUpdated();
protected:
virtual void setGeometry(QVector<QPointF>& points);
private:
void createPoints(int count);
void deletePoints(int count);
private:
QLineSeries* m_series;
QGraphicsItemGroup m_items;
QPainterPath m_path;
QRectF m_rect;
QPen m_pen;
template<class,class> friend class XYChartAnimator;
};
typedef XYChartAnimationItem<LineChartItem,QLineSeries> LineChartAnimationItem;
QTCOMMERCIALCHART_END_NAMESPACE
#endif