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

Method resultCopyAll

src/frontend/dockwidgets/CursorDock.cpp:173–199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171}
172
173void CursorDock::resultCopyAll() {
174 QString str;
175 auto* model = ui->tvCursorData->model();
176 for (int row = 0; row < model->rowCount(); ++row) {
177 for (int col = 0; col < model->columnCount(); ++col) {
178 if (col != 0)
179 str += QLatin1Char('\t');
180 str += model->data(model->index(row, col)).toString();
181 }
182
183 str += QLatin1Char('\n');
184
185 // iterate over all children of the current row
186 auto index = model->index(row, 0);
187 for (int row = 0; row < model->rowCount(index); ++row) {
188 for (int col = 0; col < model->columnCount(); ++col) {
189 if (col != 0)
190 str += QLatin1Char('\t');
191 str += model->data(model->index(row, col, index)).toString();
192 }
193
194 str += QLatin1Char('\n');
195 }
196 }
197
198 QApplication::clipboard()->setText(str);
199}

Callers

nothing calls this directly

Calls 7

modelMethod · 0.45
rowCountMethod · 0.45
columnCountMethod · 0.45
toStringMethod · 0.45
dataMethod · 0.45
indexMethod · 0.45
setTextMethod · 0.45

Tested by

no test coverage detected