diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2010-03-17 13:12:49 (GMT) |
---|---|---|
committer | Samuli Piippo <samuli.piippo@digia.com> | 2011-06-09 10:05:17 (GMT) |
commit | ba017dd72d83dc6687db24a857cf6b1a1a981134 (patch) | |
tree | dc36270cc56b8764a24a0409b76add64241bc8fe /src | |
parent | efbe657f05c5bcd977850bdf622014a206ec25d8 (diff) | |
download | Qt-ba017dd72d83dc6687db24a857cf6b1a1a981134.zip Qt-ba017dd72d83dc6687db24a857cf6b1a1a981134.tar.gz Qt-ba017dd72d83dc6687db24a857cf6b1a1a981134.tar.bz2 |
Fixed a potential crash in headerview when inserting a section
This could happen if a section was moved andthen hidden
Task-number: QTBUG-8650
Reviewed-by: Andy Shaw
(cherry picked from commit f9b0efc17962df74a67d81daca5814af93a5fb97)
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/itemviews/qheaderview.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/gui/itemviews/qheaderview.cpp b/src/gui/itemviews/qheaderview.cpp index 0c77842..c87afc8 100644 --- a/src/gui/itemviews/qheaderview.cpp +++ b/src/gui/itemviews/qheaderview.cpp @@ -1698,13 +1698,10 @@ void QHeaderView::sectionsInserted(const QModelIndex &parent, if (!d->sectionHidden.isEmpty()) { QBitArray sectionHidden(d->sectionHidden); sectionHidden.resize(sectionHidden.count() + insertCount); - //sectionHidden.fill(false, logicalFirst, logicalLast + 1); - for (int i = logicalFirst; i <= logicalLast; ++i) - // visual == logical in this range (see previous block) - sectionHidden.setBit(i, false); + sectionHidden.fill(false, logicalFirst, logicalLast + 1); for (int j = logicalLast + 1; j < sectionHidden.count(); ++j) - sectionHidden.setBit(d->visualIndex(j), - d->sectionHidden.testBit(d->visualIndex(j - insertCount))); + //here we simply copy the old sectionHidden + sectionHidden.setBit(j, d->sectionHidden.testBit(j - insertCount)); d->sectionHidden = sectionHidden; } |