| 3305 | } |
| 3306 | |
| 3307 | void SpreadsheetView::showRowStatistics() { |
| 3308 | QString dlgTitle(i18n("%1: row statistics", m_spreadsheet->name())); |
| 3309 | |
| 3310 | QVector<Column*> columns; |
| 3311 | const auto& rows = m_tableView->selectionModel()->selectedRows(); |
| 3312 | |
| 3313 | for (int i = 0; i < rows.count(); ++i) { |
| 3314 | int row = rows.at(i).row(); |
| 3315 | QVector<double> rowValues; |
| 3316 | for (int j = 0; j < m_spreadsheet->columnCount(); ++j) |
| 3317 | rowValues << m_spreadsheet->column(j)->valueAt(row); |
| 3318 | columns << new Column(i18n("Row %1", row + 1), rowValues); |
| 3319 | } |
| 3320 | |
| 3321 | auto* dlg = new StatisticsDialog(dlgTitle, columns); |
| 3322 | dlg->showStatistics(); |
| 3323 | |
| 3324 | if (dlg->exec() == QDialog::Accepted) { |
| 3325 | qDeleteAll(columns); |
| 3326 | columns.clear(); |
| 3327 | } |
| 3328 | } |
| 3329 | |
| 3330 | /*! |
| 3331 | Insert an empty row above(=before) the first selected row |
nothing calls this directly
no test coverage detected