diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2010-07-07 04:09:49 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2010-07-07 04:09:49 (GMT) |
commit | 628159323c60c434a202b036ecbaf5e433c703e8 (patch) | |
tree | 008ade0cdb2bf5d44e6995c9f1240f336a13ce63 /src/declarative/graphicsitems/qdeclarativetext.cpp | |
parent | be19c343000ffc7099474663c66a13226fa5253c (diff) | |
download | Qt-628159323c60c434a202b036ecbaf5e433c703e8.zip Qt-628159323c60c434a202b036ecbaf5e433c703e8.tar.gz Qt-628159323c60c434a202b036ecbaf5e433c703e8.tar.bz2 |
Make Text, TextInput, and TextEdit all have the same size for the same text.
This may mean that the cursor is to the right of the width, so components should
cater for that with a margin if they are boxed / clipped.
TextInput used to try to account for right bearing (and left bearing incorrectly since
it added it on the right). This is removed. Potentially this means that for some fonts
the text repaints incorrectly on the left or right, but if that is the case Text and TextEdit
already had such a problem (undetected), and all will need fixing.
Task-number: QTBUG-11983
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativetext.cpp')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativetext.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp index a7e2ed0..200a680 100644 --- a/src/declarative/graphicsitems/qdeclarativetext.cpp +++ b/src/declarative/graphicsitems/qdeclarativetext.cpp @@ -711,6 +711,8 @@ QRectF QDeclarativeText::boundingRect() const int x = 0; int y = 0; + // Could include font max left/right bearings to either side of rectangle. + if (d->cache || d->style != Normal) { switch (d->hAlign) { case AlignLeft: |