Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.2.1, 5.3.1
-
None
-
Windows, Linux
-
93dabeba9dc5f6cbab60e65b3cc8df5fe48745a9
Description
Hi,
If you have a QTreeView with a model that is sorted dynamically and there are hidden columns, qheaderviewprivate's persistentHiddenSections grows indefinitely. Each time the model updates its sort, it will grow by the number of hidden columns. Qt grows this vector in _q_layoutAboutToBeChanged and should clear in _q_layoutChanged, but the clear does not seem to happen (as if _q_layoutChanged is not called).
Attached is a minimal example. To see the bug, click on any column header to change the sort order (i.e. force a sort) and the console will output the size of persistentHiddenSections before and after _q_layoutAboutToBeChanged as well as after _q_layoutChanged should be called. Every click in this example increases persistentHiddenSections size by 10, the number of hidden columns. To get access to persistentHiddenSections, I had to include the private implementation (i.e. #include "private/qheaderview_p.h"). I have attached Qt's 5.2.1's source code for private/qheaderview_p.h as well as other dependent headers so this will build (place all _p.h files in a folder call private).
Thanks,
Marc