| 803 | } |
| 804 | |
| 805 | QRegion InstanceView::visualRegionForSelection(const QItemSelection &selection) const |
| 806 | { |
| 807 | QRegion region; |
| 808 | for (auto &range : selection) |
| 809 | { |
| 810 | int start_row = range.top(); |
| 811 | int end_row = range.bottom(); |
| 812 | for (int row = start_row; row <= end_row; ++row) |
| 813 | { |
| 814 | int start_column = range.left(); |
| 815 | int end_column = range.right(); |
| 816 | for (int column = start_column; column <= end_column; ++column) |
| 817 | { |
| 818 | QModelIndex index = model()->index(row, column, rootIndex()); |
| 819 | region += visualRect(index); // OK |
| 820 | } |
| 821 | } |
| 822 | } |
| 823 | return region; |
| 824 | } |
| 825 | |
| 826 | QModelIndex InstanceView::moveCursor(QAbstractItemView::CursorAction cursorAction, Qt::KeyboardModifiers modifiers) |
| 827 | { |