How to force create path if it not exists with QFile?

Qt Code:
  1. QFile f("/tmp/this/path/is/not/exists/test.php");
  2. if (!f.open(QIODevice::WriteOnly|QIODevice::Truncate)) {
  3. qDebug() << "Gagal:" << f.errorString();
  4. }
To copy to clipboard, switch view to plain text mode