I have the following code in which i want to check if there are any sub directories exist. I expect the canFetchMore() fn to return true(since root directory contains sub directories). But it returns false. Is there any other fn to be called before calling canFetchMore() fn.
QFileSystemModel model;
model.setFilter(QDir::AllDirs);
model.setRootPath("/");
QModelIndex index = model.index(model.rootPath());
qDebug()<<index.child(0,0).isValid()<<model.canFetchMore(index)<<index;
I have tried using hasChildren() fn and it returns always true irrespective of the folder contains sub-dirs or not.