From 41da7cecce0dec1ef7e8a74dafb1bf03292445d4 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Wed, 16 Sep 2009 16:05:26 +1000 Subject: Minor cleanup in QFxTextInput Don't calculate text size ourselves. --- src/declarative/fx/qfxtextinput.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/declarative/fx/qfxtextinput.cpp b/src/declarative/fx/qfxtextinput.cpp index 8a09ebc..f38a551 100644 --- a/src/declarative/fx/qfxtextinput.cpp +++ b/src/declarative/fx/qfxtextinput.cpp @@ -739,10 +739,8 @@ void QFxTextInput::updateSize() { Q_D(QFxTextInput); setImplicitHeight(d->control->height()); - //d->control->width() is max width, not current width - QFontMetrics fm = QFontMetrics(d->font); - setImplicitWidth(fm.width(d->control->text())+1); - //setImplicitWidth(d->control->naturalWidth());//### This fn should be coming into 4.6 shortly, and might be faster + //d->control->width() is width of the line, not of the text + setImplicitWidth(d->control->naturalTextWidth()+2); setContentsSize(QSize(width(), height())); } -- cgit v0.12