I'm writing a Qt GUI app.
I'm using QFileSystemModel
for local files, and I just learned that it doesn't work with mounted drives.
Yes, I can get all currently mounted drives by calling
view->setRootIndex(fileSystemModel->setRootPath(""));
But the problem is that the view connected to this model is not updated when drives get mounted or unmounted.
One of the things I can do is call QDir::drives()
every second or so to get the list of currently mounted drives. But I don't like this idea. Maybe you know a better one?