diff options
author | Martin Jones <martin.jones@nokia.com> | 2011-01-19 01:25:22 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2011-01-19 01:25:22 (GMT) |
commit | b481399c1c02a945e816f9385070883a0d795455 (patch) | |
tree | fcd10a517750f37fbb9917c560caec672db98851 /src | |
parent | 11815c63abeaf2b768e0cf59a83b53ff2b160b05 (diff) | |
download | Qt-b481399c1c02a945e816f9385070883a0d795455.zip Qt-b481399c1c02a945e816f9385070883a0d795455.tar.gz Qt-b481399c1c02a945e816f9385070883a0d795455.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
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 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; |