Strange behavior on PathView
-
I'm observing a strange behavior on PathView. I'm using an AbstractItemModel as model for a PathView. The model is populated by using a QTimer after the initial app setup (after creating the view etc):
@void MyModel::loadItems(const QString &file)
{
QList<Item> items;
// Load, parse and put items into the list
beginResetModel();
m_items = items;
endResetModel();
}
@Sadly, this fails. The PathView shows no entries, but if I call setItems() before I create the declarative view it works.
What's really strange is that ListView works with the QTimer-solution. Any ideas?
-
Looks like PathView simply doesn't use reset signals. Have you tried with beginInsertRows()/endInsertRows() ?
-
PathView should work with the reset signals (autotest tst_QDeclarativePathView::resetModel() tests this). If you can provide an example to reproduce this (preferably in the "bug tracker":http://bugreports.qt.nokia.com) we can look into it further.
-
Ok, I have filed a bug on this which can be found at http://bugreports.qt.nokia.com/browse/QTBUG-13017
The bug report contains a small C++/Quick app which demonstrates the issue.
-
Tried by myself at Qt 4.7 beta1. Behavior is similar to what mario described. Maybe something with newer version can test (beta2 or not too old master build) and post results here?
-
mbrasser, this fix will appear at 4.7.0?