##// END OF EJS Templates
Added support for adding and removing data with model. Updated the example
Added support for adding and removing data with model. Updated the example

File last commit:

r296:8254aab7233d
r545:366c5163e81a
Show More
separator.cpp
45 lines | 792 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)
{
if (isVisible()) {
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