I was trying to create/save a file in qt creator with QFile.open(). But it is always creating/saving files in build folder of application. I have tried this code to change the dir to my directory which inside the directory where I have my source/header files.
QDir::setCurrent("/ui");
file.setFileName("tmp.ui");
QDir::setCurrent("/main/ui");
if (file.open(QIODevice::ReadWrite))
{
builder.save(&file, myDialog);
}
It creates the file tmp, but not in right directory. I would like to put relative directory. Any idea how I can reach it?