MCPcopy Create free account
hub / github.com/baldurk/renderdoc / customContextMenu

Method customContextMenu

qrenderdoc/Widgets/AnnotationDisplay.cpp:292–323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

290}
291
292void AnnotationDisplay::customContextMenu(QModelIndex index, QMenu *menu)
293{
294 RDTreeWidgetItem *item = m_Tree->itemForIndex(index);
295
296 const SDObject *obj = m_Items.key(item, NULL);
297 if(!obj)
298 return;
299
300 rdcstr path;
301 // don't include the root node, it's not part of the path, so only iterate over nodes that have
302 // parents themselves
303 while(obj && obj->GetParent())
304 {
305 if(path.empty())
306 path = obj->name;
307 else
308 path = obj->name + rdcstr(".") + path;
309 obj = obj->GetParent();
310 }
311
312 if(path.empty())
313 return;
314
315 QAction *sep = menu->insertSeparator(menu->actions()[0]);
316
317 QAction *showInEventBrowser = new QAction(tr("&Highlight in Event Browser"), menu);
318
319 QObject::connect(showInEventBrowser, &QAction::triggered,
320 [this, path]() { m_Ctx.GetEventBrowser()->SetHighlightedAnnotation(path); });
321
322 menu->insertAction(sep, showInEventBrowser);
323}
324
325void AnnotationDisplay::itemClicked(RDTreeWidgetItem *item, int column)
326{

Callers

nothing calls this directly

Calls 9

rdcstrClass · 0.85
connectFunction · 0.85
trFunction · 0.50
itemForIndexMethod · 0.45
keyMethod · 0.45
GetParentMethod · 0.45
emptyMethod · 0.45
GetEventBrowserMethod · 0.45

Tested by

no test coverage detected