From a4718f1274b62eb1a8e633a5d5cc0c6e22024c11 Mon Sep 17 00:00:00 2001 From: Andre de la Rocha Date: Tue, 4 Jun 2019 18:30:17 +0200 Subject: Fix the appearance of QSpinBox arrows on high-DPI displays A previous change to QLineEdit::sizeHint() has caused the QSpinBox arrows to break the widget frame on a high-DPI display with some particular scale values like 150 or 175%. This change updates QLineEdit::sizeHint() so that it has a minimum height, using the same values used in 5.11. Fixes: QTBUG-76047 Change-Id: I21f3e736da473b10fdf52e5a60e5fc5d07f270a1 Reviewed-by: Friedemann Kleint Reviewed-by: Richard Moe Gustavsen --- src/widgets/widgets/qlineedit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp index 86c7d35dbc..7515f866fe 100644 --- a/src/widgets/widgets/qlineedit.cpp +++ b/src/widgets/widgets/qlineedit.cpp @@ -684,7 +684,7 @@ QSize QLineEdit::sizeHint() const ensurePolished(); QFontMetrics fm(font()); const int iconSize = style()->pixelMetric(QStyle::PM_SmallIconSize, 0, this); - int h = qMax(fm.height(), iconSize - 2) + 2*d->verticalMargin + int h = qMax(fm.height(), qMax(14, iconSize - 2)) + 2*d->verticalMargin + d->topTextMargin + d->bottomTextMargin + d->topmargin + d->bottommargin; int w = fm.horizontalAdvance(QLatin1Char('x')) * 17 + 2*d->horizontalMargin -- cgit v1.2.3