| 199 | } |
| 200 | |
| 201 | void |
| 202 | NodeGraph::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 | |
| 229 | void |
| 230 | NodeGraph::keyPressEvent(QKeyEvent* e) |
nothing calls this directly
no test coverage detected