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.
C++程序如何获得自身路径(Qt源码)
最新推荐文章于 2024-04-30 10:58:01 发布
本文介绍了如何使用QStringQCoreApplication::applicationFilePath()静态方法来获取应用程序执行文件的完整路径。例如,在Linux环境下安装了Qt并运行正则表达式示例程序时,此函数将返回相应的绝对路径。

4581

被折叠的 条评论
为什么被折叠?



