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

23rd July 2010, 13: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


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

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

edit the .qrc file and all problems are gone