How to get absolute path of current active project opened in qtCreator? Is there a way to do it anyway?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Qt only has support for
QDir::currentPathwhich will point to where the executable is, as far as I’m aware it’s got no hooks to be able to get information from Qt Creator. If your executable is being built in the same directory the project lives incurrentPath()will return it.EDIT: I’ll leave the part where I’m an idiot. Qt Creator has a set of API docs that point to
Core::FileManager::and another forUtils. There’s a number of functions in there for returning projects directory, what the current open file is, where it is and so on. There’s no explicit ‘what is the current absolute path’ as far as a quick scan goes, but there’s probably a way to query what’s currently open. The API docs are here: http://doc.qt.digia.com/qtcreator-extending/qtcreator-api.html