projects
/
pulseview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
306d43a
)
Use Qt namespace to simplify Ruler::paintEvent
author
Joel Holdsworth
<joel@airwebreathe.org.uk>
Sat, 23 Mar 2013 10:10:43 +0000
(10:10 +0000)
committer
Joel Holdsworth
<joel@airwebreathe.org.uk>
Sat, 23 Mar 2013 10:10:43 +0000
(10:10 +0000)
pv/view/ruler.cpp
patch
|
blob
|
history
diff --git
a/pv/view/ruler.cpp
b/pv/view/ruler.cpp
index 97a0d8f1d7b89c2c01cdae488715b2a4cf715f81..9f7cff2c6341e6f40dd86de31e388c6ee66f701f 100644
(file)
--- a/
pv/view/ruler.cpp
+++ b/
pv/view/ruler.cpp
@@
-61,6
+61,8
@@
Ruler::Ruler(View &parent) :
void Ruler::paintEvent(QPaintEvent*)
{
void Ruler::paintEvent(QPaintEvent*)
{
+ using namespace Qt;
+
QPainter p(this);
p.setRenderHint(QPainter::Antialiasing);
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,
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()));
// 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";
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()));
}
p.drawLine(QPointF(x, text_height),
QPointF(x, height()));
}