diff options
author | Andre de la Rocha <andre.rocha@qt.io> | 2019-06-04 18:30:17 +0200 |
---|---|---|
committer | Andre de la Rocha <andre.rocha@qt.io> | 2019-07-05 11:56:34 +0200 |
commit | a4718f1274b62eb1a8e633a5d5cc0c6e22024c11 (patch) | |
tree | 5b251974abaeaeafc95a93073e1076f85a932e2a | |
parent | 78caba7ae637bf4b33631c3425eb92ec3946c99e (diff) |
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 <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
-rw-r--r-- | src/widgets/widgets/qlineedit.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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 |