##// END OF EJS Templates
Adaptive layout to legend. Tries to fit all items inside given maximum size
Adaptive layout to legend. Tries to fit all items inside given maximum size

File last commit:

r611:e622b3a8d8a0
r626:b05202e4f2ef
Show More
barvalue.cpp
73 lines | 1.1 KiB | text/x-c | CppLexer
sauimone
Floating values to bar charts
r263 #include "barvalue_p.h"
#include <QPainter>
#include <QPen>
QTCOMMERCIALCHART_BEGIN_NAMESPACE
sauimone
toggling of floating values. still bit buggy
r267 BarValue::BarValue(QBarSet &set, QGraphicsItem *parent)
Tero Ahola
Fixed initial bounding rect issue with bar series
r518 : QGraphicsObject(parent),
mBarSet(set),
mXpos(0),
mYpos(0),
mWidth(0),
mHeight(0)
sauimone
Floating values to bar charts
r263 {
sauimone
floating values working now. bounding rect bug fixed
r273 setVisible(false);
sauimone
Floating values to bar charts
r263 }
void BarValue::setValueString(QString str)
{
mValueString = str;
}
QString BarValue::valueString()
{
return mValueString;
}
sauimone
Fixed layout for barcharts
r473 void BarValue::setPen(const QPen pen)
sauimone
Floating values to bar charts
r263 {
mPen = pen;
}
sauimone
Fixed layout for barcharts
r473 QPen BarValue::pen() const
sauimone
Floating values to bar charts
r263 {
return mPen;
}
void BarValue::resize(qreal w, qreal h)
{
mWidth = w;
mHeight = h;
}
void BarValue::setPos(qreal x, qreal y)
{
mXpos = x;
mYpos = y;
}
void BarValue::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
Tero Ahola
Squashed bunch of warnings
r611 Q_UNUSED(option)
Q_UNUSED(widget)
sauimone
Updated barchart examples and documentation. Also bug fix to barchart model
r387 if (isVisible()) {
painter->setPen(mPen);
painter->drawText(boundingRect(),mValueString);
}
sauimone
Floating values to bar charts
r263 }
QRectF BarValue::boundingRect() const
{
sauimone
floating values working now. bounding rect bug fixed
r273 QRectF r(mXpos, mYpos, mWidth, mHeight);
sauimone
Floating values to bar charts
r263 return r;
}
sauimone
floating values working now. bounding rect bug fixed
r273 void BarValue::toggleVisible()
{
setVisible(!isVisible());
}
sauimone
Floating values to bar charts
r263
sauimone
floating values working now. bounding rect bug fixed
r273 #include "moc_barvalue_p.cpp"
sauimone
Floating values to bar charts
r263 QTCOMMERCIALCHART_END_NAMESPACE