MCPcopy Create free account
hub / github.com/KDE/labplot / resultCopy

Method resultCopy

src/frontend/dockwidgets/CursorDock.cpp:153–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151}
152
153void CursorDock::resultCopy() {
154 QString str;
155 auto* model = ui->tvCursorData->model();
156 auto* selection = ui->tvCursorData->selectionModel();
157 const auto& indices = selection->selectedRows();
158 for (auto& index : indices) {
159 int row = index.row();
160 auto parent = index.parent();
161 for (int col = 0; col < model->columnCount(); ++col) {
162 if (col != 0)
163 str += QLatin1Char('\t');
164 str += model->data(model->index(row, col, parent)).toString();
165 }
166
167 str += QLatin1Char('\n');
168 }
169
170 QApplication::clipboard()->setText(str);
171}
172
173void CursorDock::resultCopyAll() {
174 QString str;

Callers

nothing calls this directly

Calls 10

selectionModelMethod · 0.80
selectedRowsMethod · 0.80
modelMethod · 0.45
rowMethod · 0.45
parentMethod · 0.45
columnCountMethod · 0.45
toStringMethod · 0.45
dataMethod · 0.45
indexMethod · 0.45
setTextMethod · 0.45

Tested by

no test coverage detected