diff options
Diffstat (limited to 'tests/auto/qgroupbox/tst_qgroupbox.cpp')
-rw-r--r-- | tests/auto/qgroupbox/tst_qgroupbox.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/auto/qgroupbox/tst_qgroupbox.cpp b/tests/auto/qgroupbox/tst_qgroupbox.cpp index f1388bc..f3d26ef 100644 --- a/tests/auto/qgroupbox/tst_qgroupbox.cpp +++ b/tests/auto/qgroupbox/tst_qgroupbox.cpp @@ -83,6 +83,7 @@ private slots: void toggledVsClicked(); void childrenAreDisabled(); void propagateFocus(); + void task_QTBUG_19170_ignoreMouseReleseEvent(); private: bool checked; @@ -473,5 +474,27 @@ void tst_QGroupBox::propagateFocus() QTRY_COMPARE(qApp->focusWidget(), static_cast<QWidget*>(&lineEdit)); } +void tst_QGroupBox::task_QTBUG_19170_ignoreMouseReleseEvent() +{ + QGroupBox box; + box.setCheckable(true); + box.setChecked(false); + box.setTitle("This is a test for QTBUG-19170"); + box.show(); + + QStyleOptionGroupBox option; + option.initFrom(&box); + option.subControls = QStyle::SubControls(QStyle::SC_All); + QRect rect = box.style()->subControlRect(QStyle::CC_GroupBox, &option, + QStyle::SC_GroupBoxCheckBox, &box); + + QTest::mouseClick(&box, Qt::LeftButton, 0, rect.center()); + QCOMPARE(box.isChecked(), true); + + box.setChecked(false); + QTest::mouseRelease(&box, Qt::LeftButton, 0, rect.center()); + QCOMPARE(box.isChecked(), false); +} + QTEST_MAIN(tst_QGroupBox) #include "tst_qgroupbox.moc" |