目录
首先假如我们有一个程序exe在下面目录:
C:/Qt/examples/tools/regexp/regexp.exe
我们如何获取相应意义的路径呢?请看下面:
1. 程序所在目录
QString QCoreApplication::applicationDirPath()
那么 qApp->applicationDirPath() 的结果是:
输出:C:/Qt/examples/tools/regexp
目录
首先假如我们有一个程序exe在下面目录:
C:/Qt/examples/tools/regexp/regexp.exe
我们如何获取相应意义的路径呢?请看下面:
QString QCoreApplication::applicationDirPath()
那么 qApp->applicationDirPath() 的结果是:
输出:C:/Qt/examples/tools/regexp