QFile
has a static function
bool QFile::remove ( const QString & fileName ) [static]
which deletes the specified file. This is handy: we have a path to file, and we use a command to remove it. However, QDir
does not have such command, only this one:
bool QDir::rmdir ( const QString & dirName ) const
which is non-static and hence demands an object. So I'm forced to do ugly things like
QDir().rmdir(path)
This is disgusting. Am I missing something?
You can derive the class QDir and add your static method.