windowsqt-creator

QtCreator on Windows intermittent file access failures


When running Qt Creator (v14.x, but also seen on previous versions) on Windows 10, it occasionally pops up warnings like this for various files.

Cannot write file C:\Users\xxxxxx\AppData\Roaming\QtProject\qtcreator\default.qws: Access is denied.

It's not consistent, even within the same session. If I just retry whatever it was complaining about a few times, it'll eventually work and saves the file. Running as admin also doesn't fix the problem. So this isn't a simple permissions problem, there's some timing component involved. Maybe Windows or anti-virus is taking too long to verify permissions?


Solution

  • After some digging, ran across this unresolved bug from all the way back in 2020 (v4.x):

    QTCREATORBUG-24351

    The work-around is to relocate where Qt Creator's settings are located by using the -settingspath option.

    If you don't want to lose your current settings, you'll need to move them to the new path.

    For example, I moved my settings to my D:\Qt\settings directory...

    edit: After making this change, the problem went away for the QtCreator AppData configuration files, but then I started having permission problems on the project *.user files. I ended up also moving my projects to a new location, and that seemed to fix that part of it. Have had 0 problems since these changes. Don't know if just moving from my C: drive to D: drive solved the problem, or if its some generic issue with the way QtCreator accesses AppData. Haven't seen this problem in any other apps.