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