Important: Please read the Qt Code of Conduct -

QFileSystemModel populates QTreeView with all drives in system when only given C:/ drive as rootpath

  • I have been trying to understand how the QFileSystemModel works. In the demo "dirview" I can set the root path (setRootPath) to "C:/" and the view shows all the drives in the system, not just the C drive. It also updates when drive is added or removed. I am unclear what I signals I need to connect to in my own code. I am using my own view in QML. Looking through the documentation of QAbstractItemModel it is not clear to me what signals are needed for a basic view. All of them? So far my objects look at the index and populates what is below that index. I am unclear as to how to see all the drives using this method.

Log in to reply