I have problem with the creation of dir with Qt.
I would like to create a dir in documents’dir so, I make some things like that :
QString path("C:/Users/Me/Documents/MyApp/profiles/");
Qdir dir = QDir::root();
dir.mkdir(path);
But that doesn’t work! I have test with “/” and “\” for the separators but in the two cases that not work.
How I can create my dir?
Thank you.
Instead of using
dir.mkdir(), try to useQDir::mkpath;i.e. as
dir.mkpath(path);