MCPcopy Create free account
hub / github.com/baldurk/renderdoc / resizeSections

Method resizeSections

qrenderdoc/Widgets/Extended/RDHeaderView.cpp:285–320  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

283}
284
285void RDHeaderView::resizeSections(QHeaderView::ResizeMode mode)
286{
287 if(!m_sectionStretchHints.isEmpty())
288 {
289 resizeSectionsWithHints();
290 return;
291 }
292
293 if(!m_customSizing)
294 return QHeaderView::resizeSections(mode);
295
296 if(mode != ResizeToContents)
297 return;
298
299 QAbstractItemModel *m = this->model();
300
301 int rowCount = m->rowCount();
302
303 for(int col = 0; col < m_sections.count(); col++)
304 {
305 QSize sz;
306
307 for(int row = 0; row < rowCount; row++)
308 {
309 QVariant v = m->data(m->index(row, col), Qt::SizeHintRole);
310 if(v.isValid() && v.canConvert<QSize>())
311 sz = sz.expandedTo(v.value<QSize>());
312 }
313
314 int oldSize = m_sections[col].size;
315
316 m_sections[col].size = sz.width();
317
318 emit sectionResized(col, oldSize, sz.width());
319 }
320}
321
322void RDHeaderView::resizeSections(const QList<int> &sizes)
323{

Callers 3

executePostedResizeFunction · 0.80
setColumnWidthsMethod · 0.80

Calls 9

countFunction · 0.50
isEmptyMethod · 0.45
modelMethod · 0.45
rowCountMethod · 0.45
countMethod · 0.45
dataMethod · 0.45
indexMethod · 0.45
isValidMethod · 0.45
widthMethod · 0.45

Tested by

no test coverage detected