Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-84015

QFile::moveToTrash() does not accept relative path on Windows

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.15.1
    • 5.15.0 Beta4
    • Core: I/O
    • None
    • Windows 10
    • Windows
    • a033c23ddffed6b9bff3e7be68d513a7962c3b5e (qt/qtbase/dev) 40c571cd727cf0eb8523dc063030fa6cad57c8a3 (qt/qtbase/5.15)

    Description

      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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            vhilshei Volker Hilsheimer
            vladimir.kraus Vladimir Kraus
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes