summaryrefslogtreecommitdiffstats
path: root/src/widgets/itemviews/qitemeditorfactory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/itemviews/qitemeditorfactory.cpp')
-rw-r--r--src/widgets/itemviews/qitemeditorfactory.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/itemviews/qitemeditorfactory.cpp b/src/widgets/itemviews/qitemeditorfactory.cpp
index 1d8e03569d..72a9f1f1c9 100644
--- a/src/widgets/itemviews/qitemeditorfactory.cpp
+++ b/src/widgets/itemviews/qitemeditorfactory.cpp
@@ -587,7 +587,7 @@ void QExpandingLineEdit::resizeToContents()
originalWidth = oldWidth;
if (QWidget *parent = parentWidget()) {
QPoint position = pos();
- int hintWidth = minimumWidth() + fontMetrics().width(displayText());
+ int hintWidth = minimumWidth() + fontMetrics().horizontalAdvance(displayText());
int parentWidth = parent->width();
int maxWidth = isRightToLeft() ? position.x() + oldWidth : parentWidth - position.x();
int newWidth = qBound(originalWidth, hintWidth, maxWidth);