Qt 获取文件路径、文件名、后缀

 1 QString file_full, file_name, file_path,file_suffix ;
 2 QFileInfo fileinfo;
 3 file_full = QFileDialog::getOpenFileName(this,.....);
 4 fileinfo = QFileInfo(file_full);
 5 //文件名
 6 file_name = fileinfo.fileName(); 
 7 //文件后缀
 8 file_suffix = fileinfo.suffix()
 9 //绝对路径
10 file_path = fileinfo.absolutePath();

 

上一篇:5.1.5 SELECT+FULLJOIN读取数据


下一篇:Numpy库基础