Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions | ![]() |
The QTextFormat class provides formatting information for a QTextDocument. More...
#include <QTextFormat>
Inherited by QTextCharFormat, QTextBlockFormat, QTextListFormat, and QTextFrameFormat.
The QTextFormat class provides formatting information for a QTextDocument.
A QTextFormat is a generic class used for describing the format of parts of a QTextDocument. The derived classes QTextCharFormat, QTextBlockFormat, QTextListFormat, and QTextTableFormat are usually more useful, and describe the formatting that is applied to specific parts of the document.
A format has a FormatType which specifies the kinds of thing it can format, e.g. a block of text, a list, a table, etc. A format also has various properties (some specific to particular format types), as described by the Property enum. Every property has a PropertyType.
The format type is given by type(), tested with isCharFormat(), isBlockFormat(), isListFormat(), isTableFormat(), isFrameFormat(), and isImageFormat(), and retrieved with toCharFormat(), toBlockFormat(), toListFormat(), toTableFormat(), toFrameFormat(), and toImageFormat().
A format's properties can be set with the setProperty() functions, and retrieved with boolProperty(), intProperty(), floatProperty(), and stringProperty() as appropriate. All the property IDs used in the format can be retrieved with allPropertyIds(). One format can be merged into another using merge().
A format's object index can be set with setObjectIndex(), and retrieved with objectIndex(). These methods can be used to associate the format with a QTextObject. It is used to represent lists, frames and tables inside the document.
QTextFormat::InvalidFormat | |
QTextFormat::BlockFormat | |
QTextFormat::CharFormat | |
QTextFormat::ListFormat | |
QTextFormat::TableFormat | |
QTextFormat::FrameFormat |
QTextFormat::UserFormat |
QTextFormat::NoObject | |
QTextFormat::ImageObject | |
QTextFormat::TableObject |
QTextFormat::ObjectIndex |
Paragraph and character properties
QTextFormat::CssFloat |
Paragraph properties
QTextFormat::BlockDirection | |
QTextFormat::BlockAlignment | |
QTextFormat::BlockTopMargin | |
QTextFormat::BlockBottomMargin | |
QTextFormat::BlockLeftMargin | |
QTextFormat::BlockRightMargin | |
QTextFormat::BlockFirstLineMargin | |
QTextFormat::BlockIndent | |
QTextFormat::BlockNonBreakableLines | |
QTextFormat::BlockBackgroundColor |
Character properties
QTextFormat::FontFamily | |
QTextFormat::FontPointSize | |
QTextFormat::FontSizeIncrement | |
QTextFormat::FontWeight | |
QTextFormat::FontItalic | |
QTextFormat::FontUnderline | |
QTextFormat::FontOverline | |
QTextFormat::FontStrikeOut | |
QTextFormat::FontFixedPitch |
QTextFormat::Color |
QTextFormat::IsAnchor | |
QTextFormat::AnchorHref | |
QTextFormat::AnchorName |
QTextFormat::ObjectType |
List properties
QTextFormat::ListStyle | |
QTextFormat::ListIndent |
Table and frame properties
QTextFormat::TableColumns | |
QTextFormat::FrameBorder | |
QTextFormat::FrameMargin | |
QTextFormat::FramePadding | |
QTextFormat::Width | |
QTextFormat::Height |
Table cell properties
QTextFormat::TableCellRowSpan | |
QTextFormat::TableCellColumnSpan |
Image properties
QTextFormat::ImageName | |
QTextFormat::ImageWidth | |
QTextFormat::ImageHeight |
QTextFormat::UserProperty |
QTextFormat::Undefined | |
QTextFormat::Bool | |
QTextFormat::Integer | |
QTextFormat::Float | |
QTextFormat::String | |
QTextFormat::FormatObject |
Creates a new text format with an InvalidFormat.
See also FormatType.
Creates a new text format of the given type.
See also FormatType.
Creates a new text format with the same attributes at the rhs text format.
Destroys this text format.
Returns a list of all the property IDs for this text format.
See also hasProperty(), propertyType(), and PropertyType.
Returns the value of the property specified by propertyId; if the property isn't of QTextFormat::Bool type the defaultValue is returned instead.
See also setProperty(), intProperty(), floatProperty(), stringProperty(), and PropertyType.
Returns the value of the property specified by propertyId; if the property isn't of QTextFormat::Float type the defaultValue is returned instead.
See also setProperty(), boolProperty(), intProperty(), stringProperty(), and PropertyType.
Returns true if the text format has a property with the given propertyId; otherwise returns false.
See also propertyType(), allPropertyIds(), and PropertyType.
Returns the value of the property specified by propertyId; if the property is not of QTextFormat::Integer type the defaultValue is returned instead.
See also setProperty(), boolProperty(), floatProperty(), stringProperty(), and PropertyType.
Returns true if this text format is a BlockFormat; otherwise returns false.
Returns true if this text format is a CharFormat; otherwise returns false.
Returns true if this text format is a FrameFormat; otherwise returns false.
Returns true if this text format is an image format; otherwise returns false.
Returns true if this text format is a ListFormat; otherwise returns false.
Returns true if this text format is a TableFormat; otherwise returns false.
Returns true if the format is valid (i.e. is not InvalidFormat); otherwise returns false.
Merges the other format with this format; where there are conflicts other takes precedence.
Returns the index of the text format's format object, or -1 if there isn't a format object.
See also setObjectIndex().
Returns the text format's object type. See ObjectTypes.
Returns the property type for the given propertyId.
See also hasProperty(), allPropertyIds(), and PropertyType.
Sets the format object's object index to o.
See also objectIndex().
Sets the text format's object type to type. See ObjectTypes.
Sets the value of the property given by propertyId to value.
See also stringProperty() and PropertyType.
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
Sets the value of the property given by propertyId to value.
See also boolProperty() and PropertyType.
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
Sets the value of the property given by propertyId to value.
See also intProperty() and PropertyType.
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
Sets the value of the property given by propertyId to value.
See also floatProperty() and PropertyType.
Returns the value of the property given by propertyId; if the property isn't of QTextFormat::String type the defaultValue is returned instead.
See also setProperty(), boolProperty(), intProperty(), floatProperty(), and PropertyType.
Returns this format as a block format.
Returns this format as a character format.
Returns this format as a frame format.
Returns this format as an image format.
Returns this format as a list format.
Returns this format as a table format.
Returns the type of this format.
Returns true if this text format is different from the rhs text format.
Assigns the rhs text format to this text format and returns a reference to this text format.
Returns true if this text format is the same as the rhs text format.
Copyright © 2004 Trolltech. | Trademarks | Qt 4.0.0-tp1 |