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

Method selectNodes

Gui/MultiInstancePanel.cpp:862–893  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

860}
861
862void
863MultiInstancePanel::selectNodes(const std::list<Node*> & nodes,
864 bool addToSelection)
865{
866 //_imp->view->selectionModel()->blockSignals(true);
867 if (!addToSelection) {
868 _imp->view->clearSelection();
869 }
870 // for (std::list<std::pair<NodePtr,bool > >::iterator it2 = _imp->instances.begin();
871 // it2!=_imp->instances.end(); ++it2) {
872 // it2->second = false;
873 // }
874 // _imp->view->selectionModel()->blockSignals(false);
875 if ( nodes.empty() ) {
876 return;
877 }
878
879
880 QItemSelection newSelection;
881 for (std::list<Node*>::const_iterator it = nodes.begin(); it != nodes.end(); ++it) {
882 int i = 0;
883 for (std::list<std::pair<NodeWPtr, bool > >::iterator it2 = _imp->instances.begin();
884 it2 != _imp->instances.end(); ++it2, ++i) {
885 if (it2->first.lock().get() == *it) {
886 QItemSelection sel( _imp->model->index(i, 0), _imp->model->index(i, _imp->view->columnCount() - 1) );
887 newSelection.merge(sel, QItemSelectionModel::Select);
888 break;
889 }
890 }
891 }
892 _imp->view->selectionModel()->select(newSelection, QItemSelectionModel::Select);
893}
894
895class RemoveNodeCommand
896 : public QUndoCommand

Callers

nothing calls this directly

Calls 10

emptyMethod · 0.80
clearSelectionMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
getMethod · 0.45
lockMethod · 0.45
indexMethod · 0.45
columnCountMethod · 0.45
mergeMethod · 0.45
selectMethod · 0.45

Tested by

no test coverage detected