ディレクトリを削除する
環境:QT5.5
リンク
http://doc.qt.io/qt-5/qdir.html
インクルードファイル
#include
ディレクトリを削除する
ディレクトリを削除する。rmdirを使う場合は、ディレクトリ内は空である必要があります。
// "C:\programdata\test\ ディレクトリ削除
QDir dir("c:/progoramdaa");
dir.rmdir("test");
ディレクトリ内のファイル等もまとめて削除する
アプリケーションが実行するディレクトリ内の「Directory」ディレクトリとディレクトリに含まれる全てのディレクトリとファイルを削除する。
// ディレクトリ削除
QString strDirPath = QCoreApplication::applicationDirPath() + "/Directory";
QDir dir;
dir.setPath(strDirPath);
dir.removeRecursively();
コメント