[Development] New API design for file system operations

Volker Hilsheimer volker.hilsheimer at qt.io
Thu Feb 7 17:03:30 CET 2019

Hi all,

TL;DR; we are considering moving file system operations from QFile into a seperate class (or set of classes) for a more consistent and flexible way of moving, copying etc files and directories.

The conversation around the design and implementation of an API to move file or directory to the trash in https://bugreports.qt.io/browse/QTBUG-47703 has during the last days moved somewhat beyond that rather straight-forward task, and has become a broader discussion around making file operations accessible outside of the existing set of classes.

The relevant disussion starts here:


and I’d like to have a few more eyeballs on that (that ticket is already being watched by 30+ people, so I do anticipate some interest).

I’d like to strike the balance between an API that’s easy to use, can deal with both atomic (delete a file) and complex operations (such as copying a file, or moving files between file systems), but that at the same time allows Qt users to control how operations are performed (batching jobs, executing synchronously, or asynchronously with progress updates, perhaps the ability to cancel, rate limit in case of network traffic being involved etc).

Thoughts, ideas, and pointers to other frameworks that you believe provide a good API are welcome here in this email thread before moving to a dedicated JIRA ticket. Thiago mentioned the KIO framework as a source for inspiration; I had to deal with IFileManager when implementing moving to trash on Windows.

Would be great if we can come up with something that allows us to include the move-to-trash functionality in Qt 5.14.


More information about the Development mailing list