diff options
author | Jan-Arve Sæther <jan-arve.saether@nokia.com> | 2010-04-26 08:30:56 (GMT) |
---|---|---|
committer | Jan-Arve Sæther <jan-arve.saether@nokia.com> | 2010-04-26 09:36:05 (GMT) |
commit | 8daa3ee6591f0ec5f65552a8a9290228d6e9f0ab (patch) | |
tree | 245effd4beddc8d30e8b23db90d522643c050d77 /src | |
parent | 24bbcd26aebd584a74483abc710841c7f24581b8 (diff) | |
download | Qt-8daa3ee6591f0ec5f65552a8a9290228d6e9f0ab.zip Qt-8daa3ee6591f0ec5f65552a8a9290228d6e9f0ab.tar.gz Qt-8daa3ee6591f0ec5f65552a8a9290228d6e9f0ab.tar.bz2 |
QCheckBox did not have a minimumSizeHint()
Fortunately the *default* horizontal size policy was
QSizePolicy::Minimum. However if the size policy was set to for instance
Preferred it could shrink down until it disappeared.
The following patch will do the same as QLabel does it:
sizeHint is the same as minimumSizeHint.
Task-number: QTBUG-2606
Reviewed-by: Gabriel
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/widgets/qcheckbox.cpp | 9 | ||||
-rw-r--r-- | src/gui/widgets/qcheckbox.h | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/gui/widgets/qcheckbox.cpp b/src/gui/widgets/qcheckbox.cpp index bc0900e..64b47b4 100644 --- a/src/gui/widgets/qcheckbox.cpp +++ b/src/gui/widgets/qcheckbox.cpp @@ -300,6 +300,15 @@ QSize QCheckBox::sizeHint() const return d->sizeHint; } + +/*! + \reimp +*/ +QSize QCheckBox::minimumSizeHint() const +{ + return sizeHint(); +} + /*! \reimp */ diff --git a/src/gui/widgets/qcheckbox.h b/src/gui/widgets/qcheckbox.h index 7b6292d..95da261 100644 --- a/src/gui/widgets/qcheckbox.h +++ b/src/gui/widgets/qcheckbox.h @@ -65,6 +65,7 @@ public: QSize sizeHint() const; + QSize minimumSizeHint() const; void setTristate(bool y = true); bool isTristate() const; |