diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp index 6326b497c5..b909131229 100644 --- a/src/widgets/itemviews/qheaderview.cpp +++ b/src/widgets/itemviews/qheaderview.cpp @@ -3375,6 +3375,8 @@ void QHeaderViewPrivate::setDefaultSectionSize(int size) executePostedLayout(); invalidateCachedSizeHint(); defaultSectionSize = size; + if (state == QHeaderViewPrivate::ResizeSection) + preventCursorChangeInSetOffset = true; for (int i = 0; i < sectionItems.count(); ++i) { QHeaderViewPrivate::SectionItem §ion = sectionItems[i]; if (sectionHidden.isEmpty() || !sectionHidden.testBit(i)) { // resize on not hidden. diff --git a/tests/manual/widgets/itemviews/qheaderview/qheaderviewtest1.cpp b/tests/manual/widgets/itemviews/qheaderview/qheaderviewtest1.cpp index 2fc7bbec43..7a8c1d159d 100644 --- a/tests/manual/widgets/itemviews/qheaderview/qheaderviewtest1.cpp +++ b/tests/manual/widgets/itemviews/qheaderview/qheaderviewtest1.cpp @@ -65,8 +65,7 @@ void SomeHandler::slotSectionResized(int logsection, int oldsize, int newsize) m_tv->setUpdatesEnabled(false); // Do some manual resizing - lets make every section having the new size. m_hv->blockSignals(true); - for (int u = 0; u < m_hv->count(); ++u) - m_hv->resizeSection(u, newsize); + m_hv->setDefaultSectionSize(newsize); m_hv->blockSignals(false); // Adjust offset and scrollbar. Maybe it isn't 100% perfect