MCPcopy Create free account
hub / github.com/MrKepzie/Natron / selectNode

Method selectNode

Gui/MultiInstancePanel.cpp:816–836  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

814} // addTableRow
815
816void
817MultiInstancePanel::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
838void
839MultiInstancePanel::removeNodeFromSelection(const NodePtr & node)

Callers

nothing calls this directly

Calls 7

clearMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
lockMethod · 0.45
indexMethod · 0.45
columnCountMethod · 0.45
selectMethod · 0.45

Tested by

no test coverage detected