summaryrefslogtreecommitdiffstats
path: root/src/declarative/fx/qfxtextinput.cpp
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2009-09-16 06:05:26 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2009-09-16 06:05:26 (GMT)
commit41da7cecce0dec1ef7e8a74dafb1bf03292445d4 (patch)
treea98bb6c96e541af72d47b76bde28ef0f40eee6d5 /src/declarative/fx/qfxtextinput.cpp
parentcacf0e4f1411c844f2e866f07af5f28f0f53c7ec (diff)
downloadQt-41da7cecce0dec1ef7e8a74dafb1bf03292445d4.zip
Qt-41da7cecce0dec1ef7e8a74dafb1bf03292445d4.tar.gz
Qt-41da7cecce0dec1ef7e8a74dafb1bf03292445d4.tar.bz2
Minor cleanup in QFxTextInput
Don't calculate text size ourselves.
Diffstat (limited to 'src/declarative/fx/qfxtextinput.cpp')
-rw-r--r--src/declarative/fx/qfxtextinput.cpp6
1 files 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()));
}