summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qdir.cpp
diff options
context:
space:
mode:
authorAhmad Samir <a.samirh78@gmail.com>2020-12-28 15:01:53 +0200
committerAhmad Samir <a.samirh78@gmail.com>2021-01-08 18:13:42 +0200
commit138fa9f2f4445832769a126a8ea72686b3687933 (patch)
tree37882e5be9a89af3a1b5101dea8cc410daadea80 /src/corelib/io/qdir.cpp
parentd5a980df97051dea4b952a1f7c9558316454ccf0 (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/qdir.cpp')
-rw-r--r--src/corelib/io/qdir.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp
index 9dd0f4ac1d..5158029c6e 100644
--- a/src/corelib/io/qdir.cpp
+++ b/src/corelib/io/qdir.cpp
@@ -409,6 +409,9 @@ inline void QDirPrivate::initFileEngine()
a QDir is using a relative or an absolute file path. Call
makeAbsolute() to convert a relative QDir to an absolute one.
+ \note Paths starting with a colon (\e{:}) are always considered
+ absolute, as they denote a QResource.
+
\section1 Navigation and Directory Operations
A directory's path can be obtained with the path() function, and
@@ -1690,6 +1693,9 @@ bool QDir::isRoot() const
Returns \c true if the directory's path is absolute; otherwise
returns \c false. See isAbsolutePath().
+ \note Paths starting with a colon (\e{:}) are always considered
+ absolute, as they denote a QResource.
+
\sa isRelative(), makeAbsolute(), cleanPath()
*/
@@ -1699,9 +1705,8 @@ bool QDir::isRoot() const
Returns \c true if \a path is absolute; returns \c false if it is
relative.
- \note If \a path starts with ':', this function will return \c true
- because paths starting with ':' are treated specially as they denote
- a QResource.
+ \note Paths starting with a colon (\e{:}) are always considered
+ absolute, as they denote a QResource.
\sa isAbsolute(), isRelativePath(), makeAbsolute(), cleanPath(), QResource
*/
@@ -1711,6 +1716,9 @@ bool QDir::isRoot() const
false. (Under Unix a path is relative if it does not start with a
"/").
+ \note Paths starting with a colon (\e{:}) are always considered
+ absolute, as they denote a QResource.
+
\sa makeAbsolute(), isAbsolute(), isAbsolutePath(), cleanPath()
*/
bool QDir::isRelative() const
@@ -2349,6 +2357,9 @@ QString QDir::cleanPath(const QString &path)
Returns \c true if \a path is relative; returns \c false if it is
absolute.
+ \note Paths starting with a colon (\e{:}) are always considered
+ absolute, as they denote a QResource.
+
\sa isRelative(), isAbsolutePath(), makeAbsolute()
*/
bool QDir::isRelativePath(const QString &path)