From b481399c1c02a945e816f9385070883a0d795455 Mon Sep 17 00:00:00 2001 From: Martin Jones <martin.jones@nokia.com> Date: Wed, 19 Jan 2011 11:25:22 +1000 Subject: 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 --- src/declarative/graphicsitems/qdeclarativetextedit.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp index 42f66c3..cb62a2c 100644 --- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp @@ -1365,8 +1365,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; -- cgit v0.12