From 6e03d17f2fad80c52bdb4f146b7addb89d042d12 Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Wed, 16 Sep 2020 17:35:02 +0200 Subject: [PATCH] QDir: add note to docs about isAbsolutePath(":foo") returning true As can be seen in the _q_resolveEntryAndCreateLegacyEngine_recursive method in QFileSystemEngine, paths starting with ':' are treated as QResources, which means that from QFileInfo's POV they're "not relative", which is why QDir::isAbsolutePath would return true. Change-Id: I701d08ce43ea707bc34c928e39bea0b83597a4b6 Reviewed-by: Volker Hilsheimer (cherry picked from commit 0da5726a43b21d1532720c8cd3c687cc2373cd2b) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/io/qdir.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index f7778943c91..5c14d8ffb30 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -1707,7 +1707,11 @@ bool QDir::isRoot() const Returns \c true if \a path is absolute; returns \c false if it is relative. - \sa isAbsolute(), isRelativePath(), makeAbsolute(), cleanPath() + \note If \a path starts with ':', this function will return \c true + because paths starting with ':' are treated specially as they denote + a QResource. + + \sa isAbsolute(), isRelativePath(), makeAbsolute(), cleanPath(), QResource */ /*!