Qt C++ remove a read only file in windows using

后端 未结 6 942
挽巷
挽巷 2021-02-19 04:19

I have set a file to be read-only (right click and check readonly). Now when I try to remove the file using the function bool QDir::remove(const QString & fileName)

6条回答
  •  时光取名叫无心
    2021-02-19 05:09

    I think you should use this:

    bool QFile::remove ( const QString & fileName ) [static]
    

    instead of this:

    QDir::remove ( const QString & fileName ) 
    

提交回复
热议问题