Bug with QTableView QSortFilterProxyModel and hidden columns
-
wrote on 20 Mar 2018, 16:43 last edited by
Hello all,
I'm having a problem with hidden columns on a table. I have a feature that can hide some columns of my table, using the table setColumnHidden function. I also have a QSortFilterProxyModel on this table that I use for hiding some rows according to a context. So I implemented the filterAcceptsRow function in my QSortFilterProxyModel. When my context changes, I call an invalidate on my QSortFilterProxyModel to hide some rows.
My problem is that often (this is not a reproducible bug every time), the invalidate call shows the columns that were hidden!
I specify that I do not have any particular threading. Everything is in the main thread.
Someone would have an idea about this bug ?!
Thank you.
-
wrote on 20 Mar 2018, 17:10 last edited by VRonin
Strange bug.
What's the source model? A custom one?
The first thing I'd look at is if the source model either resets or the count of columns returns a number <= the index of the hidden column any time -
wrote on 20 Mar 2018, 17:29 last edited by Ben35
Yes, it's a custom source model too. There is no reset of the model. Column counts also valid.
Edit : I also have the impression that the display of hidden columns is only done if row1 has been hidden by the invalidate. Really strange. I have the feeling that it is a Qt bug ... :(
-
Hi,
Can you reproduce that with a minimal compilable example ?
-
Lifetime Qt Championwrote on 22 Mar 2018, 16:23 last edited by Christian Ehrlicher
When it happens with Qt5.9.4 or 5.10.0 (not sure about 5.10.1) then it's most likely QTBUG-65478
-
When it happens with Qt5.9.4 or 5.10.0 (not sure about 5.10.1) then it's most likely QTBUG-65478
@Christian-Ehrlicher said in Bug with QTableView QSortFilterProxyModel and hidden columns:
QTBUG-65478
Most likely. For reference the complete link: https://bugreports.qt.io/browse/QTBUG-65478
1/6