filePath()
Doesn't specifically say if the path is canonical or absolute. One has to infer from thisReturns the path name of a file in the directory. Does not check if the file actually exists in the directory; but see exists(). If the QDir is relative the returned path name will also be relative. Redundant multiple separators or "." and ".." directories in fileName are not removed (see cleanPath()).
https://www.copperspice.com/docs/cs_api/class_qdir.html#ae25e9ecdcba02599aa1fdaa5e8599be0
absoluteFilePath()
and thisReturns the absolute path name of a file in the directory. Does not check if the file actually exists in the directory; but see exists(). Redundant multiple separators or "." and ".." directories in fileName are not removed (see cleanPath()).
https://www.copperspice.com/docs/cs_api/class_qdir.html#a77406c9757ae161332c2dc1640f0be64
canonicalPath()
Per the documentation, QDir does not appear to provide a canonicalFilePath( QString fileName) method, but it should, if for no other reason, consistency.Returns the canonical path, i.e. a path without symbolic links or redundant "." or ".." elements.
On systems that do not have symbolic links this function will always return the same string that absolutePath() returns. If the canonical path does not exist (normally due to dangling symbolic links) canonicalPath() returns an empty string.
While I'm looking at it, there exists a toNativeSeparators( QString path) and a fromNativeSeparators( QString path) but no toCanonicalSeparators( QString path)
Yes, Qt 5.15.whatever doesn't have the ability to have QDir() generate a full canonical path name for a file and it has long been an issue. There is too much code around the world thumping in a "/" + fileName when the class should be able to do it just like it does for absolute.