Qt: What's the difference between remove() and rmdir()

584 Views Asked by At
QFileSystemModel* _dirModel = new QFileSystemModel(this);
.
.

_dirModel->rmdir(index);

_dirModel->remove(index);

"rmdir" seems to be made for removing directories, but I succesfully deleted directory with "remove" as well. What's the point of having "rmdir" while "remove" can do the same job?

1

There are 1 best solutions below

0
ymoreau On

From documentation :

  • QFileSystemModel::remove deletes the given file from the file system
  • QFileSystemModel::rmdir deletes the given directory from the file system.