MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / contextMenuEvent

Method contextMenuEvent

src/openms_gui/source/VISUAL/TOPPASEdge.cpp:669–701  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

unselectAllMethod · 0.80
removeSelectedMethod · 0.45

Tested by

no test coverage detected