Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
6.6.3
-
None
-
0211dfd92 (dev), cddf6498d (6.7), e409ae4fa (6.6)
Description
Despite the name, QFileInfo can also represent a directory. The behavior of methods like QFileInfo::path() can then be confusing, see e.g. https://forum.qt.io/topic/153585/correctly-create-qdir-from-qfileinfo/10
Suggestion: Make the distinction between (file) object and file in the documentation. This is done already partially. COmpare e.g.
> Returns the path of the object's parent directory as a QDir object.
vs
> Returns the file's path.
Also, make behavior of https://doc.qt.io/qt-6/qfileinfo.html#absoluteDir more explicit, e.g. with a code snippet.
Attachments
For Gerrit Dashboard: QTBUG-120688 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
539215,1 | QFileInfo: clarify the docs with respect to "file" == file system entry | tqtc/lts-6.5 | qt/tqtc-qtbase | Status: NEW | 0 | 0 |
532844,5 | QFileInfo: clarify the docs with respect to "file" == file system entry | dev | qt/qtbase | Status: MERGED | +2 | 0 |
536704,3 | QFileInfo: clarify the docs with respect to "file" == file system entry | 6.7 | qt/qtbase | Status: MERGED | +2 | 0 |
539173,2 | QFileInfo: clarify the docs with respect to "file" == file system entry | 6.6 | qt/qtbase | Status: MERGED | +2 | 0 |