From: J-P Nurmi Date: Tue, 14 May 2013 17:27:20 +0000 (+0200) Subject: Fix TextEdit content size calculation X-Git-Tag: upstream/5.2.1~798^2~17 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2074386df9ce8a72b6fb2553bb7a5a353964c7b4;p=platform%2Fupstream%2Fqtdeclarative.git Fix TextEdit content size calculation Task-number: QTBUG-31154 Change-Id: I9d3e31352967b99b4bbb38f5819d3d093438ee37 Reviewed-by: Caroline Chao --- diff --git a/src/quick/items/qquicktextedit.cpp b/src/quick/items/qquicktextedit.cpp index 7c35565..327b086 100644 --- a/src/quick/items/qquicktextedit.cpp +++ b/src/quick/items/qquicktextedit.cpp @@ -2164,8 +2164,10 @@ void QQuickTextEdit::updateSize() if (d->inLayout) // probably the result of a binding loop, but by letting it return; // get this far we'll get a warning to that effect. } - if (d->document->textWidth() != width()) + if (d->document->textWidth() != width()) { d->document->setTextWidth(width()); + newWidth = d->document->idealWidth(); + } //### need to confirm cost of always setting these } else if (d->wrapMode == NoWrap && d->document->textWidth() != newWidth) { d->document->setTextWidth(newWidth); // ### Text does not align if width is not set or the idealWidth exceeds the textWidth (QTextDoc bug)