I need to remove one specific file. I have tried this:
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;
}
but unfortunately dbFile still exists. How I can remove "dbFile"?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With