admin管理员组文章数量:1355628
The Qt documentation says about QFileSystemModel::setRootPath()
:
Sets the directory that is being watched by the model to newPath by installing a file system watcher on it. Any changes to files and directories within this directory will be reflected in the model.
.html#setRootPath
Lets say I use setRootPath
in the following way:
auto model = new QFileSystemModel;
model->setRootPath("C:\\folder");
treeView->setModel(model);
According to the documentation, the model should now track changes in the specified path C:\\folder
. However, the model also tracks changes outside of C:\\folder
. Changes are tracked even on other disks.
Why is this happening? How to correctly understand the work of this method? If QFileSystemModel
monitors all paths that are visible in QTreeView
, then why does the model require a specific path to be monitored? After all, all paths are monitored anyway.
Similar question has been asked on stackoverflow before, but there were no answers. So I decided to ask my own question in the hope that someone else will see it.
本文标签: cQFileSystemModelsetRootPath behavior does not match documentation under WindowsStack Overflow
版权声明:本文标题:c++ - QFileSystemModel::setRootPath behavior does not match documentation under Windows - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744016876a2576491.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论