summaryrefslogtreecommitdiffstats
path: root/tests/auto/other
diff options
context:
space:
mode:
authorJosé Millán Soto <fid@gpul.org>2012-09-24 11:42:33 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-01-11 21:24:23 +0100
commit08bc730b4199bad839543fe17a5464cf8d547ca8 (patch)
tree6e560cb66c8c568bbc97a91318d8c04c5187fe3d /tests/auto/other
parentf156e578d7f4b05f44a6e84b2173f1e69b856442 (diff)
Implement QAccessibleActionInterface in QAccessibleTableCell
Implemented QAccessibleActionInterface in QAccessibleTableCell to allow selecting and unselecting table cells, as there was no way of selecting or deselecting a simple cell using accessible tools. tst_qaccessibility.cpp was modified to test the new methods. Change-Id: I7bdfe0b363a9813d4a7c62e96b6c924b163f2121 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Diffstat (limited to 'tests/auto/other')
-rw-r--r--tests/auto/other/qaccessibility/tst_qaccessibility.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
index 3da8c4612c..83bbc43297 100644
--- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
+++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
@@ -2725,6 +2725,41 @@ void tst_QAccessibility::tableTest()
QVERIFY(table2->isColumnSelected(1));
QVERIFY(table2->isRowSelected(1));
+ QAIPtr cell4(table2->cellAt(2,2));
+ QVERIFY(cell1->actionInterface());
+ QVERIFY(cell1->tableCellInterface());
+
+ tableView->clearSelection();
+ tableView->setSelectionBehavior(QAbstractItemView::SelectRows);
+ tableView->setSelectionMode(QAbstractItemView::SingleSelection);
+ QVERIFY(!cell1->tableCellInterface()->isSelected());
+ QVERIFY(cell1->actionInterface()->actionNames().contains(QAccessibleActionInterface::toggleAction()));
+ cell1->actionInterface()->doAction(QAccessibleActionInterface::toggleAction());
+ QVERIFY(cell2->tableCellInterface()->isSelected());
+
+ tableView->clearSelection();
+ tableView->setSelectionBehavior(QAbstractItemView::SelectColumns);
+ cell3->actionInterface()->doAction(QAccessibleActionInterface::toggleAction());
+ QVERIFY(cell4->tableCellInterface()->isSelected());
+
+ tableView->clearSelection();
+ tableView->setSelectionBehavior(QAbstractItemView::SelectItems);
+ tableView->setSelectionMode(QAbstractItemView::SingleSelection);
+ cell1->actionInterface()->doAction(QAccessibleActionInterface::toggleAction());
+ QVERIFY(cell1->tableCellInterface()->isSelected());
+ cell2->actionInterface()->doAction(QAccessibleActionInterface::toggleAction());
+ QVERIFY(!cell1->tableCellInterface()->isSelected());
+
+ tableView->clearSelection();
+ tableView->setSelectionMode(QAbstractItemView::MultiSelection);
+ cell1->actionInterface()->doAction(QAccessibleActionInterface::toggleAction());
+ cell2->actionInterface()->doAction(QAccessibleActionInterface::toggleAction());
+ QVERIFY(cell1->tableCellInterface()->isSelected());
+ QVERIFY(cell2->tableCellInterface()->isSelected());
+ cell2->actionInterface()->doAction(QAccessibleActionInterface::toggleAction());
+ QVERIFY(cell1->tableCellInterface()->isSelected());
+ QVERIFY(!cell2->tableCellInterface()->isSelected());
+
delete tableView;
QTestAccessibility::clearEvents();