如题,我把编译好的文件test和配置文件test.conf一起放在一个目下比如/test/hui,如果我进入到这个目下启动test一点问题都没有,如果从根目下这样启动的话:/test/hui/test 就会提示说打不开test.conf。我的代码部分是这样写的
QFile file("test.conf");
if(!file.open(QIODevice::ReadOnly))
{
qDebug()<<"cannot open file for reading";
return;
}
QTextStream in(&file);
while(!in.atend)
{
Qstring a=in.readline();
qDebug()<<a;
}
请教高手,这个问题该怎么解决
[ 此帖被shiroki在2009-08-22 21:24重新编辑 ]