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?
After some digging, ran across this unresolved bug from all the way back in 2020 (v4.x):
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...
%APPDATA%\QtProject
directory. Note, copy the actual QtProject directory, not just it's content (so you end up with D:\Qt\settings\QtProject
).-settingspath "D:\Qt\settings"
to the 'target' field in the shortcut. Do NOT put QtProject into the path name, that's what Qt Creator adds internally. Put double quotes around the path, even if there are no spaces, I noticed the shortcut does wierd things if there's a Start in:
path also provided... it seems to get confused and just appends the two paths together for some odd reason... and it HAS to be double-quotes, when I tried single quotes it still didn't work.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.