Priority: P2: Important
Affects Version/s: 5.9, 5.12.0
Fix Version/s: None
Component/s: Core: Item Models
Environment:Windows 10, Qt 5.12 and Qt 5.9.3, but also observed in many other versions
My example is the standard Qt example from here: http://doc.qt.io/qt-5/qtwidgets-itemviews-editabletreemodel-example.html
It is also delivered with every qt installation, e.g. C:\Qt\Qt5.12.0\Examples\Qt-5.12.0\widgets\itemviews\editabletreemodel
When just executed, it works fine, but now lets insert a QSortFilterProxyModel, just to make it sortable. We change the MainWindow c'tor to
TreeModel* model = new TreeModel(headers, file.readAll());
QSortFilterProxyModel* sort = new QSortFilterProxyModel( this );
sort->setSourceModel( model );
view->setModel( sort );
Now execute the example, expand one or two of the root nodes and select the menu entry "insert column" you will see, that only the root nodes have a new column, all their children do not have the new column. It works without the proxy.
Adjusting the example by emitting begin/end inster columns for every parent node will fix this bug at first glance. But further working with the example showas strange behaviour, so the model seems to be still broken.