Hi,
I'm still stuck with that issue. I'm expecting a directoryLoaded() signal after I called fetchMore() and it never comes.
A directoryLoaded() is emited when I expand an item in the QtreeView though, so I decided to look into QtreeView.cpp to see how the fetchMore() calls are implemented.
I looked at the expand all implementation, because it is very close to what I want to acheive after all. (Expand all the items under a user checked item)
Actually QTreeView::expandAll() calls a generic member of its private Class, QTreeViewPrivate::layout(int i, bool recursiveExpanding, bool afterIsUninitialized), which runs recursively and which calls fetchmore()
as follows:
int count = 0;
if (model->hasChildren(parent)) {
if (model->canFetchMore(parent))
model->fetchMore(parent);
count = model->rowCount(parent);
}
int count = 0;
if (model->hasChildren(parent)) {
if (model->canFetchMore(parent))
model->fetchMore(parent);
count = model->rowCount(parent);
}
To copy to clipboard, switch view to plain text mode
I don't get it. I've seen in several other threads pepole complaining about unexpected rowcount() returned values. And the given explanation for that behavior was the asynchorneous nature of the QFileSystemModel data update process. (The data is still being updated when rowCount() is called.)
That was the all point of what I'm trying to do, making sure that the data is updateed when I call fetchmore(). (See code in my previous message)
By looking a the QtreeVieww implementation, rowCount() is called right after fetchMore(). It doesn't seem to be a problem, execpt that when I try the same implentation in my code I end up with the same unexpected count value. And when I try to detect directoryLoaded() after calling fetchmore(), I never get it... I'm stuck!
Could someone help me with that? Thanks
Bookmarks