[Qt-interest] A problem with QFileSystemModel remove files

侍良栋 licesh at gmail.com
Sat Aug 21 08:38:10 CEST 2010


hi:

   I have implemented a simple file explorer with QFileSystemModel and
QListView. The directory is changed through QListVieww::setRootIndex(). For
example: there's a directory "D:/1/2/3/", I entered into "D:/1/2/3/" from
"D:/", then go up to "D:/". By now, the directory "D:/1/" and "D:/1/2/"
can't be removed from the xp system's explorer. However, I can remove
"D:/1/2/3/"
and can further remove"D:/1/2/" and "D:/1/". Only in this order, can the
whole directory "D:/1/" be removed. In this process, I also find that qt
output these warnings:

QFileSystemWatcher: failed to add paths: D:/1/2/3
QFileSystemWatcher: failed to add paths: D:/1/2

QFileSystemWatcher: failed to add paths: D:/1


when I use QFileSystemModel::rmdir() to remove D:/1/2/3/, returns true. but
the dir is still there unless this application is closed.
when I further remove "D:/1/2/", rmdir() returns false, and qt outputs:

QFileSystemWatcher: FindNextChangeNotification failed!! (????????).


I don't know how to solve this problem. How can I remove the files freely?


Thanks!


Liangdong shi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100821/93f49308/attachment.html 


More information about the Qt-interest-old mailing list