# 参考:https://blog.csdn.net/chan_qx/article/details/50950371
#include <QFileInfo>
QFileInfo fileInfo(PATH); //绝对路径与相对路径都可以
QString absolute_path = fileInfo.absoluteDir(); //包含文件名的绝对路径
QString absolute_path_without_filename1 = fileInfo.absoluteDir().path(); //不包含文件名的绝对路径
QString absolute_path_without_filename2 = fileInfo.absolutePath(); //不包含文件名的绝对路径
QString filename = fileInfo.fileName(); //包含后缀的文件名
QString filename_without_suffix = fileInfo.baseName(); //不包含后缀的文件名
QString suffix = fileInfo.suffix(); //文件的后缀名