CopperSpice API  1.8.2
QTextImageFormat Class Reference

The QTextImageFormat class provides formatting information for images in a QTextDocument. More...

Inheritance diagram for QTextImageFormat:
QTextCharFormat QTextFormat

Public Methods

 QTextImageFormat ()
qreal height () const
bool isValid () const
QString name () const
void setHeight (qreal height)
void setName (const QString &name)
void setWidth (qreal width)
qreal width () const
- Public Methods inherited from QTextCharFormat
 QTextCharFormat ()
QString anchorHref () const
QString anchorName () const
QStringList anchorNames () const
QFont font () const
QFont::Capitalization fontCapitalization () const
QString fontFamily () const
bool fontFixedPitch () const
QFont::HintingPreference fontHintingPreference () const
bool fontItalic () const
bool fontKerning () const
qreal fontLetterSpacing () const
QFont::SpacingType fontLetterSpacingType () const
bool fontOverline () const
qreal fontPointSize () const
int fontStretch () const
bool fontStrikeOut () const
QFont::StyleHint fontStyleHint () const
QFont::StyleStrategy fontStyleStrategy () const
bool fontUnderline () const
int fontWeight () const
qreal fontWordSpacing () const
bool isAnchor () const
bool isValid () const
void setAnchor (bool anchor)
void setAnchorHref (const QString &value)
void setAnchorName (const QString &name)
void setAnchorNames (const QStringList &names)
void setFont (const QFont &font)
void setFont (const QFont &font, FontPropertiesInheritanceBehavior behavior)
void setFontCapitalization (QFont::Capitalization capitalization)
void setFontFamily (const QString &family)
void setFontFixedPitch (bool fixedPitch)
void setFontHintingPreference (QFont::HintingPreference hintingPreference)
void setFontItalic (bool italic)
void setFontKerning (bool enable)
void setFontLetterSpacing (qreal spacing)
void setFontLetterSpacingType (QFont::SpacingType letterSpacingType)
void setFontOverline (bool overline)
void setFontPointSize (qreal size)
void setFontStretch (int factor)
void setFontStrikeOut (bool strikeOut)
void setFontStyleHint (QFont::StyleHint hint, QFont::StyleStrategy strategy=QFont::PreferDefault)
void setFontStyleStrategy (QFont::StyleStrategy strategy)
void setFontUnderline (bool underline)
void setFontWeight (int weight)
void setFontWordSpacing (qreal spacing)
void setTextOutline (const QPen &pen)
void setToolTip (const QString &text)
void setUnderlineColor (const QColor &color)
void setUnderlineStyle (UnderlineStyle style)
void setVerticalAlignment (VerticalAlignment alignment)
QPen textOutline () const
QString toolTip () const
QColor underlineColor () const
UnderlineStyle underlineStyle () const
VerticalAlignment verticalAlignment () const
- Public Methods inherited from QTextFormat
 QTextFormat ()
 QTextFormat (const QTextFormat &other)
 QTextFormat (int type)
 ~QTextFormat ()
QBrush background () const
bool boolProperty (int propertyId) const
QBrush brushProperty (int propertyId) const
void clearBackground ()
void clearForeground ()
void clearProperty (int propertyId)
QColor colorProperty (int propertyId) const
qreal doubleProperty (int propertyId) const
QBrush foreground () const
bool hasProperty (int propertyId) const
int intProperty (int propertyId) const
bool isBlockFormat () const
bool isCharFormat () const
bool isEmpty () const
bool isFrameFormat () const
bool isImageFormat () const
bool isListFormat () const
bool isTableCellFormat () const
bool isTableFormat () const
bool isValid () const
Qt::LayoutDirection layoutDirection () const
QTextLength lengthProperty (int propertyId) const
QVector< QTextLengthlengthVectorProperty (int propertyId) const
void merge (const QTextFormat &other)
int objectIndex () const
int objectType () const
 operator QVariant () const
bool operator!= (const QTextFormat &other) const
QTextFormat & operator= (const QTextFormat &other)
bool operator== (const QTextFormat &other) const
QPen penProperty (int propertyId) const
QMap< int, QVariantproperties () const
QVariant property (int propertyId) const
int propertyCount () const
void setBackground (const QBrush &brush)
void setForeground (const QBrush &brush)
void setLayoutDirection (Qt::LayoutDirection direction)
void setObjectIndex (int index)
void setObjectType (int type)
void setProperty (int propertyId, const QVariant &value)
void setProperty (int propertyId, const QVector< QTextLength > &value)
QString stringProperty (int propertyId) const
void swap (QTextFormat &other)
QTextBlockFormat toBlockFormat () const
QTextCharFormat toCharFormat () const
QTextFrameFormat toFrameFormat () const
QTextImageFormat toImageFormat () const
QTextListFormat toListFormat () const
QTextTableCellFormat toTableCellFormat () const
QTextTableFormat toTableFormat () const
int type () const


class QTextFormat

Additional Inherited Members

- Public Types inherited from QTextCharFormat
enum  FontPropertiesInheritanceBehavior
enum  UnderlineStyle
enum  VerticalAlignment
- Public Types inherited from QTextFormat
enum  FormatType
enum  ObjectTypes
enum  Property

Detailed Description

The QTextImageFormat class provides formatting information for images in a QTextDocument.

Inline images are represented by an object replacement character (0xFFFC in Unicode) which has an associated QTextImageFormat. The image format specifies a name with setName() that is used to locate the image. The size of the rectangle that the image will occupy is specified using setWidth() and setHeight().

Images can be supplied in any format for which CopperSpice has an image reader, so SVG drawings can be included alongside PNG, TIFF and other bitmap formats.

See also
QImage, QImageReader

Constructor & Destructor Documentation

QTextImageFormat::QTextImageFormat ( )

Creates a new image format object.

Method Documentation

qreal QTextImageFormat::height ( ) const

Returns the height of the rectangle occupied by the image.

See also
width(), setHeight()
bool QTextImageFormat::isValid ( ) const

Returns true if this image format is valid, otherwise returns false.

QString QTextImageFormat::name ( ) const

Returns the name of the image. The name refers to an entry in the application's resources file.

See also
void QTextImageFormat::setHeight ( qreal  height)

Sets the height of the rectangle occupied by the image.

See also
height(), setWidth()
void QTextImageFormat::setName ( const QString name)

Sets the name of the image. The name is used to locate the image in the application's resources.

See also
void QTextImageFormat::setWidth ( qreal  width)

Sets the width of the rectangle occupied by the image.

See also
width(), setHeight()
qreal QTextImageFormat::width ( ) const

Returns the width of the rectangle occupied by the image.

See also
height(), setWidth()