| 667 | } |
| 668 | |
| 669 | void TOPPASEdge::contextMenuEvent(QGraphicsSceneContextMenuEvent* event) |
| 670 | { |
| 671 | TOPPASScene* ts = qobject_cast<TOPPASScene*>(scene()); |
| 672 | ts->unselectAll(); |
| 673 | setSelected(true); |
| 674 | |
| 675 | QMenu menu; |
| 676 | menu.addAction("Edit I/O mapping"); |
| 677 | menu.addAction("Remove"); |
| 678 | |
| 679 | QAction* selected_action = menu.exec(event->screenPos()); |
| 680 | if (selected_action) |
| 681 | { |
| 682 | QString text = selected_action->text(); |
| 683 | if (text == "Edit I/O mapping") |
| 684 | { |
| 685 | TOPPASIOMappingDialog dialog(this); |
| 686 | if (dialog.exec()) |
| 687 | { |
| 688 | emit somethingHasChanged(); |
| 689 | } |
| 690 | } |
| 691 | else if (text == "Remove") |
| 692 | { |
| 693 | ts->removeSelected(); |
| 694 | } |
| 695 | event->accept(); |
| 696 | } |
| 697 | else |
| 698 | { |
| 699 | event->ignore(); |
| 700 | } |
| 701 | } |
| 702 | |
| 703 | } //namespace |
nothing calls this directly
no test coverage detected