I’m not deeply familiar with the Qt Python API, but it seems you would need to use the self.filename[0].name attribute.
PS: You might get a better and faster answer on StackOverflow or a Qt support forum, as these errors are unrelated to PyTorch.