Special paths Dot and DotDot nor working anymore with Qt 6.8.0
-
Hello !
I had a project built with Qt 6.6.3 and using relative paths
"."and".."to get files from the executable directory.
But after switching to Qt 6.8.0, the relative paths start from my user folder!I didn't find anything in the 6.7 and 6.8 changelogs. Is it a bug fixed in the 6.8 patches? Or is it a bug happening only when the project is started from Qt Creator?
Thanks for your help!
-
Hello !
I had a project built with Qt 6.6.3 and using relative paths
"."and".."to get files from the executable directory.
But after switching to Qt 6.8.0, the relative paths start from my user folder!I didn't find anything in the 6.7 and 6.8 changelogs. Is it a bug fixed in the 6.8 patches? Or is it a bug happening only when the project is started from Qt Creator?
Thanks for your help!
@Maluna34 said in Special paths Dot and DotDot nor working anymore with Qt 6.8.0:
using relative paths "." and ".." to get files from the executable directory.
This is wrong. You should either use Qt resources or make sure it's absolute by e.g. using QCoreApplication::applicationDirPath().
using a relative path is wrong because you can't be sure what the current working directory is. It might even change (e.g. by using the QFileOpenDialog from windows) or by starting it from another path.
-
M Maluna34 has marked this topic as solved