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

Method keyPressEvent

src/openms_gui/source/VISUAL/InputFileList.cpp:81–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79 }
80
81 void InputFileList::keyPressEvent(QKeyEvent* e) {
82 // when Ctrl-C is pressed, copy all selected files to clipboard as text
83 if (e->matches(QKeySequence::Copy))
84 {
85 QStringList strings;
86 QList<QListWidgetItem*> selected_items = ui_->input_file_list->selectedItems();
87 foreach(QListWidgetItem * item, selected_items)
88 {
89 strings << item->text();
90 }
91 QApplication::clipboard()->setText(strings.join("\n"));
92 e->accept(); // do not propagate upstream
93 }
94 // exit on escape (without saving the list)
95 else if (e->key() == Qt::Key_Escape)
96 {
97 this->close();
98 }
99 // delete currently selected items
100 else if (e->key() == Qt::Key_Delete)
101 {
102 removeSelected();
103 }
104 }
105
106 void InputFileList::showFileDialog()
107 {

Callers

nothing calls this directly

Calls 3

setTextMethod · 0.80
matchesMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected