! * \brief Called when the application settings were changed. * adjusts the appearence of the spreadsheet header. */
| 234 | * adjusts the appearence of the spreadsheet header. |
| 235 | */ |
| 236 | void 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. |
no test coverage detected