| 80 | } |
| 81 | |
| 82 | void RamWatchView::mouseDoubleClickEvent(QMouseEvent *event) |
| 83 | { |
| 84 | const QModelIndex index = indexAt(event->pos()); |
| 85 | if (!index.isValid()) { |
| 86 | return QTableView::mouseDoubleClickEvent(event); |
| 87 | } |
| 88 | if (index.column() != 0) |
| 89 | return QTableView::mouseDoubleClickEvent(event); |
| 90 | |
| 91 | int row = index.row(); |
| 92 | |
| 93 | /* Fill and show the watch edit window */ |
| 94 | RamWatchEditWindow *window = ensureEditWindow(); |
| 95 | window->fill(ramWatchModel->ramwatches.at(row)); |
| 96 | window->exec(); |
| 97 | |
| 98 | /* Modify the watch */ |
| 99 | if (window->ramwatch) { |
| 100 | ramWatchModel->ramwatches[row] = std::move(window->ramwatch); |
| 101 | ramWatchModel->update(); |
| 102 | } |
| 103 | |
| 104 | event->accept(); |
| 105 | } |
| 106 | |
| 107 | void RamWatchView::slotAdd() |
| 108 | { |