diff options
author | Caroline Chao <caroline.chao@digia.com> | 2013-02-05 13:04:01 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-02-12 20:20:03 +0100 |
commit | a317ee0a6fa76d1166f6da8593d39eaf7afce83c (patch) | |
tree | ee653c08b70bee9a1eaccbad3b88f5fc2a786e45 /src/widgets/widgets/qspinbox.cpp | |
parent | 8f00f2020b37388ab309fdf39e85a3b3c9814e1d (diff) |
Fix sizeHint for QAbstractSpinBox
The current size hint is not correct and the text is truncated
when using prefix/suffix.
Update QCommonStyle::sizeFromContents() to get the button
and frame widths into account for the QSpinBox width.
Update sizeFromContents() in the different styles to be
consistent with the change in QCommonStyle.
Update minimumSizeHint(), calculate it using the prefix and
data range. The SpinBox can shrunk over the suffix if any.
Task-number: QTBUG-28863
Change-Id: Ia742232edf8b11d0283e8136c2818928f8755103
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Diffstat (limited to 'src/widgets/widgets/qspinbox.cpp')
-rw-r--r-- | src/widgets/widgets/qspinbox.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/widgets/widgets/qspinbox.cpp b/src/widgets/widgets/qspinbox.cpp index e61c1c877a..b51bf4c078 100644 --- a/src/widgets/widgets/qspinbox.cpp +++ b/src/widgets/widgets/qspinbox.cpp @@ -268,6 +268,7 @@ void QSpinBox::setPrefix(const QString &prefix) d->updateEdit(); d->cachedSizeHint = QSize(); + d->cachedMinimumSizeHint = QSize(); // minimumSizeHint cares about the prefix updateGeometry(); } |