I need to delete the file or the folder in any directory. How can I do that? What libraries need to connect?
2 answers
In Qt, you can use QFile :: remove () and QDir :: removeRecursively () to remove files and folders, respectively.
QDir dir("mydir"); dir.removeRecursively(); QFile file("somefile.txt"); file.remove(); // или используя статический метод QFile::remove("somefile2.txt"); |
Or use the filesystem from the standard library - remove() .
|