Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.7.2, 6.7.3, Some future release
-
None
-
Window 10
Visual studio 2022
Qt6.7.2
Description
Hello,I got an assert error "last < columnCount(parent)" when hiding the last column by overriding the function filterAcceptColumn of QSortFilterProxyModel.
The impl of filterAcceptColumn below(Assuming there are two columns):
bool MyProxyModel::filterAcceptsColumn(int SourceColumn, const QModelIndex& SourceParent) const
{ return SourceColumn != 1; }This assert is reported in the function beginRemoveColumns of QSortFilterProxyModel.I checked my source tree model, and I am sure it is correct. This problem only appears when there is a parent-child relationship of data structure and column count is greater than 1.When using my source tree model with table structure data, it works right.
Even though I used the tree model of official sample program ("editabletreemodel") in TreeView, proxy model still appears assert error "last < columnCount(parent)" when hiding the last column. It works right in QTreeView but TreeView.
I thought this bug is most likely comes from the TreeView.
Thanks for watching.