From d0e8341c9a1549dcf1625381a3681d1dca73e945 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Tue, 28 Jul 2009 22:08:25 +0200 Subject: Doc: Re-apply relevant change from 1368c210ef9976f68eb9fb1c3e4dc14f4fa4edd2 Clarified that the format used in QImage::fromData() is the image format, not the pixel format. --- src/gui/image/qimage.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index dd56765..e8ca7a9 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -4628,12 +4628,19 @@ bool QImage::loadFromData(const uchar *data, int len, const char *format) binary \a data. The loader attempts to read the image using the specified \a format. If \a format is not specified (which is the default), the loader probes the file for a header to guess the file format. + binary \a data. The loader attempts to read the image, either using the + optional image \a format specified or by determining the image format from + the data. - If the loading of the image failed, this object is a null image. + If \a format is not specified (which is the default), the loader probes the + file for a header to determine the file format. If \a format is specified, + it must be one of the values returned by QImageReader::supportedImageFormats(). + + If the loading of the image fails, the image returned will be a null image. + + \sa load(), save(), {QImage#Reading and Writing Image Files}{Reading and Writing Image Files} + */ - \sa load(), save(), {QImage#Reading and Writing Image - Files}{Reading and Writing Image Files} -*/ QImage QImage::fromData(const uchar *data, int size, const char *format) { QByteArray a = QByteArray::fromRawData(reinterpret_cast(data), size); -- cgit v0.12