| 510 | } |
| 511 | |
| 512 | void 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 | |
| 547 | Column* SpreadsheetModel::column(int index) { |
| 548 | return m_spreadsheet->column(index); |
nothing calls this directly
no test coverage detected