summaryrefslogtreecommitdiff
path: root/muse2
diff options
context:
space:
mode:
authorRobert Jonsson <spamatica@gmail.com>2010-10-27 21:01:41 +0000
committerRobert Jonsson <spamatica@gmail.com>2010-10-27 21:01:41 +0000
commit921405f814becec0ce68c35ca2415cd090474188 (patch)
treec2fd49dd98f0acd62115f3ebb10218ca38b00fb3 /muse2
parentf71d7f97da32e1d960e3932994562d1b0256c980 (diff)
Fixed redrawing of meter drawContents -> paintEvent
Diffstat (limited to 'muse2')
-rw-r--r--muse2/muse/mixer/meter.cpp8
-rw-r--r--muse2/muse/mixer/meter.h1
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*);