summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den-exter@nokia.com>2011-09-06 00:28:38 (GMT)
committerAndrew den Exter <andrew.den-exter@nokia.com>2011-09-06 02:56:30 (GMT)
commit95ba429db0652e8a8d2e1ef4eccdbde3925b195f (patch)
tree70aada94c5ff371bb574bdfcc88a8aff5168e8a7 /src/declarative
parent8570c509f505a4b238905122645a80faa768adb5 (diff)
downloadQt-95ba429db0652e8a8d2e1ef4eccdbde3925b195f.zip
Qt-95ba429db0652e8a8d2e1ef4eccdbde3925b195f.tar.gz
Qt-95ba429db0652e8a8d2e1ef4eccdbde3925b195f.tar.bz2
Fix implicit height not growing when pre-edit text wraps.
QTextDocument::isEmpty() doesn't account for pre-edit text so use the return value of size() to determine if implicitHeight should fall back to the font height instead. Change-Id: I028552a7646372b22894c45946a57ec4951b044a Task-number: QTBUG-21288 Reviewed-by: Martin Jones
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
index cc5279a..683807e 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
@@ -1713,7 +1713,9 @@ void QDeclarativeTextEdit::updateSize()
setImplicitWidth(newWidth);
else if (d->requireImplicitWidth)
setImplicitWidth(naturalWidth);
- qreal newHeight = d->document->isEmpty() ? fm.height() : (int)d->document->size().height();
+ qreal newHeight = d->document->size().height();
+ if (newHeight == 0)
+ newHeight = fm.height();
setImplicitHeight(newHeight);
d->paintedSize = QSize(newWidth, newHeight);