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

Method keyPressEvent

src/openms_gui/source/VISUAL/TOPPASWidget.cpp:108–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106 }
107
108 void TOPPASWidget::keyPressEvent(QKeyEvent * e)
109 {
110 if (e->key() == Qt::Key_C && e->modifiers() == Qt::ControlModifier)
111 {
112 scene_->copySelected();
113 e->accept();
114 }
115 else if (e->key() == Qt::Key_X && e->modifiers() == Qt::ControlModifier)
116 {
117 scene_->copySelected();
118 scene_->removeSelected();
119 e->accept();
120 }
121 else if (e->key() == Qt::Key_V && e->modifiers() == Qt::ControlModifier)
122 {
123 scene_->paste();
124 e->accept();
125 }
126 else if (e->key() == Qt::Key_Control)
127 {
128 setDragMode(QGraphicsView::RubberBandDrag);
129 //color of hovering edge may change
130 TOPPASEdge* hover_edge = scene_->getHoveringEdge();
131 if (hover_edge)
132 {
133 hover_edge->update();
134 }
135 e->accept();
136 }
137 else if (e->key() == Qt::Key_Delete || e->key() == Qt::Key_Backspace)
138 {
139 scene_->removeSelected();
140 e->accept();
141 }
142 else if (e->key() == Qt::Key_Plus)
143 {
144 zoom(false);
145 e->accept();
146 }
147 else if (e->key() == Qt::Key_Minus)
148 {
149 zoom(true);
150 e->accept();
151 }
152 else
153 {
154 e->ignore();
155 }
156 }
157
158 void TOPPASWidget::keyReleaseEvent(QKeyEvent * e)
159 {

Callers

nothing calls this directly

Calls 5

copySelectedMethod · 0.80
pasteMethod · 0.80
getHoveringEdgeMethod · 0.80
removeSelectedMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected