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 /tests/auto | |
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 'tests/auto')
-rw-r--r-- | tests/auto/qcheckbox/tst_qcheckbox.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/qcheckbox/tst_qcheckbox.cpp b/tests/auto/qcheckbox/tst_qcheckbox.cpp index d16370c..24d78fe 100644 --- a/tests/auto/qcheckbox/tst_qcheckbox.cpp +++ b/tests/auto/qcheckbox/tst_qcheckbox.cpp @@ -92,6 +92,7 @@ private slots: void setAccel(); void group(); void foregroundRole(); + void minimumSizeHint(); protected slots: void onClicked(); @@ -425,5 +426,11 @@ void tst_QCheckBox::foregroundRole() QVERIFY(testWidget->foregroundRole() == QPalette::WindowText); } +void tst_QCheckBox::minimumSizeHint() +{ + QCheckBox box(tr("CheckBox's sizeHint is the same as it's minimumSizeHint")); + QCOMPARE(box.sizeHint(), box.minimumSizeHint()); +} + QTEST_MAIN(tst_QCheckBox) #include "tst_qcheckbox.moc" |