From 25c1eaa9b11653e5b03319fc58529c5107f98813 Mon Sep 17 00:00:00 2001 From: Andreas Hartmetz Date: Thu, 19 Jan 2023 23:54:03 +0100 Subject: [PATCH] Document the shortcut isFile() for "exists and is a file" One can figure out that something needs to exist in order to be a file, I guess, but the documentation carefully avoided mentioning it. So mention it. Change-Id: I5094d6cb88ce2e58f48d8978c9b858d19d209f92 Reviewed-by: Thiago Macieira --- src/corelib/io/qfileinfo.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp index da4cf20b0e..49573347ca 100644 --- a/src/corelib/io/qfileinfo.cpp +++ b/src/corelib/io/qfileinfo.cpp @@ -1008,7 +1008,8 @@ bool QFileInfo::isNativePath() const /*! Returns \c true if this object points to a file or to a symbolic link to a file. Returns \c false if the - object points to something which isn't a file, such as a directory. + object points to something that is not a file (such as a directory) + or that does not exist. If the file is a symlink, this function returns true if the target is a regular file (not the symlink). @@ -1026,7 +1027,9 @@ bool QFileInfo::isFile() const /*! Returns \c true if this object points to a directory or to a symbolic - link to a directory; otherwise returns \c false. + link to a directory. Returns \c false if the + object points to something that is not a directory (such as a file) + or that does not exist. If the file is a symlink, this function returns true if the target is a directory (not the symlink).