MCPcopy Create free account
hub / github.com/Vector35/debugger / copy

Method copy

ui/moduleswidget.cpp:468–507  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

466
467
468void DebugModulesWidget::copy()
469{
470 QModelIndexList sel = selectionModel()->selectedIndexes();
471 if (sel.empty())
472 return;
473
474 auto sourceIndex = m_filter->mapToSource(sel[0]);
475 if (!sourceIndex.isValid())
476 return;
477
478 auto module = m_model->getRow(sourceIndex.row());
479 QString text;
480
481 switch (sel[0].column())
482 {
483 case DebugModulesListModel::AddressColumn:
484 text = QString::asprintf("0x%" PRIx64, module.address());
485 break;
486 case DebugModulesListModel::EndAddressColumn:
487 text = QString::asprintf("0x%" PRIx64, module.endAddress());
488 break;
489 case DebugModulesListModel::SizeColumn:
490 text = QString::asprintf("0x%" PRIx64, (uint64_t)module.size());
491 break;
492 case DebugModulesListModel::NameColumn:
493 text = QString::fromStdString(module.name());
494 break;
495 case DebugModulesListModel::PathColumn:
496 text = QString::fromStdString(module.path());
497 break;
498 default:
499 break;
500 }
501
502 auto* clipboard = QGuiApplication::clipboard();
503 clipboard->clear();
504 auto* mime = new QMimeData();
505 mime->setText(text);
506 clipboard->setMimeData(mime);
507}
508
509
510void DebugModulesWidget::onDoubleClicked()

Callers

nothing calls this directly

Calls 7

rowMethod · 0.80
endAddressMethod · 0.80
sizeMethod · 0.80
pathMethod · 0.80
getRowMethod · 0.45
addressMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected