Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QHeaderView setSectionResizeMode "segmentation fault"
Evgeny Siberia last edited by Evgeny Siberia
Hi. I need ResizeToContents for VerticalHeader. My attempt:
QHeaderView *vHeader = new QHeaderView(Qt::Orientation::Vertical, this); vHeader->setSectionResizeMode(Entity::SomeColumn, QHeaderView::ResizeToContents); ui->_tv->setVerticalHeader(vHeader);
And I get segmentation fault in this line: setSectionResizeMode.
How I can set heigh for my rows by context?
I'm pretty sure it does not crash there but one line below. Please provide a minimal, compilable example to reproduce your problem.
Phil K last edited by Phil K
The crash is probably caused by the fact that the view sections are not initialized until after you set the view's model. You must ensure that use of the two-parameter version of
setModel. Take it out of the view constructor and put it somewhere else.