diff --git a/src/widgets/itemviews/qitemeditorfactory.cpp b/src/widgets/itemviews/qitemeditorfactory.cpp index a3ec5691a3..609df364cf 100644 --- a/src/widgets/itemviews/qitemeditorfactory.cpp +++ b/src/widgets/itemviews/qitemeditorfactory.cpp @@ -555,7 +555,7 @@ void QExpandingLineEdit::resizeToContents() 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); + int newWidth = qBound(qMin(originalWidth, maxWidth), hintWidth, maxWidth); if (widgetOwnsGeometry) setMaximumWidth(newWidth); if (isRightToLeft())