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

Method onCreateNodeDialogFinished

Gui/NodeGraph25.cpp:201–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199}
200
201void
202NodeGraph::onCreateNodeDialogFinished(bool accepted)
203{
204 NodeCreationDialog* dialog = qobject_cast<NodeCreationDialog*>( sender() );
205
206 if (dialog) {
207 int major;
208 QString res = dialog->getNodeName(&major);
209
210 if (accepted) {
211 _imp->_lastNodeCreatedName = res;
212 const PluginsMap & allPlugins = appPTR->getPluginsList();
213 PluginsMap::const_iterator found = allPlugins.find( res.toStdString() );
214 if ( found != allPlugins.end() ) {
215 QPointF posHint = mapToScene( mapFromGlobal( QCursor::pos() ) );
216 CreateNodeArgs args( res.toStdString(), getGroup() );
217 args.setProperty<double>(kCreateNodeArgsPropNodeInitialPosition, posHint.x(), 0);
218 args.setProperty<double>(kCreateNodeArgsPropNodeInitialPosition, posHint.y(), 1);
219 args.setProperty<int>(kCreateNodeArgsPropPluginVersion, major, 0);
220 getGui()->getApp()->createNode(args);
221 }
222 }
223
224 dialog->close();
225
226 }
227}
228
229void
230NodeGraph::keyPressEvent(QKeyEvent* e)

Callers

nothing calls this directly

Calls 10

getGuiFunction · 0.85
toStdStringMethod · 0.80
getNodeNameMethod · 0.45
findMethod · 0.45
endMethod · 0.45
xMethod · 0.45
yMethod · 0.45
createNodeMethod · 0.45
getAppMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected