Please nominate your Qt Champions for 2021!

[QT 4.7.4] [SOLVED] refresh the list of drives in the QFileSystemModel

  • Hi,
    I have a treeview that is used to display a list of directories/files. So this treeview is associated to a QFileSystemModel (in fact a derived class as I must perform some specific filtering). When I am creating an element under an existing directory, the treeview is automatically updated. According to the documentation I supposed that a QFileSystemWatcher is running somewhere even if I have not created it (I suppose that it is an automatic creation). But, when I am connecting (or disconnecting) an USB key the treeview is not updated. So how can I force the cache of the QFileSystemWatcher to update in this case (and by the way how can I have access to this object)?.

    Thanks for your answers

  • Ok,
    I finally found a way to do what I want. As I'm using my own model, I did a specific process for the root (myComputer) directory. In this case I populating "by hand", using QDir::drives() the content of the tree.

Log in to reply