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

Method showMenu

Gui/NodeGraph35.cpp:318–512  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

316}
317
318void
319NodeGraph::showMenu(const QPoint & pos)
320{
321 _imp->_menu->clear();
322
323 QAction* createNode = new ActionWithShortcut(kShortcutGroupNodegraph, kShortcutIDActionGraphCreateNode,
324 kShortcutDescActionGraphCreateNode, _imp->_menu);
325 _imp->_menu->addAction(createNode);
326
327
328 //QFont font(appFont,appFontSize);
329 Menu* editMenu = new Menu(tr("Edit"), _imp->_menu);
330 //editMenu->setFont(font);
331 _imp->_menu->addAction( editMenu->menuAction() );
332
333 QAction* copyAction = new ActionWithShortcut(kShortcutGroupNodegraph, kShortcutIDActionGraphCopy,
334 kShortcutDescActionGraphCopy, editMenu);
335 QObject::connect( copyAction, SIGNAL(triggered()), this, SLOT(copySelectedNodes()) );
336 editMenu->addAction(copyAction);
337
338 QAction* cutAction = new ActionWithShortcut(kShortcutGroupNodegraph, kShortcutIDActionGraphCut,
339 kShortcutDescActionGraphCut, editMenu);
340 QObject::connect( cutAction, SIGNAL(triggered()), this, SLOT(cutSelectedNodes()) );
341 editMenu->addAction(cutAction);
342
343
344 QAction* pasteAction = new ActionWithShortcut(kShortcutGroupNodegraph, kShortcutIDActionGraphPaste,
345 kShortcutDescActionGraphPaste, editMenu);
346 pasteAction->setEnabled( !appPTR->isNodeClipBoardEmpty() );
347 editMenu->addAction(pasteAction);
348
349 QAction* deleteAction = new ActionWithShortcut(kShortcutGroupNodegraph, kShortcutIDActionGraphRemoveNodes,
350 kShortcutDescActionGraphRemoveNodes, editMenu);
351 QObject::connect( deleteAction, SIGNAL(triggered()), this, SLOT(deleteSelection()) );
352 editMenu->addAction(deleteAction);
353
354 QAction* renameAction = new ActionWithShortcut(kShortcutGroupNodegraph, kShortcutIDActionGraphRenameNode,
355 kShortcutDescActionGraphRenameNode, editMenu);
356 QObject::connect( renameAction, SIGNAL(triggered()), this, SLOT(renameNode()) );
357 editMenu->addAction(renameAction);
358
359 QAction* duplicateAction = new ActionWithShortcut(kShortcutGroupNodegraph, kShortcutIDActionGraphDuplicate,
360 kShortcutDescActionGraphDuplicate, editMenu);
361 editMenu->addAction(duplicateAction);
362
363 QAction* cloneAction = new ActionWithShortcut(kShortcutGroupNodegraph, kShortcutIDActionGraphClone,
364 kShortcutDescActionGraphClone, editMenu);
365 editMenu->addAction(cloneAction);
366
367 QAction* decloneAction = new ActionWithShortcut(kShortcutGroupNodegraph, kShortcutIDActionGraphDeclone,
368 kShortcutDescActionGraphDeclone, editMenu);
369 QObject::connect( decloneAction, SIGNAL(triggered()), this, SLOT(decloneSelectedNodes()) );
370 editMenu->addAction(decloneAction);
371
372 QAction* switchInputs = new ActionWithShortcut(kShortcutGroupNodegraph, kShortcutIDActionGraphExtractNode,
373 kShortcutDescActionGraphExtractNode, editMenu);
374 QObject::connect( switchInputs, SIGNAL(triggered()), this, SLOT(extractSelectedNode()) );
375 editMenu->addAction(switchInputs);

Callers

nothing calls this directly

Calls 15

getGuiFunction · 0.85
addActionMethod · 0.80
isNodeClipBoardEmptyMethod · 0.80
setCheckableMethod · 0.80
emptyMethod · 0.80
getCurrentSettingsMethod · 0.80
isAutoPreviewEnabledMethod · 0.80
getProjectMethod · 0.80
isAutoTurboEnabledMethod · 0.80
addSeparatorMethod · 0.80
getToolButtonsOrderedMethod · 0.80

Tested by

no test coverage detected