Make sure you have Games folder in C:/
[check programmatically whether QDir().exists("C:/Games/) is returning true ].
And also make sure that your C:/
Folder doesn't have any file named Games, Because if you have file with same name, the exists function will return false even if the folder is present!
. And mkdir
will return false!!!
Following piece of code should create the specified directory if its not present.
if (QDir().exists("C:/Games/MyGame"))
{
qDebug()<<dir.absolutePath() + " exists";
}
else
{
QDir().mkdir("C:/Games/MyGame");
}