diff options
author | Martin Jones <martin.jones@nokia.com> | 2011-01-19 01:25:22 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2011-01-20 09:49:28 (GMT) |
commit | fa9363b60c38e2a80d738bd0d95f5795b7a19119 (patch) | |
tree | 1f2ccde2c835306aeda9f9ea222e102a3e6adf61 /src | |
parent | 68979c65de998bae97c2104eaa09b7ad72821b9e (diff) | |
download | Qt-fa9363b60c38e2a80d738bd0d95f5795b7a19119.zip Qt-fa9363b60c38e2a80d738bd0d95f5795b7a19119.tar.gz Qt-fa9363b60c38e2a80d738bd0d95f5795b7a19119.tar.bz2 |
TextEdit implicit size varied depending upon wrapMode.
We failed to reset textWidth before calculating the ideal width of
the text.
Task-number: QTBUG-16710
Reviewed-by: Michael Brasser
(cherry picked from commit b481399c1c02a945e816f9385070883a0d795455)
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativetextedit.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp index 675f8d9..d072064 100644 --- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp @@ -1352,8 +1352,12 @@ void QDeclarativeTextEdit::updateSize() int dy = height(); // ### assumes that if the width is set, the text will fill to edges // ### (unless wrap is false, then clipping will occur) - if (widthValid() && d->document->textWidth() != width()) - d->document->setTextWidth(width()); + if (widthValid()) { + if (d->document->textWidth() != width()) + d->document->setTextWidth(width()); + } else { + d->document->setTextWidth(-1); + } dy -= (int)d->document->size().height(); int nyoff; |