diff options
-rw-r--r-- | muse2/muse/mixer/meter.cpp | 8 | ||||
-rw-r--r-- | muse2/muse/mixer/meter.h | 1 |
2 files changed, 6 insertions, 3 deletions
diff --git a/muse2/muse/mixer/meter.cpp b/muse2/muse/mixer/meter.cpp index fc010a33..993a15ff 100644 --- a/muse2/muse/mixer/meter.cpp +++ b/muse2/muse/mixer/meter.cpp @@ -102,8 +102,10 @@ void Meter::setRange(double min, double max) // paintEvent //--------------------------------------------------------- -void Meter::drawContents(QPainter* p) +void Meter::paintEvent(QPaintEvent*) { + QPainter p; + p.begin(this); double range = maxScale - minScale; int fw = frameWidth(); @@ -122,8 +124,8 @@ void Meter::drawContents(QPainter* p) ymax = maxVal == 0 ? 0 : int(((maxScale - (fast_log10(maxVal) * 20.0)) * h)/range); else ymax = maxVal == 0 ? 0 : int(((maxScale - maxVal) * h)/range); - p->setPen(Qt::white); - p->drawLine(0, ymax, width()-2*fw, ymax); + p.setPen(Qt::white); + p.drawLine(0, ymax, width()-2*fw, ymax); } //--------------------------------------------------------- diff --git a/muse2/muse/mixer/meter.h b/muse2/muse/mixer/meter.h index 719ab701..5f072335 100644 --- a/muse2/muse/mixer/meter.h +++ b/muse2/muse/mixer/meter.h @@ -33,6 +33,7 @@ class Meter : public QFrame { void drawVU(int w, int h); Q_OBJECT + void paintEvent(QPaintEvent*); virtual void drawContents(QPainter* p); virtual void resizeEvent(QResizeEvent*); virtual void mousePressEvent(QMouseEvent*); |