How can we get the current working directory path ?
-
[quote author="Scylla" date="1331707050"]Please define "current working project", I don't know what you mean.[/quote]
Suppose the project i am currently running under Qt is "mainwindow". The mainwindow project is present in path "C:/Documents and setting/ Desktop / mainwindow". So i want to get this path.While i am using QDir::currentpath() i am getting "C:/Documents and setting/ Desktop /mainwindow/mainwindow.app/Contents/MacOS" as current path in MAC for that project. which is actually the application path not the current project path. So how could i get the only project path?
-
I don't think this is possible without passing any additional information, as the resulting binary has no information about the origin project structure.
@
// .proDEFINES += PROJECT_PATH="\"$$PWD\""
DEFINES += BUILD_PATH="\"$$OUT_PWD\""// .cpp
QString projectPath(PROJECT_PATH);
QString buildPath(BUILD_PATH);
@ -
[quote author="Lukas Geyer" date="1331710589"]I don't think this is possible without passing any additional information, as the resulting binary has no information about the origin project structure.
@
// .proDEFINES += PROJECT_PATH="\"$$PWD\""
DEFINES += BUILD_PATH="\"$$OUT_PWD\""// .cpp
QString projectPath(PROJECT_PATH);
QString buildPath(BUILD_PATH);
@[/quote]
thanks, this i was trying to get.