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(), and the format can be tested with isCharFormat(), isBlockFormat(), isListFormat(), isTableFormat(), isFrameFormat(), and isImageFormat(). If the type is determined, it can be 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.
See also l{text.html}{Text Related Classes}.
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::TextColor |
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 | |
QTextFormat::TableColumnWidthConstraints | |
QTextFormat::TableCellSpacing | |
QTextFormat::TableCellPadding | |
QTextFormat::TableBackgroundColor |
Table cell properties
QTextFormat::TableCellRowSpan | |
QTextFormat::TableCellColumnSpan | |
QTextFormat::TableCellBackgroundColor |
Image properties
QTextFormat::ImageName | |
QTextFormat::ImageWidth | |
QTextFormat::ImageHeight |
QTextFormat::UserProperty |
QTextFormat::Undefined | |
QTextFormat::Bool | |
QTextFormat::Color | |
QTextFormat::Integer | |
QTextFormat::Float | |
QTextFormat::String | |
QTextFormat::FormatObject | |
QTextFormat::Length | |
QTextFormat::LengthVector |
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 other 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(), colorProperty(), lengthProperty(), lengthVectorProperty(), and PropertyType.
Clears the value of the property given by propertyId
Returns the value of the property given by propertyId; if the property isn't of QTextFormat::Color type the defaultValue is returned instead.
See also setProperty(), boolProperty(), intProperty(), floatProperty(), stringProperty(), lengthProperty(), lengthVectorProperty(), 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(), colorProperty(), lengthProperty(), lengthVectorProperty(), 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(), colorProperty(), lengthProperty(), lengthVectorProperty(), 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.
Returns the value of the property given by propertyId; if the property isn't of QTextFormat::Length type an variable length is returned instead.
See also setProperty(), boolProperty(), intProperty(), floatProperty(), stringProperty(), colorProperty(), lengthVectorProperty(), and PropertyType.
Returns the value of the property given by propertyId; if the property isn't of QTextFormat::LengthVector type an empty length vector is returned instead.
See also setProperty(), boolProperty(), intProperty(), floatProperty(), stringProperty(), colorProperty(), lengthProperty(), and PropertyType.
Merges the other format with this format; where there are conflicts the other format takes precedence.
Returns the index of the format object, or -1 if the format object is invalid.
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.
See also objectIndex().
Sets the text format's object 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 colorProperty() 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 lengthProperty() 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 lengthVectorProperty() 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, unless value == defaultValue, in which case the property's value is cleared.
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, unless value == defaultValue, in which case the property's value is cleared.
See also colorProperty() 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.
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, unless value == defaultValue, in which case the property's value is cleared.
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, unless value == defaultValue, in which case the property's value is cleared.
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, unless value == defaultValue, in which case the property's value is cleared.
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(), colorProperty(), lengthProperty(), lengthVectorProperty(), 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.
See also ObjectTypes.
Returns true if this text format is different from the other text format.
Assigns the other 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 other text format.
Copyright © 2004 Trolltech. | Trademarks | Qt 4.0.0-tp2 |