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

Method formulaLocale

tests/spreadsheet/SpreadsheetFormulaTest.cpp:368–394  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

366///////////////////////// check group separator problem /////////////////////
367
368void SpreadsheetFormulaTest::formulaLocale() {
369 Spreadsheet sheet(QStringLiteral("test"), false);
370 const int cols = 2;
371 const int rows = 3;
372 const QVector<double> xData{13000, 14000, 15000};
373
374 sheet.setColumnCount(cols);
375 sheet.setRowCount(rows);
376 auto* col0{sheet.column(0)};
377 col0->replaceValues(0, xData);
378
379 SpreadsheetView view(&sheet, false);
380 view.selectColumn(0);
381
382 QStringList variableNames;
383 variableNames << QLatin1String("x");
384 QVector<Column*> variableColumns;
385 variableColumns << sheet.column(0);
386 sheet.column(1)->setFormulaVariableColumn(sheet.column(0));
387
388 sheet.column(1)->setFormula(QLatin1String("mean(x)"), variableNames, variableColumns, true);
389 sheet.column(1)->updateFormula();
390
391 // values
392 for (int i = 0; i < rows; i++)
393 QCOMPARE(sheet.column(1)->valueAt(i), sheet.column(0)->valueAt(1));
394}
395
396///////////////////////// more methods /////////////////////
397

Callers

nothing calls this directly

Calls 9

selectColumnMethod · 0.80
setColumnCountMethod · 0.45
setRowCountMethod · 0.45
columnMethod · 0.45
replaceValuesMethod · 0.45
setFormulaMethod · 0.45
updateFormulaMethod · 0.45
valueAtMethod · 0.45

Tested by

no test coverage detected