Logo Search packages:      
Sourcecode: qt4-x11 version File versions  Download package

QList< QByteArray > QImageReader::supportedImageFormats (  )  [static]

Returns the list of image formats supported by QImageReader.

By default, Qt can read the following formats:

Format Description BMP Windows Bitmap GIF Graphic Interchange Format (optional) JPG Joint Photographic Experts Group JPEG Joint Photographic Experts Group MNG Multiple-image Network Graphics PNG Portable Network Graphics PBM Portable Bitmap PGM Portable Graymap PPM Portable Pixmap XBM X11 Bitmap XPM X11 Pixmap

To configure Qt with GIF support, pass -qt-gif to the configure script or check the appropriate option in the graphical installer.

See also:
setFormat(), QImageWriter::supportedImageFormats(), QImageIOPlugin

Definition at line 947 of file qimagereader.cpp.

References QList< T >::at(), QImageIOPlugin::capabilities(), QList< T >::count(), and QString::toLatin1().

Referenced by Q3ImageDrag::canDecode(), Q3ImageDrag::decode(), and QMovie::supportedFormats().

{
    QSet<QByteArray> formats;
    formats << "bmp";
#ifndef QT_NO_IMAGEFORMAT_PPM
    formats << "ppm" << "pgm" << "pbm";
#endif
#ifndef QT_NO_IMAGEFORMAT_XBM
    formats << "xbm";
#endif
#ifndef QT_NO_IMAGEFORMAT_XPM
    formats << "xpm";
#endif
#ifndef QT_NO_IMAGEFORMAT_PNG
    formats << "png";
#endif

#ifndef QT_NO_LIBRARY
    QFactoryLoader *l = loader();
    QStringList keys = l->keys();

    for (int i = 0; i < keys.count(); ++i) {
        QImageIOPlugin *plugin = qobject_cast<QImageIOPlugin *>(l->instance(keys.at(i)));
        if (plugin && plugin->capabilities(0, keys.at(i).toLatin1()) & QImageIOPlugin::CanRead)
            formats << keys.at(i).toLatin1();
    }
#endif // QT_NO_LIBRARY    

    QList<QByteArray> sortedFormats;
    for (QSet<QByteArray>::ConstIterator it = formats.constBegin(); it != formats.constEnd(); ++it)
        sortedFormats << *it;

    qSort(sortedFormats);
    return sortedFormats;
}


Generated by  Doxygen 1.6.0   Back to index