1、获取执行文件路径
- #include <QCoreApplication.h>
- QCoreApplication::applicationDirPath();
2、获取工程路径
- #include <qdir.h>
- QDir dir;
- QString pathDB = dir.currentPath();
FROM: http://blog.csdn.net/qyee16/article/details/9713091