MCPcopy Create free account
hub / github.com/cvut/qtrvsim / keyPressEvent

Method keyPressEvent

src/gui/windows/program/programtableview.cpp:174–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172}
173
174void ProgramTableView::keyPressEvent(QKeyEvent *event) {
175 if (event->matches(QKeySequence::Copy)) {
176 QString text;
177 QItemSelectionRange range = selectionModel()->selection().first();
178 for (auto i = range.top(); i <= range.bottom(); ++i) {
179 QStringList rowContents;
180 for (auto j = range.left(); j <= range.right(); ++j) {
181 rowContents << model()->index(i, j).data().toString();
182 }
183 text += rowContents.join("\t");
184 text += "\n";
185 }
186 QApplication::clipboard()->setText(text);
187 } else {
188 Super::keyPressEvent(event);
189 }
190}

Callers

nothing calls this directly

Calls 2

setTextMethod · 0.80
dataMethod · 0.45

Tested by

no test coverage detected