And the open for write fails because you are using it on file in a Qt resource, not on a file on disk.

Cheers,
_