summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2011-01-19 01:25:22 (GMT)
committerMartin Jones <martin.jones@nokia.com>2011-01-19 01:25:22 (GMT)
commitb481399c1c02a945e816f9385070883a0d795455 (patch)
treefcd10a517750f37fbb9917c560caec672db98851 /src
parent11815c63abeaf2b768e0cf59a83b53ff2b160b05 (diff)
downloadQt-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.cpp8
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;