| 653 | } |
| 654 | |
| 655 | void AccessibleInstanceViewItem::unselectCell() |
| 656 | { |
| 657 | if (!isValid()) |
| 658 | return; |
| 659 | QAbstractItemView::SelectionMode selectionMode = view->selectionMode(); |
| 660 | if (selectionMode == QAbstractItemView::NoSelection) |
| 661 | return; |
| 662 | |
| 663 | QAccessibleTableInterface *cellTable = table()->tableInterface(); |
| 664 | |
| 665 | switch (view->selectionBehavior()) { |
| 666 | case QAbstractItemView::SelectItems: |
| 667 | break; |
| 668 | case QAbstractItemView::SelectColumns: |
| 669 | if (cellTable) |
| 670 | cellTable->unselectColumn(m_index.column()); |
| 671 | return; |
| 672 | case QAbstractItemView::SelectRows: |
| 673 | if (cellTable) |
| 674 | cellTable->unselectRow(m_index.row()); |
| 675 | return; |
| 676 | } |
| 677 | |
| 678 | //If the mode is not MultiSelection or ExtendedSelection and only |
| 679 | //one cell is selected it cannot be unselected by the user |
| 680 | if ((selectionMode != QAbstractItemView::MultiSelection) && (selectionMode != QAbstractItemView::ExtendedSelection) && (view->selectionModel()->selectedIndexes().count() <= 1)) |
| 681 | return; |
| 682 | |
| 683 | view->selectionModel()->select(m_index, QItemSelectionModel::Deselect); |
| 684 | } |
| 685 | |
| 686 | QAccessibleInterface *AccessibleInstanceViewItem::table() const |
| 687 | { |
nothing calls this directly
no test coverage detected