Qt获取程序目录和工作目录

版权声明:未经博主允许,禁止转载 https://blog.csdn.net/Think88666/article/details/85056772
//获取exe所在的目录
qDebug()<<"current applicationDirPath: "<<QCoreApplication::applicationDirPath();
//获取当前进程所在工作目录
qDebug()<<"current currentPath: "<<QDir::currentPath();

注:工作目录和exe所在目录是两个完全不同的概念,这里有是有坑的,要注意区分

猜你喜欢

转载自blog.csdn.net/Think88666/article/details/85056772