Path2 is get into the folder path where you need to create a new file
Path2=path2 + + qStr '/';
QFile savefile (path2);
Manually rewrite the path will be a problem
CodePudding user response:
The look in the full path is hit, or debug it and see what is error?CodePudding user response:
No wrong, is unable to generate the file, the full path belowCodePudding user response:
You have to open, then writeCodePudding user response:
Is there a call Open?
Void the write (QString filename)
{
QFile file (filename);
if(! File. The open (QFile: : WriteOnly | QFile: : Text))
{
QDebug () & lt; <"Could not open file for writing";
return;
}
QTextStream out (& amp; The file);
The out & lt; <"QFile Tutorial";
File. The flush ();
File. The close ();
}