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

void QImageWriter::setText ( const QString key,
const QString text 

Sets the image text associated with the key key to text. This is useful for storing copyright information or other information about the image. Example:

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

If you want to store a single block of data (e.g., a comment), you can pass an empty key, or use a generic key like "Description".

The key and text will be embedded into the image data after calling write().

Support for this option is implemented through QImageIOHandler::Description.

See also:
QImage::setText(), QImageReader::text()

Definition at line 517 of file qimagewriter.cpp.

References QString::simplified().

    if (!d->description.isEmpty())
        d->description += QLatin1String("\n\n");
    d->description += key.simplified() + QLatin1String(": ") + text.simplified();

Generated by  Doxygen 1.6.0   Back to index