Browse data columns size is reset when sorting #1475
Just noticed something weird when testing things out with our current code (dbd2d64).
In the Browse Data tab, if I've manually adjusted the size of some columns.. that size is lost/reset when I click on any column heading to sort by that column.
This is actually pretty annoying, as the size it reset back to (in the db I'm using atm) has fairly wide data in one field that I'm trying to read. So having to resize it to become fully visible after every sort operation is ugh. 😉
The text was updated successfully, but these errors were encountered:
We have already fixed the rowid column from appearing after almost every action in the Browse Data tab, for example in commit 39302f5. This didn't fix every issue related to this problem though. Hidden columns are shown too and modified column widths are reset. Also this happens for different actions, for example the column widths are also reset when sorting the view or when changing the filters. All these problems are hopefully fixed by this commit. See issue #1475.
This was a bit tricky to fix because it is in a place which is rather complicated and needs to be rewritten at some point. But I hope it is working now. Can you double check, @justinclift? Also worth checking how hidden columns work and if it reacts to filter changes in any unexpected way. The reason is that there are plenty of possible actions in the Browse Data tab which trigger all sorts of view changes to be reset and I hope to sort them all out in my commit 😄 It'd also be interesting to see if this has any side effects when using Qt <5.10.
Got around to making a screencast of the problem:
It's definitely not my imagination. 😄
This is required for Qt version < 5.10. For Qt versions >= 5.10 the unhiding of all columns before rehiding the desired ones does nothing because there the table view doesn't store its state anymore. And when it does nothing we don't change the state of our view settings which in turn triggers the mentioned problem. See issue #1475.
Yep, the sorting no longer resets column widths and the hidden columns no longer appear afterwards either. They can be made to appear using the correct option in the right click context menu though, so this looks to be fully solved now.
Thanks for getting it done @MKleusberg, and for the reminder prompt. 😉