2 #include "qgraphicswidget.h"
3 #include "QGraphicsItem"
7 Gauge::Gauge(QGraphicsItem *parent) :
8 QGraphicsWidget(parent)
17 m_backColor=QColor("black");
21 void Gauge::paint(QPainter *painter,
22 const QStyleOptionGraphicsItem *option,
25 // qDebug() << "Gauge::paint";
26 painter->setBrush(Qt::blue);
27 painter->drawRoundedRect(QRectF(0.0,0.0, size().width(),size().height()), 5,5);
30 void Gauge::setValue(float val_)
33 update(boundingRect()); // Value updated, schedule redtaw
36 void Gauge::propChanged()
38 update(boundingRect()); // Value updated, schedule redtaw
42 bool Gauge::testOption(QString a){
43 return m_options.contains(a);
50 void Gauge::setValue2(float val_)
53 update(boundingRect()); // Value updated, schedule redtaw
61 QRectF Gauge::boundingRect() const
63 // qDebug() << "GaugeBand::boundingRect()" << size().width() << size().height();
64 return QRectF(0.0,0.0,size().width(),size().height());