PDA

View Full Version : Finding source dir path



Niamita
7th November 2011, 08:14
Hi all
I have an application which i have to run on another machine for which i create its .exe file. In this application i am setting name of labels from xml file, so i can change name of labels as required at run time. When i execute .exe file on another machine and open it and try to chane in xml, no change reflact in exe file. I stored xml file in the same directory as .exe file.

How i have to set file path so that changes reflact.
I am setting path like "E:\label.xml"
I try through QDir::currentPath() it is giving me the path of target directory(E:\SmartHome_Xml-build-desktop\debug\). My source dir and target dir are different.

What i should do to reflact changes in exe file when it is running on another machine.
Thanks.

MaKo
7th November 2011, 08:23
You want to know the directory where the EXE is? How about QApplication::applicationFilePath() to get the name, and extract the directory with canonicalPath() method?