Get current working directory in a Qt application

后端 未结 5 1664
春和景丽
春和景丽 2020-12-04 23:13

I\'m writing a program in C++ using the Qt library. There is a symbolic link in my home bin directory to the executable. I would like the current working directory of my pro

5条回答
  •  独厮守ぢ
    2020-12-05 00:15

    Just tested and QDir::currentPath() does return the path from which I called my executable.

    And a symlink does not "exist". If you are executing an exe from that path you are effectively executing it from the path the symlink points to.

提交回复
热议问题