2 #include "qgraphicswidget.h"
3 #include "QGraphicsItem"
7 Gauge::Gauge(QGraphicsItem *parent) :
8 QGraphicsWidget(parent)
15 void Gauge::paint(QPainter *painter,
16 const QStyleOptionGraphicsItem *option,
19 // qDebug() << "Gauge::paint";
20 painter->setBrush(Qt::blue);
21 painter->drawRoundedRect(QRectF(0.0,0.0, size().width(),size().height()), 5,5);
24 void Gauge::setValue(float val_)
27 update(boundingRect()); // Value updated, schedule redtaw
33 void Gauge::setValue2(float val_)
36 update(boundingRect()); // Value updated, schedule redtaw
44 QRectF Gauge::boundingRect() const
46 // qDebug() << "GaugeBand::boundingRect()" << size().width() << size().height();
47 return QRectF(0.0,0.0,size().width(),size().height());