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

Method updateHorizontalHeader

src/backend/spreadsheet/SpreadsheetModel.cpp:512–545  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

510}
511
512void SpreadsheetModel::updateHorizontalHeader(bool sendSignal) {
513 int column_count = m_spreadsheet->childCount<Column>();
514
515 while (m_horizontal_header_data.size() < column_count)
516 m_horizontal_header_data << QString();
517
518 while (m_horizontal_header_data.size() > column_count)
519 m_horizontal_header_data.removeLast();
520
521 KConfigGroup group = Settings::group(QStringLiteral("Settings_Spreadsheet"));
522 bool showColumnType = group.readEntry(QLatin1String("ShowColumnType"), true);
523 bool showPlotDesignation = group.readEntry(QLatin1String("ShowPlotDesignation"), true);
524
525 for (int i = 0; i < column_count; i++) {
526 Column* col = m_spreadsheet->child<Column>(i);
527 QString header;
528 if (!col->formula().isEmpty() && col->formulaAutoUpdate())
529 header += QLatin1String("*");
530 header += col->name();
531
532 if (showColumnType)
533 header += QLatin1String(" {") + col->columnModeString() + QLatin1Char('}');
534
535 if (showPlotDesignation) {
536 if (col->plotDesignation() != AbstractColumn::PlotDesignation::NoDesignation)
537 header += QLatin1String(" ") + col->plotDesignationString();
538 }
539
540 m_horizontal_header_data.replace(i, header);
541 }
542
543 if (sendSignal)
544 Q_EMIT headerDataChanged(Qt::Horizontal, 0, column_count - 1);
545}
546
547Column* SpreadsheetModel::column(int index) {
548 return m_spreadsheet->column(index);

Callers

nothing calls this directly

Calls 11

groupFunction · 0.85
replaceMethod · 0.80
QStringClass · 0.50
sizeMethod · 0.45
isEmptyMethod · 0.45
formulaMethod · 0.45
formulaAutoUpdateMethod · 0.45
nameMethod · 0.45
columnModeStringMethod · 0.45
plotDesignationMethod · 0.45
plotDesignationStringMethod · 0.45

Tested by

no test coverage detected