diff --git a/widgets/meter.cpp b/widgets/meter.cpp index 0bec03406..d1007e556 100644 --- a/widgets/meter.cpp +++ b/widgets/meter.cpp @@ -325,6 +325,7 @@ void Meter::setValue(int value) d->animation->setEndValue(value); d->animation->start(); } + emit valueChanged(value); } int MeterPrivate::meterValue() const diff --git a/widgets/meter.h b/widgets/meter.h index c194e68fc..a0719841e 100644 --- a/widgets/meter.h +++ b/widgets/meter.h @@ -57,7 +57,7 @@ class PLASMA_EXPORT Meter : public QGraphicsWidget Q_ENUMS(MeterType) Q_PROPERTY(int minimum READ minimum WRITE setMinimum) Q_PROPERTY(int maximum READ maximum WRITE setMaximum) - Q_PROPERTY(int value READ value WRITE setValue) + Q_PROPERTY(int value READ value WRITE setValue NOTIFY valueChanged) Q_PROPERTY(QString svg READ svg WRITE setSvg) Q_PROPERTY(MeterType meterType READ meterType WRITE setMeterType) @@ -201,6 +201,13 @@ public Q_SLOTS: */ void setValue(int value); +Q_SIGNALS: + /** + * This signal is sent when the value of the meter changes programmatically. + * The meter's value is passed. + */ + void valueChanged(const int &value); + protected: /** * Reimplemented from Plasma::Widget