]> sigrok.org Git - pulseview.git/commitdiff
Use Qt namespace to simplify Ruler::paintEvent
authorJoel Holdsworth <redacted>
Sat, 23 Mar 2013 10:10:43 +0000 (10:10 +0000)
committerJoel Holdsworth <redacted>
Sat, 23 Mar 2013 10:10:43 +0000 (10:10 +0000)
pv/view/ruler.cpp

index 97a0d8f1d7b89c2c01cdae488715b2a4cf715f81..9f7cff2c6341e6f40dd86de31e388c6ee66f701f 100644 (file)
@@ -61,6 +61,8 @@ Ruler::Ruler(View &parent) :
 
 void Ruler::paintEvent(QPaintEvent*)
 {
+       using namespace Qt;
+
        QPainter p(this);
        p.setRenderHint(QPainter::Antialiasing);
 
@@ -85,7 +87,7 @@ void Ruler::paintEvent(QPaintEvent*)
        const double multiplier = pow(10.0, - prefix * 3 - FirstSIPrefixPower);
 
        const int text_height = p.boundingRect(0, 0, INT_MAX, INT_MAX,
-               Qt::AlignLeft | Qt::AlignTop, "8").height();
+               AlignLeft | AlignTop, "8").height();
 
        // Draw the tick marks
        p.setPen(palette().color(foregroundRole()));
@@ -113,8 +115,8 @@ void Ruler::paintEvent(QPaintEvent*)
                        QString s;
                        QTextStream ts(&s);
                        ts << (t * multiplier) << SIPrefixes[prefix] << "s";
-                       p.drawText(x, 0, 0, text_height, Qt::AlignCenter |
-                               Qt::AlignTop | Qt::TextDontClip, s);
+                       p.drawText(x, 0, 0, text_height, AlignCenter |
+                               AlignTop | TextDontClip, s);
                        p.drawLine(QPointF(x, text_height),
                                QPointF(x, height()));
                }