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

bool QImageWriter::supportsOption ( QImageIOHandler::ImageOption  option  )  const

Returns true if the writer supports option; otherwise returns false.

Different image formats support different options. Call this function to determine whether a certain option is supported by the current format. For example, the PNG format allows you to embed text into the image's metadata (see text()).

doc/src/snippets/code/src_gui_image_qimagewriter.cpp 2

Options can be tested after the writer has been associated with a format.

See also:
QImageReader::supportsOption(), setFormat()

Definition at line 616 of file qimagewriter.cpp.

    if (!d->handler && (d->handler = createWriteHandlerHelper(d->device, d->format)) == 0) {
        d->imageWriterError = QImageWriter::UnsupportedFormatError;
        d->errorString = QT_TRANSLATE_NOOP(QImageWriter,
                                           QLatin1String("Unsupported image format"));
        return false;

    return d->handler->supportsOption(option);

Generated by  Doxygen 1.6.0   Back to index