From: Joel Holdsworth Date: Sat, 23 Mar 2013 10:10:43 +0000 (+0000) Subject: Use Qt namespace to simplify Ruler::paintEvent X-Git-Tag: pulseview-0.1.0~68 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=3af62a24878d4b0b0ec20c3bc7f142149ffc36be;p=pulseview.git Use Qt namespace to simplify Ruler::paintEvent --- diff --git a/pv/view/ruler.cpp b/pv/view/ruler.cpp index 97a0d8f1..9f7cff2c 100644 --- a/pv/view/ruler.cpp +++ b/pv/view/ruler.cpp @@ -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())); }