MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / treeContextMenu

Method treeContextMenu

tools/monitor/Viewer.cpp:298–348  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

296 }
297
298 void
299 Viewer::treeContextMenu(const QPoint& pos)
300 {
301 QPoint globalPos = this->ui.repoView->viewport()->mapToGlobal(pos);
302
303 QAction* selectedItem = treeMenu.exec(globalPos);
304 if (selectedItem) {
305 if (selectedItem->iconText() == EXPAND_ACTION)
306 {
307 expand(true);
308 selectedItem->setText(COLLAPSE_ACTION);
309 selectedItem->setIconText(COLLAPSE_ACTION);
310
311 }
312 else if (selectedItem->iconText() == COLLAPSE_ACTION)
313 {
314 expand(false);
315 selectedItem->setText(EXPAND_ACTION);
316 selectedItem->setIconText(EXPAND_ACTION);
317 }
318 else if (selectedItem->iconText() == SELECTION_TO_NODE_VIEW ||
319 selectedItem->iconText() == SELECTION_TO_GRAPH_VIEW)
320 {
321 // reset all the display flags
322 this->dataSource_->modelRoot()->resetDisplays();
323
324 QModelIndexList q = this->ui.repoView->selectionModel()->selectedRows();
325 for (int c = 0; c < q.size(); ++c) {
326 // get the node and set the display flag
327 TreeNode *t = model_->getNode(q[c]);
328 t->setDisplay(true);
329 }
330
331 if (selectedItem->iconText() == SELECTION_TO_NODE_VIEW)
332 {
333 updateNodeView(true);
334 }
335 else {
336 updateGraphView(true);
337 }
338 }
339 else if (selectedItem->iconText() == NODE_VIEW_OPTIONS_ACTION)
340 {
341 showNodeOptions();
342 }
343 else if (selectedItem->iconText() == GRAPH_OPTIONS_ACTION)
344 {
345 showGraphOptions();
346 }
347 }
348 }
349
350 void
351 Viewer::nodeContextMenu(const QPoint& pos)

Callers

nothing calls this directly

Calls 6

setTextMethod · 0.80
resetDisplaysMethod · 0.80
modelRootMethod · 0.80
setDisplayMethod · 0.80
sizeMethod · 0.45
getNodeMethod · 0.45

Tested by

no test coverage detected