MCPcopy Create free account
hub / github.com/CE-Programming/CEmu / contextOp

Method contextOp

gui/qt/debugger.cpp:2562–2587  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2560}
2561
2562void MainWindow::contextOp(const QPoint &posa) {
2563 QTableWidget *obj = static_cast<QTableWidget*>(sender());
2564 if (!obj->rowCount() || !obj->selectionModel()->isSelected(obj->currentIndex())) {
2565 return;
2566 }
2567
2568 QPoint globalPos = obj->mapToGlobal(posa);
2569
2570 QString addr = obj->item(obj->selectionModel()->selectedRows().first().row(), OP_ADDR_COL)->text();
2571 QString data = obj->item(obj->selectionModel()->selectedRows().first().row(), obj->objectName() == QStringLiteral("opView") ? 2 : 1)->text();
2572
2573 QMenu menu;
2574 QAction *gotoMem = gotoMemAction(&menu);
2575 QAction *copyAddr = menu.addAction(ACTION_COPY_ADDR);
2576 menu.addSeparator();
2577 QAction *copyData = menu.addAction(ACTION_COPY_DATA);
2578
2579 QAction *item = menu.exec(globalPos);
2580 if (item == gotoMem) {
2581 gotoMemAddr(static_cast<uint32_t>(hex2int(addr)));
2582 } else if (item == copyAddr) {
2583 qApp->clipboard()->setText(addr);
2584 } else if (item == copyData) {
2585 qApp->clipboard()->setText(data);
2586 }
2587}
2588
2589void MainWindow::contextVat(const QPoint &posa) {
2590 QTableWidget *obj = static_cast<QTableWidget*>(sender());

Callers

nothing calls this directly

Calls 4

hex2intFunction · 0.85
rowCountMethod · 0.80
rowMethod · 0.80
isSelectedMethod · 0.45

Tested by

no test coverage detected