, QFile
Linux-,
#include <QtCore>
int main(int argc, char** argv){
QFile some_file("test.xml");
if(!some_file.open(QIODevice::ReadOnly | QIODevice::Text)){
qDebug() << "Unable to open file";
} else {
qDebug() << "File open successfully";
}
exit(-1);
}
. /TestQFile, test.xml, .
UPDATE: , , , , , :
QFileInfo exec_fileinfo(argv[0]);
qDebug() << "Executable is in" << exec_fileinfo.absolutePath();
2: QtCreator . , QDir:: currentPath(), QtCreator.