PDA

View Full Version : problems when reading files (problems with .pro)



lhdgriver
23rd July 2010, 14:38
QFile file("D:\\Qt\\test\\out.txt");

when i use the absolutePath, it works all right

but when i use
QFile file("./out.txt");
i seems that i can't read the file

out.txt and the code are in the same dir

how to solve the problem with relative path

THX

Lykurg
23rd July 2010, 14:42
Well obviously your executable and your text file aren't in the same folder. See Current working directory for a possible solution.

lhdgriver
23rd July 2010, 15:53
i've solved the problem myself. a totally newbie's problem, maybe

edit the .qrc file and all problems are gone

:p