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

Method selectNode

Gui/MultiInstancePanel.cpp:817–837  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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