QFile::moveToTrash(path) works with absolute path but not with relative path on Windows.
#include <QDebug>
#include <QFile>
int main()
{
QString fn = "aaa.txt";
{
QFile f(fn);
f.open(QFile::WriteOnly);
}
qDebug() << QFile::moveToTrash(fn);
}
This outputs false but when absolute path is used, the same code outputs true.
| For Gerrit Dashboard: QTBUG-84015 | ||||||
|---|---|---|---|---|---|---|
| # | Subject | Branch | Project | Status | CR | V |
| 299513,4 | QFile::moveToTrash: work with relative file paths on Windows | dev | qt/qtbase | Status: MERGED | +2 | 0 |
| 300984,2 | QFile::moveToTrash: work with relative file paths on Windows | 5.15 | qt/qtbase | Status: MERGED | +2 | 0 |