summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2019-03-22 21:45:31 +0100
committerChristian Ehrlicher <ch.ehrlicher@gmx.de>2019-03-26 13:35:37 +0000
commit998740c61961c0dc3e1296f0349c23846327aea0 (patch)
treebec565f55d17c1ee3a09ba8762ee96fa799f5116 /src/widgets
parentf4ac50a8389597827fd7fb952617b78aa4b113c2 (diff)
QDoubleSpinBox: reset size hint when prefix is set
QDoubleSpinBox did not resize when setPrefix() was called because the cached size hint was not reset. Fix it by resetting the cached size hints and update the geometry the same way it's done for QSpinBox::setPrefix(). Fixes: QTBUG-74520 Change-Id: I6f42a24ab0a4ce987ecbe1505a634d929474436b Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/widgets/qspinbox.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/widgets/widgets/qspinbox.cpp b/src/widgets/widgets/qspinbox.cpp
index 7624b1ed3c..7d454c6359 100644
--- a/src/widgets/widgets/qspinbox.cpp
+++ b/src/widgets/widgets/qspinbox.cpp
@@ -728,6 +728,10 @@ void QDoubleSpinBox::setPrefix(const QString &prefix)
d->prefix = prefix;
d->updateEdit();
+
+ d->cachedSizeHint = QSize();
+ d->cachedMinimumSizeHint = QSize(); // minimumSizeHint cares about the prefix
+ updateGeometry();
}
/*!