How can i save my files in a specific directory ?
-
Hi everyone;
What to change in this line of code to save my files in a specific directory ?
auto filename = QFileDialog::getSaveFileName(this, "Save", QDir::rootPath(), "CSV File(*.csv)");
@imene
The one nameddir
for which you are presently passingQDir::rootPath()
?Note that this does not force the user to save in that directory, it starts them there but they could still navigate to a different directory if they want. Depends whether you have an absolute requirement.
-
@JonB ,
That's the point i want to sugguest a default Directory, than the user is free to save where ever he wants. -
@JonB sorry but i mean i want to sugguest path Directory not the default one that QDir::rootPath() lead to it.
-
Additionally, while you can specify any directory you want with that parameter, the QStandardPaths class may be useful if you want to specify the user's Documents or Desktop (and others) folder.