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

Method selectNodes

Gui/MultiInstancePanel.cpp:861–892  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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