summaryrefslogtreecommitdiff
path: root/meterwidget.h
diff options
context:
space:
mode:
Diffstat (limited to 'meterwidget.h')
-rw-r--r--meterwidget.h32
1 files changed, 17 insertions, 15 deletions
diff --git a/meterwidget.h b/meterwidget.h
index fbc27b6b..08bda6d5 100644
--- a/meterwidget.h
+++ b/meterwidget.h
@@ -3,29 +3,31 @@
#define METERWIDGET_H
#include <QWidget>
-#include <QtGui>
#include <QQueue>
class MeterWidget : public QWidget
{
- Q_OBJECT
-public:
- explicit MeterWidget(QWidget *parent = 0);
-
-signals:
-
-public slots:
- void setValue(int value);
+ Q_OBJECT
+ Q_PROPERTY (int value READ value WRITE setValue)
-private:
- QQueue<int> signalQueue;
+public:
+ explicit MeterWidget (QWidget *parent = 0);
- int m_signal;
- int m_sigPeak;
+ // value property
+ int value () const {return m_signal;}
+ Q_SLOT void setValue (int value);
+ // QWidget implementation
+ QSize sizeHint () const override;
+ void set_sigPeak(int value);
protected:
- void paintEvent( QPaintEvent * );
-
+ void paintEvent( QPaintEvent * ) override;
+
+private:
+ QQueue<int> signalQueue;
+ int m_signal;
+ int m_noisePeak;
+ int m_sigPeak; // peak value for color coding
};
#endif // METERWIDGET_H