diff options
author | jasplin <qt-info@nokia.com> | 2009-06-24 06:51:26 (GMT) |
---|---|---|
committer | jasplin <qt-info@nokia.com> | 2009-06-24 06:55:57 (GMT) |
commit | 84b5bd06dcc7c51d5b13f340aafd9797e1722c2e (patch) | |
tree | 1ceb11cf6b16da1f98270023e5448942014d3f22 /src | |
parent | aca09d2b5038ed193d198f4097b17051f5f94116 (diff) | |
download | Qt-84b5bd06dcc7c51d5b13f340aafd9797e1722c2e.zip Qt-84b5bd06dcc7c51d5b13f340aafd9797e1722c2e.tar.gz Qt-84b5bd06dcc7c51d5b13f340aafd9797e1722c2e.tar.bz2 |
Fixed sizeHint update bug in QSpinBox.
QSpinBox failed to recalculate its cached size hint
when setting the range, prefix, or suffix.
Reviewed-by: janarve
Task-number: 255051
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/widgets/qabstractspinbox.cpp | 4 | ||||
-rw-r--r-- | src/gui/widgets/qspinbox.cpp | 6 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/gui/widgets/qabstractspinbox.cpp b/src/gui/widgets/qabstractspinbox.cpp index e7f7c78..25acd6e 100644 --- a/src/gui/widgets/qabstractspinbox.cpp +++ b/src/gui/widgets/qabstractspinbox.cpp @@ -1696,6 +1696,8 @@ void QAbstractSpinBoxPrivate::updateEdit() void QAbstractSpinBoxPrivate::setRange(const QVariant &min, const QVariant &max) { + Q_Q(QAbstractSpinBox); + clearCache(); minimum = min; maximum = (variantCompare(min, max) < 0 ? max : min); @@ -1707,6 +1709,8 @@ void QAbstractSpinBoxPrivate::setRange(const QVariant &min, const QVariant &max) } else if (value == minimum && !specialValueText.isEmpty()) { updateEdit(); } + + q->updateGeometry(); } /*! diff --git a/src/gui/widgets/qspinbox.cpp b/src/gui/widgets/qspinbox.cpp index 1c2ae0d..e069a21 100644 --- a/src/gui/widgets/qspinbox.cpp +++ b/src/gui/widgets/qspinbox.cpp @@ -284,6 +284,9 @@ void QSpinBox::setPrefix(const QString &prefix) d->prefix = prefix; d->updateEdit(); + + d->cachedSizeHint = QSize(); + updateGeometry(); } /*! @@ -318,6 +321,9 @@ void QSpinBox::setSuffix(const QString &suffix) d->suffix = suffix; d->updateEdit(); + + d->cachedSizeHint = QSize(); + updateGeometry(); } /*! |