diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2010-05-12 01:06:55 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2010-05-12 01:53:02 (GMT) |
commit | 43db14d83279566cdd5626321251efc5da8acc1d (patch) | |
tree | 181d0c3f855626d957cf0f625fa07e6b1222cc21 /src | |
parent | f303375383ff405afbbe78ec2c951f2e24a121be (diff) | |
download | Qt-43db14d83279566cdd5626321251efc5da8acc1d.zip Qt-43db14d83279566cdd5626321251efc5da8acc1d.tar.gz Qt-43db14d83279566cdd5626321251efc5da8acc1d.tar.bz2 |
Correctly resize TextInput in the presence of preedit text.
Task-number: QTBUG-10466
Reviewed-by: alexis
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativetextinput.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp index 604f508..4d89887 100644 --- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp @@ -1233,9 +1233,7 @@ void QDeclarativeTextInput::updateSize(bool needsRedraw) int cursorWidth = d->control->cursorWidth(); if(d->cursorItem) cursorWidth = d->cursorItem->width(); - //### Is QFontMetrics too slow? - QFontMetricsF fm(d->font); - setImplicitWidth(fm.width(d->control->displayText())+cursorWidth); + setImplicitWidth(d->control->naturalTextWidth() + cursorWidth); setContentsSize(QSize(width(), height()));//Repaints if changed if(w==width() && h==height() && needsRedraw){ clearCache(); |