| 814 | } // addTableRow |
| 815 | |
| 816 | void |
| 817 | MultiInstancePanel::selectNode(const NodePtr & node, |
| 818 | bool addToSelection) |
| 819 | { |
| 820 | if (!addToSelection) { |
| 821 | _imp->view->selectionModel()->clear(); |
| 822 | } |
| 823 | |
| 824 | int index = -1; |
| 825 | int i = 0; |
| 826 | for (std::list< std::pair<boost::weak_ptr<Node>, bool > >::iterator it = _imp->instances.begin(); it != _imp->instances.end(); ++it, ++i) { |
| 827 | if (it->first.lock() == node) { |
| 828 | index = i; |
| 829 | break; |
| 830 | } |
| 831 | } |
| 832 | assert(index != -1); |
| 833 | |
| 834 | QItemSelection newSelection( _imp->model->index(index, 0), _imp->model->index(index, _imp->view->columnCount() - 1) ); |
| 835 | _imp->view->selectionModel()->select(newSelection, QItemSelectionModel::Select); |
| 836 | } |
| 837 | |
| 838 | void |
| 839 | MultiInstancePanel::removeNodeFromSelection(const NodePtr & node) |