| 2560 | } |
| 2561 | |
| 2562 | void 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 | |
| 2589 | void MainWindow::contextVat(const QPoint &posa) { |
| 2590 | QTableWidget *obj = static_cast<QTableWidget*>(sender()); |
nothing calls this directly
no test coverage detected