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

Method refresh

src/frontend/spreadsheet/SpreadsheetHeaderView.cpp:204–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

202}
203
204void SpreadsheetHeaderView::refresh() {
205 int width = sectionSize(count() - 1);
206
207 m_commentSlave->setStretchLastSection(true);
208 m_commentSlave->updateGeometry();
209 m_commentSlave->setStretchLastSection(false);
210
211 m_sparklineSlave->setStretchLastSection(true);
212 m_sparklineSlave->updateGeometry();
213 m_sparklineSlave->setStretchLastSection(false);
214 int totalHeight = QHeaderView::sizeHint().height();
215 if (m_showSparklines)
216 totalHeight += m_sparklineSlave->sizeHint().height();
217 if (m_showComments)
218 totalHeight += m_commentSlave->sizeHint().height();
219
220 QSize sizeHint = QHeaderView::sizeHint();
221 sizeHint.setHeight(totalHeight);
222
223 setMinimumHeight(sizeHint.height());
224 setMaximumHeight(sizeHint.height());
225 setStretchLastSection(true);
226 updateGeometry();
227 setStretchLastSection(false);
228
229 resizeSection(count() - 1, width);
230 update(); // Ensure the header view is updated after resizing
231}
232
233/*!
234 Reacts to a header data change.

Callers 1

initMethod · 0.80

Calls 3

heightMethod · 0.80
setHeightMethod · 0.80
sizeHintMethod · 0.45

Tested by

no test coverage detected