Qt Creator 내에서 동일한 빌드를 실행할 때와 Mac에서 Finder에서 두 번 클릭 할 때 두 개의 다른 경로가 표시됩니다. 여기 QDir absolutePath on Mac
내 코드입니다 : Qt는 창조주QDir dir = QDir::currentPath();
dir.cdUp();
dir.cdUp();
dir.cdUp();
QString rootPath = dir.absolutePath();
나는 그것을 실행 (디버그) 모드 내 경로는 다음과 같습니다
/사용자/참고 MyUser/프로젝트가/프로그램 응용/빌드/맥
/Users/myyser/Projects/AppName/build/mac에있는 파일을 찾기에서 두 번 클릭하면 /를 반환합니다.
두 가지 경로가 필요한 이유는 무엇입니까?
버전 : //qt-project.org/forums/viewthread/34019
Kuba Ober가 말했듯이 작업 디렉토리는 GUI 응용 프로그램에서 사용하지 마십시오. 바이너리가있는 경로를 원하면 http://qt-project.org/doc/qt-5/qcoreapplication을 사용하십시오.html # applicationDirPath –