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

Method setAnnotationObject

qrenderdoc/Widgets/AnnotationDisplay.cpp:255–290  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

253}
254
255void AnnotationDisplay::setAnnotationObject(const SDObject *annotation)
256{
257 m_Tree->updateExpansion(m_Expansion, 0);
258
259 m_Annotation = annotation;
260
261 m_Items.clear();
262 m_Tree->invisibleRootItem()->clear();
263
264 // Check if we have any buffer annotations to determine columns
265 m_HasGoColumn = m_Annotation && hasResourceAnnotations(*m_Annotation);
266
267 if(m_HasGoColumn)
268 {
269 m_Tree->setColumns({lit("Key"), tr("Value"), tr("Go")});
270 m_Header->setSectionResizeMode(0, QHeaderView::ResizeToContents);
271 m_Header->setSectionResizeMode(1, QHeaderView::Stretch);
272 m_Header->setSectionResizeMode(2, QHeaderView::Fixed);
273 m_Header->resizeSection(2, 16);
274 }
275 else
276 {
277 m_Tree->setColumns({lit("Key"), tr("Value")});
278 m_Header->setSectionResizeMode(0, QHeaderView::ResizeToContents);
279 m_Header->setSectionResizeMode(1, QHeaderView::Stretch);
280 }
281
282 if(m_Annotation)
283 {
284 m_Tree->beginUpdate();
285 addStructuredChildren(m_Tree->invisibleRootItem(), *m_Annotation);
286 m_Tree->endUpdate();
287 }
288
289 m_Tree->applyExpansion(m_Expansion, 0);
290}
291
292void AnnotationDisplay::customContextMenu(QModelIndex index, QMenu *menu)
293{

Callers 2

InspectMethod · 0.80
OnCaptureClosedMethod · 0.80

Calls 10

addStructuredChildrenFunction · 0.85
invisibleRootItemMethod · 0.80
resizeSectionMethod · 0.80
beginUpdateMethod · 0.80
endUpdateMethod · 0.80
trFunction · 0.50
updateExpansionMethod · 0.45
clearMethod · 0.45
setColumnsMethod · 0.45
applyExpansionMethod · 0.45

Tested by 2

InspectMethod · 0.64
OnCaptureClosedMethod · 0.64