Solved QFileSystemModel not updating on insertion of removable disc
-
Using Qt5.5.1 on Win8.1 64bit (MSVC2013), I have a QFileSystemModel attached to a QTreeView.
It works quite well to instantly reflect changes made with Windows like deleting, adding, renaming folders and files:
QTreeView tree = new QTreeView(this); QFileSystemModel dirModel = new QFileSystemModel(this); dirModel->setRootPath(dirModel->myComputer().toString()); tree->setModel(dirModel);
The problem is, if I attach an external USB drive, I'd expect the file-system model to reflect the new drive. But it doesn't. What am I doing wrong?
-
Qt support has informed me that this is a known bug in Windows and there is no solution at this time. A workaround is to destroy and recreate the model.