From 7c5475f1c03a4b9d6c023bc7ff937e1fc2f62271 Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Thu, 19 Oct 2017 10:07:50 +0200 Subject: Doc: add hint about QMimeDatabase to QImageReader::canRead() Task-number: QTBUG-63568 Change-Id: I5b700138487dbebfc8cbe70eb3a076efceafb361 Reviewed-by: Venugopal Shivashankar --- src/gui/image/qimagereader.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/gui/image/qimagereader.cpp') diff --git a/src/gui/image/qimagereader.cpp b/src/gui/image/qimagereader.cpp index 381ddb5b45..f49e90ba0a 100644 --- a/src/gui/image/qimagereader.cpp +++ b/src/gui/image/qimagereader.cpp @@ -1211,10 +1211,13 @@ float QImageReader::gamma() const see if the image data is valid. read() may still return false after canRead() returns \c true, if the image data is corrupt. + \note A QMimeDatabase lookup is normally a better approach than this + function for identifying potentially non-image files or data. + For images that support animation, canRead() returns \c false when all frames have been read. - \sa read(), supportedImageFormats() + \sa read(), supportedImageFormats(), QMimeDatabase */ bool QImageReader::canRead() const { -- cgit v1.2.3 From 4e339a5ac1c3ef721d040dd88d84adc9930626c7 Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Fri, 16 Jun 2017 14:27:19 +0200 Subject: Doc: QImageReader assumes exclusive control over its device Make an explicit mention of the fact that modifying a device while it is being held by a QImageReader is undefined. Task-number: QTBUG-61121 Change-Id: Ie0a016255c2614c5b8b415c8cd9602169153c8f8 Reviewed-by: Paul Olav Tvete --- src/gui/image/qimagereader.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/gui/image/qimagereader.cpp') diff --git a/src/gui/image/qimagereader.cpp b/src/gui/image/qimagereader.cpp index f49e90ba0a..e1089936c2 100644 --- a/src/gui/image/qimagereader.cpp +++ b/src/gui/image/qimagereader.cpp @@ -72,6 +72,11 @@ that occurred, or errorString() to get a human readable description of what went wrong. + \note QImageReader assumes exclusive control over the file or + device that is assigned. Any attempts to modify the assigned file + or device during the lifetime of the QImageReader object will + yield undefined results. + \section1 Formats Call supportedImageFormats() for a list of formats that -- cgit v1.2.3