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

Method showRowStatistics

src/frontend/spreadsheet/SpreadsheetView.cpp:3307–3328  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3305}
3306
3307void 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

Callers

nothing calls this directly

Calls 11

selectedRowsMethod · 0.80
selectionModelMethod · 0.80
execMethod · 0.80
nameMethod · 0.45
countMethod · 0.45
rowMethod · 0.45
columnCountMethod · 0.45
valueAtMethod · 0.45
columnMethod · 0.45
showStatisticsMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected