summaryrefslogtreecommitdiffstats
path: root/tests/auto/qactiongroup
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-10-30 10:11:26 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-10-30 10:12:51 (GMT)
commit2cdea6a10da75b7b8870f27c432a5e02f7500340 (patch)
treecb3cf290e42851c45513f052c1b41b96ec6fdc14 /tests/auto/qactiongroup
parenta5c3cd6d540f282f59c7c5891598ed8f2c6e033f (diff)
downloadQt-2cdea6a10da75b7b8870f27c432a5e02f7500340.zip
Qt-2cdea6a10da75b7b8870f27c432a5e02f7500340.tar.gz
Qt-2cdea6a10da75b7b8870f27c432a5e02f7500340.tar.bz2
QActionGroup: reset the checkedAction when it is unchecked
Task-number: QTBUG-1019 Reviewed-by: Gabriel
Diffstat (limited to 'tests/auto/qactiongroup')
-rw-r--r--tests/auto/qactiongroup/tst_qactiongroup.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/qactiongroup/tst_qactiongroup.cpp b/tests/auto/qactiongroup/tst_qactiongroup.cpp
index 2d215a0..7259479 100644
--- a/tests/auto/qactiongroup/tst_qactiongroup.cpp
+++ b/tests/auto/qactiongroup/tst_qactiongroup.cpp
@@ -70,6 +70,7 @@ private slots:
void separators();
void testActionInTwoQActionGroup();
+ void unCheckCurrentAction();
};
tst_QActionGroup::tst_QActionGroup()
@@ -278,5 +279,25 @@ void tst_QActionGroup::testActionInTwoQActionGroup()
QCOMPARE(group1.actions().isEmpty(), true);
}
+void tst_QActionGroup::unCheckCurrentAction()
+{
+ QActionGroup group(0);
+ QAction action1(&group) ,action2(&group);
+ action1.setCheckable(true);
+ action2.setCheckable(true);
+ QVERIFY(!action1.isChecked());
+ QVERIFY(!action2.isChecked());
+ action1.setChecked(true);
+ QVERIFY(action1.isChecked());
+ QVERIFY(!action2.isChecked());
+ QAction *current = group.checkedAction();
+ QCOMPARE(current, &action1);
+ current->setChecked(false);
+ QVERIFY(!action1.isChecked());
+ QVERIFY(!action2.isChecked());
+ QVERIFY(group.checkedAction() == 0);
+}
+
+
QTEST_MAIN(tst_QActionGroup)
#include "tst_qactiongroup.moc"