diff options
author | J-P Nurmi <jpnurmi@digia.com> | 2013-05-14 19:27:20 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-05-22 17:39:44 +0200 |
commit | 2074386df9ce8a72b6fb2553bb7a5a353964c7b4 (patch) | |
tree | 16828a098799c5afa37393872b9af62df2182cf3 /src/quick | |
parent | b528809fc46ae80b291b62a9da45ea3147977dd2 (diff) |
Fix TextEdit content size calculation
Task-number: QTBUG-31154
Change-Id: I9d3e31352967b99b4bbb38f5819d3d093438ee37
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
Diffstat (limited to 'src/quick')
-rw-r--r-- | src/quick/items/qquicktextedit.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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) |