summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextlayout.h
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-03-23 13:13:06 +0100
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-03-23 13:13:06 +0100
commit2c18a5665f70cd7ff62bfffac2c3f2b5364d7392 (patch)
treed732c0085a6f5870d4d03008547d919d907c79fa /src/gui/text/qtextlayout.h
parent49b200a700c140510720e1ed5f1b791b406ad0d6 (diff)
Add new function QTextLine::horizontalAdvance()
Add a function to QTextLine which returns the accumulated advance of the glyphs in the text. Previously QTextLine::naturalTextWidth() was used for both this purpose and for calculating the pixel width of the text. Since these two metrics are not the same, either of the two usages would be wrong. QTextLine::naturalTextWidth() has been changed to do what its documentation claims it does, and horizontalAdvance() should now be used for laying out text horizontally. Reviewed-by: Simon Hausmann
Diffstat (limited to 'src/gui/text/qtextlayout.h')
-rw-r--r--src/gui/text/qtextlayout.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gui/text/qtextlayout.h b/src/gui/text/qtextlayout.h
index edae7decde..8c93ed65b6 100644
--- a/src/gui/text/qtextlayout.h
+++ b/src/gui/text/qtextlayout.h
@@ -202,6 +202,7 @@ public:
bool leadingIncluded() const;
qreal naturalTextWidth() const;
+ qreal horizontalAdvance() const;
QRectF naturalTextRect() const;
enum Edge {