##// END OF EJS Templates
QChart and QChartView now has some description for all the functions
QChart and QChartView now has some description for all the functions

File last commit:

r282:2a015f15bbd4
r287:6e151fb989cd
Show More
separator.cpp
44 lines | 773 B | text/x-c | CppLexer
#include "separator_p.h"
#include <QDebug>
#include <QPainter>
QTCOMMERCIALCHART_BEGIN_NAMESPACE
Separator::Separator(QGraphicsItem *parent)
: ChartItem(parent)
{
}
void Separator::setPos(qreal x, qreal y)
{
mXpos = x;
mYpos = y;
}
void Separator::setColor(QColor color)
{
mColor = color;
}
void Separator::setSize(const QSizeF &size)
{
mWidth = size.width();
mHeight = size.height();
}
void Separator::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
// TODO: real pen
QPen pen(mColor);
painter->setPen(pen);
painter->drawLine(mXpos,mYpos,mXpos,mHeight);
}
QRectF Separator::boundingRect() const
{
QRectF r(mXpos,mYpos,mWidth,mHeight);
return r;
}
QTCOMMERCIALCHART_END_NAMESPACE