title: Qt- Delete file
body: <p>I need to remove one specific file.
  I have tried this:</p>
  
  <pre><code>msgBox.setButtonText(QMessageBox::Ok , tr("Ok"));
  msgBox.setButtonText(QMessageBox::Cancel , tr("Cancel"));
  
  int ret = msgBox.exec();
  
  switch (ret)
  {
      case QMessageBox::Ok:
      {
      #ifdef Q_OS_IOS
          QStringList paths = QStandardPaths::standardLocations(QStandardPaths::DataLocation);
          QString dbFile = paths.first().append("/log.dat");
      #else
          QString dbFile = "log.dat";
      #endif
          QSettings settings(CGlobalZone::m_companyName, CGlobalZone::m_softwareName);
          settings.clear();
          QDir dir;
          dir.remove(dbFile);
  
          break;
  
      case QMessageBox::Cancel:
          QTimer::singleShot(1500, this, SLOT(close()));
          break;
  }
  </code></pre>
  
  <p><br>but unfortunately dbFile still exists. How I can remove "dbFile"?</p>