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

Method updateHorizontalHeader

src/backend/spreadsheet/Spreadsheet.cpp:236–253  ·  view source on GitHub ↗

! * \brief Called when the application settings were changed. * adjusts the appearence of the spreadsheet header. */

Source from the content-addressed store, hash-verified

234 * adjusts the appearence of the spreadsheet header.
235 */
236void Spreadsheet::updateHorizontalHeader() {
237#ifndef SDK
238 if (m_model) {
239 const QString& oldHeader = m_model->headerData(0, Qt::Horizontal, Qt::DisplayRole).toString();
240 m_model->updateHorizontalHeader();
241 const QString& newHeader = m_model->headerData(0, Qt::Horizontal, Qt::DisplayRole).toString();
242
243 // if the header name of the first column has changed (column mode to be shown, etc.),
244 // reset the column widths and request the view to adjuste the column sizes to the content
245 if (oldHeader != newHeader && m_view) {
246 const auto& columns = children<Column>();
247 for (auto col : columns)
248 col->setWidth(0);
249 m_view->resizeHeader();
250 }
251 }
252#endif
253}
254
255/*!
256 * Updates locale for all columns from QLocale.

Callers 1

handleSettingsChangesMethod · 0.45

Calls 4

toStringMethod · 0.45
headerDataMethod · 0.45
setWidthMethod · 0.45
resizeHeaderMethod · 0.45

Tested by

no test coverage detected