##// END OF EJS Templates
Fixed line series usage in the test app
Fixed line series usage in the test app

File last commit:

r30:ef99599d15b7
r65:51e529f06d1a
Show More
axis.cpp
50 lines | 905 B | text/x-c | CppLexer
#include "axis_p.h"
#include <QPainter>
#include <QDebug>
QTCOMMERCIALCHART_BEGIN_NAMESPACE
Axis::Axis(QGraphicsItem* parent): QGraphicsItem(parent)
{
}
Axis::~Axis()
{
}
void Axis::setLength(int length)
{
QPainterPath path;
path.moveTo(QPointF(0,0));
path.lineTo(length,0);
// path.lineTo(length-4,0);
// path.lineTo(length,3);
// path.lineTo(length-4,6);
// path.lineTo(length-4,4);
// path.lineTo(0,4);
// path.lineTo(0,2);
m_path=path;
update();
}
QRectF Axis::boundingRect() const
{
return m_path.boundingRect();
}
QPainterPath Axis::shape() const
{
return m_path;
}
void Axis::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,QWidget *widget)
{
painter->save();
QPen pen(Qt::black);
//pen.setWidth(10);
painter->setPen(pen);
painter->drawPath(m_path);
painter->restore();
}
QTCOMMERCIALCHART_END_NAMESPACE