QHeaderView: - avoid cursor move on setDefaultSectionSize
If we are reacting on the sectionResized signal and we call
setDefaultSectionSize we should ensure that we are not moving
the mouse-cursor.
This is an improvement of f8f6acb05c
Change-Id: I1adee7821bc8fcc9633f692bfd515f2c458b12c8
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
This commit is contained in:
parent
dfc0fbabe1
commit
8d4544f00d
@ -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.
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user