X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fview%2Fruler.cpp;h=9f7cff2c6341e6f40dd86de31e388c6ee66f701f;hp=97a0d8f1d7b89c2c01cdae488715b2a4cf715f81;hb=3af62a24878d4b0b0ec20c3bc7f142149ffc36be;hpb=306d43a7ab62b534bbc1a5d19a381f7e0b787dfe 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())); }