Get current working directory in a Qt application

后端 未结 5 1663
春和景丽
春和景丽 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条回答
  •  -上瘾入骨i
    2020-12-05 00:16

    Have you tried QCoreApplication::applicationDirPath()

    qDebug() << "App path : " << qApp->applicationDirPath();
    

提交回复
热议问题