summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-04-19 08:27:29 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-04-19 08:44:31 (GMT)
commitbce9c47d5437812b137c47ff3c602ff23ffa5e22 (patch)
tree675cef4384ad1aed476e370b2e3c9bad1e1ea017 /src
parent3c3d5521a94254bf3ce5591e8a326005fcb4d3b1 (diff)
downloadQt-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')
-rw-r--r--src/gui/styles/qcommonstyle.cpp2
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;
}