From 2074386df9ce8a72b6fb2553bb7a5a353964c7b4 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 14 May 2013 19:27:20 +0200 Subject: Fix TextEdit content size calculation Task-number: QTBUG-31154 Change-Id: I9d3e31352967b99b4bbb38f5819d3d093438ee37 Reviewed-by: Caroline Chao --- src/quick/items/qquicktextedit.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/quick') diff --git a/src/quick/items/qquicktextedit.cpp b/src/quick/items/qquicktextedit.cpp index 7c3556518e..327b0867e6 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) -- cgit v1.2.3