There is a QFileInfo class to retrieve the fileName.