MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / resultsContextMenu

Method resultsContextMenu

tools/triage/mainwindow.cpp:414–428  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

412}
413
414void MainWindow::resultsContextMenu(const QPoint& pos)
415{
416 if (ui->results->selectedItems().isEmpty())
417 return;
418 QMenu submenu;
419 submenu.addAction("Copy");
420 const QAction* menuItem = submenu.exec(ui->results->mapToGlobal(pos));
421 if (menuItem && menuItem->text().contains("Copy"))
422 {
423 QString text;
424 for (const auto *res: ui->results->selectedItems())
425 text += res->text() + "\n";
426 QApplication::clipboard()->setText(text);
427 }
428}
429

Callers

nothing calls this directly

Calls 2

isEmptyMethod · 0.80
containsMethod · 0.45

Tested by

no test coverage detected