I have a Model that I've built that represents a tree of nodes (parented children which are key/value pairs, the default role returning the key), very similar to the simple example provided. When I connect it to a QTreeView, I can expand the tree, collapse it, select it, edit it... basically anything one would expect.
If, however, I instance a QSortFilterProxyModel with my model as the source, and pass that instance to the QTreeView, as soon as I try to expand any node, the application blows up with
warning: ASSERT failure in QVector<T>::at: "index out of range",
file C:/Qt/4.1.0/include/QtCore/../../src/corelib/tools/qvector.h, line 211
warning: ASSERT failure in QVector<T>::at: "index out of range",
file C:/Qt/4.1.0/include/QtCore/../../src/corelib/tools/qvector.h, line 211
To copy to clipboard, switch view to plain text mode
I've run it though a debugger, but I'm not proficient enough with the internals of Qt to figure out the magic going on inside of the QSortFilterProxyModel. Right now, it should just be acting as a one-to-one map, because I've done nothing more than set my model as the source, and it as the model for the QTreeView.
What I have seen is that it occurs when the request comes from qitemdelegate.cpp looking for the Qt::SizeHintRole (line 258).
Any suggestions would be very welcome!
Thanks!
Gary
Bookmarks