QString current_path = QCoreApplication::applicationDirPath();QString getRelativePath(QString filepath) //将绝对路径转成相对路径{if (!filepath.contains(current_path)) //current_path为相对路径 {return filepath;}else{filepath.replace(current_path, "");QString relative_path = "." + filepath;return relative_path;}}
700字范文,内容丰富有趣,生活中的好帮手!