Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.9, 5.12.0
-
None
-
Windows 10, Qt 5.12 and Qt 5.9.3, but also observed in many other versions
Description
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
...
QFile file(":/default.txt");
file.open(QIODevice::ReadOnly);
TreeModel* model = new TreeModel(headers, file.readAll());
file.close();
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.