C++程序如何获得自身路径(Qt源码)

来源:互联网 发布:手机怎么发送淘宝链接 编辑:程序博客网 时间:2024/05/01 06:04
QString QCoreApplication::applicationFilePath () [static]Returns the file path of the application executable.For example, if you have installed Qt in the /usr/local/qt directory, and you run the regexp example, this function will return "/usr/local/qt/examples/tools/regexp/regexp".Warning: On Linux, this function will try to get the path from the /proc file system. If that fails, it assumes that argv[0] contains the absolute file name of the executable. The function also assumes that the current directory has not been changed by the application.