读书人

QFile 相对路径是不是存在文件

发布时间: 2013-10-22 16:16:51 作者: rapoo

QFile 相对路径是否存在文件
在我的执行文件夹内建了xml/monitor子文件夹 ,并判断 QString monitro_name;是否存在。
我使用if (!QFile::exists(":/xml/monitor/"+monitor_name)), 但还是无法判断,困恼好久了,
QFile  相对路径是不是存在文件
QFile  相对路径是不是存在文件
[解决办法]
看看以下几个路径就清楚了:

QDir::currentPath()

QCoreApplication::applicationFilePath()

读书人网 >QT开发

热点推荐