diff options
author | Ahmad Samir <a.samirh78@gmail.com> | 2020-12-28 15:01:53 +0200 |
---|---|---|
committer | Ahmad Samir <a.samirh78@gmail.com> | 2021-01-08 18:13:42 +0200 |
commit | 138fa9f2f4445832769a126a8ea72686b3687933 (patch) | |
tree | 37882e5be9a89af3a1b5101dea8cc410daadea80 /src/corelib/io/qfileinfo.cpp | |
parent | d5a980df97051dea4b952a1f7c9558316454ccf0 (diff) |
QDir/QFileInfo: add doc notes about paths starting with ':'
This is an addendum to commit 0da5726a43b; making the note about paths
starting with ':' being treated as absolute paths by the underlying
QFileSystemEngine, more visible, so that users of the class don't hit
that pitfall.
Add similar docs to QFileInfo.
Pick-to: 5.15 6.0
Change-Id: Ib34d066d31bb673d340ec41422ed4daf911765b8
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'src/corelib/io/qfileinfo.cpp')
-rw-r--r-- | src/corelib/io/qfileinfo.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp index 4b81467687..955e52337f 100644 --- a/src/corelib/io/qfileinfo.cpp +++ b/src/corelib/io/qfileinfo.cpp @@ -241,6 +241,9 @@ QDateTime &QFileInfoPrivate::getFileTime(QAbstractFileEngine::FileTime request) path. You can call the function makeAbsolute() to convert a relative QFileInfo's path to an absolute path. + \note Paths starting with a colon (\e{:}) are always considered + absolute, as they denote a QResource. + The file that the QFileInfo works on is set in the constructor or later with setFile(). Use exists() to see if the file exists and size() to get its size. @@ -634,17 +637,23 @@ QString QFileInfo::path() const /*! \fn bool QFileInfo::isAbsolute() const - Returns \c true if the file path name is absolute, otherwise returns - false if the path is relative. + Returns \c true if the file path is absolute, otherwise returns \c false (i.e. + the path is relative). + + \note Paths starting with a colon (\e{:}) are always considered absolute, as + they denote a QResource. \sa isRelative() */ /*! - Returns \c true if the file path name is relative, otherwise returns - false if the path is absolute (e.g. under Unix a path is absolute + Returns \c true if the file path is relative, otherwise returns \c + false (i.e. the path is absolute). (E.g. under Unix a path is absolute if it begins with a "/"). + \note Paths starting with a colon (\e{:}) are always considered absolute, + as they denote a QResource. + \sa isAbsolute() */ bool QFileInfo::isRelative() const |