If this is folder is a temporary location, you could use QTemporaryDir instead and let it handle the cleanup.

Cheers,
_