##// END OF EJS Templates
legend layout with padding
legend layout with padding

File last commit:

r794:4c76de65bbac
r799:0ecf2967daa4
Show More
barvalue.cpp
93 lines | 1.9 KiB | text/x-c | CppLexer
Jani Honkonen
Add license headers
r794 /****************************************************************************
**
** Copyright (C) 2012 Digia Plc
** All rights reserved.
** For any questions to Digia, please use contact form at http://qt.digia.com
**
** This file is part of the Qt Commercial Charts Add-on.
**
** $QT_BEGIN_LICENSE$
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia.
**
** If you have questions regarding the use of this file, please use
** contact form at http://qt.digia.com
** $QT_END_LICENSE$
**
****************************************************************************/
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),
sauimone
minor code review fixes, part n
r763 m_barSet(set),
m_xPos(0),
m_yPos(0),
m_width(0),
m_height(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 }
sauimone
const to getters, renamed addBarset to appendBarset
r776 void BarValue::setText(QString str)
sauimone
Floating values to bar charts
r263 {
sauimone
minor code review fixes, part n
r763 m_valueString = str;
sauimone
Floating values to bar charts
r263 }
sauimone
const to getters, renamed addBarset to appendBarset
r776 QString BarValue::text() const
sauimone
Floating values to bar charts
r263 {
sauimone
minor code review fixes, part n
r763 return m_valueString;
sauimone
Floating values to bar charts
r263 }
sauimone
const to getters, renamed addBarset to appendBarset
r776 void BarValue::setPen(const QPen &pen)
sauimone
Floating values to bar charts
r263 {
sauimone
minor code review fixes, part n
r763 m_pen = pen;
sauimone
Floating values to bar charts
r263 }
sauimone
Fixed layout for barcharts
r473 QPen BarValue::pen() const
sauimone
Floating values to bar charts
r263 {
sauimone
minor code review fixes, part n
r763 return m_pen;
sauimone
Floating values to bar charts
r263 }
void BarValue::resize(qreal w, qreal h)
{
sauimone
minor code review fixes, part n
r763 m_width = w;
m_height = h;
sauimone
Floating values to bar charts
r263 }
void BarValue::setPos(qreal x, qreal y)
{
sauimone
minor code review fixes, part n
r763 m_xPos = x;
m_yPos = y;
sauimone
Floating values to bar charts
r263 }
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()) {
sauimone
minor code review fixes, part n
r763 painter->setPen(m_pen);
painter->drawText(boundingRect(), m_valueString);
sauimone
Updated barchart examples and documentation. Also bug fix to barchart model
r387 }
sauimone
Floating values to bar charts
r263 }
QRectF BarValue::boundingRect() const
{
sauimone
minor code review fixes, part n
r763 QRectF r(m_xPos, m_yPos, m_width, m_height);
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