| 171 | } |
| 172 | |
| 173 | void 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 | } |