Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.1.0 , 5.1.1
-
Windows 7 64-bit
Description
I have a QFileSystemModel with a QTreeView to view and edit files and folders on my hard drive. I have the QFileSystemModel read only set to false so I can rename folders.
Problem:
I have a folder 'A' open in the QTreeView. I can drag a file using Windows Explorer into folder 'A' and I can see this file in my QTreeView. This works as expected.
However, if I rename the folder to 'B' in the QTreeView (using F2), when I drag a file into 'B' using Windows Explorer it no longer shows up in QTreeView.
The fileRenamed signal is being triggered from QFileSystemModel and the folder is being renamed correctly.
The QFileSystemModel documentation states that there is a QFileSystemWatcher installed to watch the file system. The documentation for QFileSystem states:
"QFileSystemWatcher stops monitoring files once they have been renamed or removed from disk, and directories once they have been removed from disk."
What I am observing is that QFileSystemWatcher stops monitoring directories after they have been renamed, which is not consistent with the documentation.
In addition, I cannot find a simple way to tell the internal QFileSystemWatcher to start watching the renamed folder again.
Attachments
Gerrit Reviews
For Gerrit Dashboard: QTBUG-33720 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
248958,2 | QFileSystemModel: Remove watch path when directory is removed or renamed | 5.12 | qt/qtbase | Status: NEW | -1 | 0 |
248959,2 | QFileSystemModel: Update watcher when renaming directory with setData() | 5.12 | qt/qtbase | Status: NEW | -1 | 0 |