diff options
-rw-r--r-- | src/gui/widgets/qcheckbox.cpp | 9 | ||||
-rw-r--r-- | src/gui/widgets/qcheckbox.h | 1 | ||||
-rw-r--r-- | tests/auto/qcheckbox/tst_qcheckbox.cpp | 7 |
3 files changed, 17 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; 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" |