diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2010-04-19 08:27:29 (GMT) |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2010-04-19 08:44:31 (GMT) |
commit | bce9c47d5437812b137c47ff3c602ff23ffa5e22 (patch) | |
tree | 675cef4384ad1aed476e370b2e3c9bad1e1ea017 /src/gui | |
parent | 3c3d5521a94254bf3ce5591e8a326005fcb4d3b1 (diff) | |
download | Qt-bce9c47d5437812b137c47ff3c602ff23ffa5e22.zip Qt-bce9c47d5437812b137c47ff3c602ff23ffa5e22.tar.gz Qt-bce9c47d5437812b137c47ff3c602ff23ffa5e22.tar.bz2 |
Mac: Fix off-by-one in vertical position for elided and non-elided text
In the code path that draws the elided text, we would truncate the
position before passing it to the painter. With a font engine that
supports fractional values (mac), this would potentially give us the
wrong position compared to the code path that draws the complete text,
which essentially rounds off the number. The result was that when you
resized the width an item view to make its items elide the text, then
they would potentially shift up or down by one pixel.
Task-number: QTBUG-9879
Reviewed-by: Gunnar
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/styles/qcommonstyle.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/styles/qcommonstyle.cpp b/src/gui/styles/qcommonstyle.cpp index b0e2d37..8036728 100644 --- a/src/gui/styles/qcommonstyle.cpp +++ b/src/gui/styles/qcommonstyle.cpp @@ -981,7 +981,7 @@ void QCommonStylePrivate::viewItemDrawText(QPainter *p, const QStyleOptionViewIt qreal y = position.y() + line.y() + line.ascent(); p->save(); p->setFont(option->font); - p->drawText(int(x), int(y), elidedText); + p->drawText(QPointF(x, y), elidedText); p->restore(); break; } |