From 441ad9b938d453ccf5bff8867e7d3e6e432f9eba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Martins?= Date: Fri, 28 Jul 2017 16:48:35 +0100 Subject: Improve documentation for {QFile, QFileDevice}::resize() - Warn that they can fail if used on non-existent files - Fixed random garbage Change-Id: Ie58aac4a9f4479332ef07d39aecc136b1cfa58e1 Reviewed-by: Thiago Macieira --- src/corelib/io/qfile.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/corelib/io/qfile.cpp') diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp index f7e711a7cf..64d34aec59 100644 --- a/src/corelib/io/qfile.cpp +++ b/src/corelib/io/qfile.cpp @@ -1038,11 +1038,13 @@ bool QFile::resize(qint64 sz) /*! \overload - Sets \a fileName to size (in bytes) \a sz. Returns \c true if the file if + Sets \a fileName to size (in bytes) \a sz. Returns \c true if the resize succeeds; false otherwise. If \a sz is larger than \a fileName currently is the new bytes will be set to 0, if \a sz is smaller the file is simply truncated. + \warning This function can fail if the file doesn't exist. + \sa resize() */ -- cgit v1.2.3