Use QFileInfo::fileName() to get the filename, since that also works when the original path wasn't canonical.