Exclude BMP from supported formats if it disabled by Qt build

If Qt build without BMP support, we need exclude this format
from output of QImageWriter::supportedImageFormats() and
QImageReader::supportedImageFormats() methods.

Task-number: QTBUG-27028

Change-Id: I44e8956247066c0836b1ff7bf9a1f356fe568af1
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
bb10
Poul Sysolyatin 2013-01-21 14:00:07 +07:00 committed by The Qt Project
parent 8995453263
commit 9d43288180
2 changed files with 6 additions and 0 deletions

View File

@ -167,7 +167,9 @@ enum _qt_BuiltInFormatType {
#ifdef QT_BUILTIN_GIF_READER
_qt_GifFormat,
#endif
#ifndef QT_NO_IMAGEFORMAT_BMP
_qt_BmpFormat,
#endif
#ifndef QT_NO_IMAGEFORMAT_PPM
_qt_PpmFormat,
_qt_PgmFormat,
@ -200,7 +202,9 @@ static const _qt_BuiltInFormatStruct _qt_BuiltInFormats[] = {
#ifdef QT_BUILTIN_GIF_READER
{_qt_GifFormat, "gif"},
#endif
#ifndef QT_NO_IMAGEFORMAT_BMP
{_qt_BmpFormat, "bmp"},
#endif
#ifndef QT_NO_IMAGEFORMAT_PPM
{_qt_PpmFormat, "ppm"},
{_qt_PgmFormat, "pgm"},

View File

@ -708,7 +708,9 @@ void supportedImageHandlerFormats(QFactoryLoader *loader,
QList<QByteArray> QImageWriter::supportedImageFormats()
{
QSet<QByteArray> formats;
#ifndef QT_NO_IMAGEFORMAT_BMP
formats << "bmp";
#endif
#ifndef QT_NO_IMAGEFORMAT_PPM
formats << "pbm" << "pgm" << "ppm";
#endif