qt5base-lts/tests/auto/widgets/itemviews/qheaderview
David Faure f6b36eaafe QHeaderView: fix visual/logical index corruption when restoring state
This is a followup to 77a8e90cdd which
didn't handle the case where no columns had been moved.
visualIndices and logicalIndices are empty until initializeIndexMapping()
is called, in which case appending is wrong.

As a result, visualIndex(i) would return -1 for the values over
those added by read(), and an assert would happen at painting time.

The fix is to leave visualIndices and logicalIndices empty if
they are empty already, leaving it to initializeIndexMapping()
to fill them later if necessary (e.g. when moving a column).

Task-number: QTBUG-60837
Change-Id: Ia7e4b9d3122647984acd434dfaa0400df319d065
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2017-05-26 12:43:31 +00:00
..
.gitignore
qheaderview.pro Set the Qt API level to compatibility mode in all tests. 2012-08-01 15:37:46 +02:00
tst_qheaderview.cpp QHeaderView: fix visual/logical index corruption when restoring state 2017-05-26 12:43:31 +00:00