Qt 4.8
|
The QTextFormat class provides formatting information for a QTextDocument. More...
#include <qtextformat.h>
Public Functions | |
QBrush | background () const |
Returns the brush used to paint the document's background. More... | |
bool | boolProperty (int propertyId) const |
Returns the value of the property specified by propertyId. More... | |
QBrush | brushProperty (int propertyId) const |
Returns the value of the property given by propertyId; if the property isn't of QVariant::Brush type, Qt::NoBrush is returned instead. More... | |
void | clearBackground () |
Clears the brush used to paint the document's background. More... | |
void | clearForeground () |
Clears the brush used to paint the document's foreground. More... | |
void | clearProperty (int propertyId) |
Clears the value of the property given by propertyId. More... | |
QColor | colorProperty (int propertyId) const |
Returns the value of the property given by propertyId; if the property isn't of QVariant::Color type, an invalid color is returned instead. More... | |
qreal | doubleProperty (int propertyId) const |
Returns the value of the property specified by propertyId. More... | |
QBrush | foreground () const |
Returns the brush used to render foreground details, such as text, frame outlines, and table borders. More... | |
bool | hasProperty (int propertyId) const |
Returns true if the text format has a property with the given propertyId; otherwise returns false. More... | |
int | intProperty (int propertyId) const |
Returns the value of the property specified by propertyId. More... | |
bool | isBlockFormat () const |
Returns true if this text format is a BlockFormat ; otherwise returns false. More... | |
bool | isCharFormat () const |
Returns true if this text format is a CharFormat ; otherwise returns false. More... | |
bool | isFrameFormat () const |
Returns true if this text format is a FrameFormat ; otherwise returns false. More... | |
bool | isImageFormat () const |
Returns true if this text format is an image format; otherwise returns false. More... | |
bool | isListFormat () const |
Returns true if this text format is a ListFormat ; otherwise returns false. More... | |
bool | isTableCellFormat () const |
Returns true if this text format is a TableCellFormat ; otherwise returns false. More... | |
bool | isTableFormat () const |
Returns true if this text format is a TableFormat ; otherwise returns false. More... | |
bool | isValid () const |
Returns true if the format is valid (i. More... | |
Qt::LayoutDirection | layoutDirection () const |
Returns the document's layout direction. More... | |
QTextLength | lengthProperty (int propertyId) const |
Returns the value of the property given by propertyId. More... | |
QVector< QTextLength > | lengthVectorProperty (int propertyId) const |
Returns the value of the property given by propertyId. More... | |
void | merge (const QTextFormat &other) |
Merges the other format with this format; where there are conflicts the other format takes precedence. More... | |
int | objectIndex () const |
Returns the index of the format object, or -1 if the format object is invalid. More... | |
int | objectType () const |
Returns the text format's object type. More... | |
operator QVariant () const | |
Returns the text format as a QVariant. More... | |
bool | operator!= (const QTextFormat &rhs) const |
Returns true if this text format is different from the other text format. More... | |
QTextFormat & | operator= (const QTextFormat &rhs) |
Assigns the other text format to this text format, and returns a reference to this text format. More... | |
bool | operator== (const QTextFormat &rhs) const |
Returns true if this text format is the same as the other text format. More... | |
QPen | penProperty (int propertyId) const |
Returns the value of the property given by propertyId; if the property isn't of QVariant::Pen type, Qt::NoPen is returned instead. More... | |
QMap< int, QVariant > | properties () const |
Returns a map with all properties of this text format. More... | |
QVariant | property (int propertyId) const |
Returns the property specified by the given propertyId. More... | |
int | propertyCount () const |
Returns the number of properties stored in the format. More... | |
QTextFormat () | |
Creates a new text format with an InvalidFormat . More... | |
QTextFormat (int type) | |
Creates a new text format of the given type. More... | |
QTextFormat (const QTextFormat &rhs) | |
Creates a new text format with the same attributes as the other text format. More... | |
void | setBackground (const QBrush &brush) |
Sets the brush use to paint the document's background to the brush specified. More... | |
void | setForeground (const QBrush &brush) |
Sets the foreground brush to the specified brush. More... | |
void | setLayoutDirection (Qt::LayoutDirection direction) |
Sets the document's layout direction to the specified direction. More... | |
void | setObjectIndex (int object) |
Sets the format object's object index. More... | |
void | setObjectType (int type) |
Sets the text format's object type to type. More... | |
void | setProperty (int propertyId, const QVariant &value) |
Sets the property specified by the propertyId to the given value. More... | |
void | setProperty (int propertyId, const QVector< QTextLength > &lengths) |
Sets the value of the property given by propertyId to value. More... | |
QString | stringProperty (int propertyId) const |
Returns the value of the property given by propertyId; if the property isn't of QVariant::String type, an empty string is returned instead. More... | |
QTextBlockFormat | toBlockFormat () const |
Returns this format as a block format. More... | |
QTextCharFormat | toCharFormat () const |
Returns this format as a character format. More... | |
QTextFrameFormat | toFrameFormat () const |
Returns this format as a frame format. More... | |
QTextImageFormat | toImageFormat () const |
Returns this format as an image format. More... | |
QTextListFormat | toListFormat () const |
Returns this format as a list format. More... | |
QTextTableCellFormat | toTableCellFormat () const |
Returns this format as a table cell format. More... | |
QTextTableFormat | toTableFormat () const |
Returns this format as a table format. More... | |
int | type () const |
Returns the type of this format. More... | |
~QTextFormat () | |
Destroys this text format. More... | |
Properties | |
QSharedDataPointer< QTextFormatPrivate > | d |
qint32 | format_type |
Friends | |
Q_GUI_EXPORT QDataStream & | operator<< (QDataStream &, const QTextFormat &) |
Q_GUI_EXPORT QDataStream & | operator>> (QDataStream &, QTextFormat &) |
class | QTextCharFormat |
class | QTextFormatCollection |
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 text item 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 corresponding Property.
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(), doubleProperty(), 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.
Definition at line 129 of file qtextformat.h.
This enum describes the text item a QTextFormat object is formatting.
Enumerator | |
---|---|
InvalidFormat | |
BlockFormat | |
CharFormat | |
ListFormat | |
TableFormat | |
FrameFormat | |
UserFormat |
Definition at line 134 of file qtextformat.h.
This enum describes what kind of QTextObject this format is associated with.
Enumerator | |
---|---|
NoObject | |
ImageObject | |
TableObject | |
TableCellObject | |
UserObject |
Definition at line 260 of file qtextformat.h.
This enum describes how page breaking is performed when printing.
It maps to the corresponding css properties.
Enumerator | |
---|---|
PageBreak_Auto | |
PageBreak_AlwaysBefore | |
PageBreak_AlwaysAfter |
Definition at line 269 of file qtextformat.h.
This enum describes the different properties a format can have.
Paragraph and character properties
Paragraph properties
Character properties
List properties
Table and frame properties
Table cell properties
Image properties
Selection properties
Page break properties
Definition at line 145 of file qtextformat.h.
QTextFormat::QTextFormat | ( | ) |
Creates a new text format with an InvalidFormat
.
Definition at line 814 of file qtextformat.cpp.
Referenced by QTextFormatCollection::format(), and QTextFormatCollection::objectFormat().
|
explicit |
Creates a new text format of the given type.
Definition at line 824 of file qtextformat.cpp.
QTextFormat::QTextFormat | ( | const QTextFormat & | rhs | ) |
Creates a new text format with the same attributes as the other text format.
Definition at line 839 of file qtextformat.cpp.
QTextFormat::~QTextFormat | ( | ) |
|
inline |
Returns the brush used to paint the document's background.
Definition at line 345 of file qtextformat.h.
Referenced by QAccessibleTextWidget::attributes(), QCalendarModel::data(), QTextLayout::draw(), QTextDocumentLayoutPrivate::drawBlock(), QTextDocumentLayoutPrivate::drawFrameDecoration(), QTextDocumentLayoutPrivate::drawListItem(), QTextDocumentLayoutPrivate::drawTableCell(), QTextHtmlExporter::emitBackgroundAttribute(), QTextHtmlExporter::emitBlockAttributes(), QTextHtmlExporter::emitCharFormatStyle(), QTextControlPrivate::inputMethodEvent(), QPlainTextEdit::paintEvent(), QTextHtmlImporter::processBlockNode(), QLineControl::processInputMethodEvent(), QTextHtmlImporter::processSpecialNodes(), QTextHtmlImporter::scanTable(), setPenAndDrawBackground(), QTextOdfWriter::writeBlockFormat(), and QTextOdfWriter::writeCharacterFormat().
bool QTextFormat::boolProperty | ( | int | propertyId | ) | const |
Returns the value of the property specified by propertyId.
If the property isn't of QTextFormat::Bool type, false is returned instead.
Definition at line 980 of file qtextformat.cpp.
Referenced by QTextLayout::draw(), QTextCharFormat::fontFixedPitch(), QTextCharFormat::fontItalic(), QTextCharFormat::fontKerning(), QTextCharFormat::fontOverline(), QTextCharFormat::fontStrikeOut(), QTextCharFormat::fontUnderline(), QTextItemInt::initWithScriptItem(), QTextCharFormat::isAnchor(), and QTextControl::setExtraSelections().
QBrush QTextFormat::brushProperty | ( | int | propertyId | ) | const |
Returns the value of the property given by propertyId; if the property isn't of QVariant::Brush type, Qt::NoBrush is returned instead.
Definition at line 1085 of file qtextformat.cpp.
Referenced by QTextLayout::draw(), and QTextLine::draw().
|
inline |
Clears the brush used to paint the document's background.
The default brush will be used.
Definition at line 347 of file qtextformat.h.
Referenced by QTextLine::draw().
|
inline |
Clears the brush used to paint the document's foreground.
The default brush will be used.
Definition at line 354 of file qtextformat.h.
Referenced by QTextLine::draw().
void QTextFormat::clearProperty | ( | int | propertyId | ) |
Clears the value of the property given by propertyId.
Definition at line 1178 of file qtextformat.cpp.
Referenced by QTextHtmlImporter::appendNodeText(), QTextCursor::charFormat(), QTextLayout::draw(), QTextLine::draw(), QTextHtmlExporter::emitBlockAttributes(), formatDifference(), QTextHtmlParserNode::initializeProperties(), QTextCursor::insertBlock(), QTextCursor::insertText(), QTextHtmlExporter::QTextHtmlExporter(), QTextCursorPrivate::setBlockCharFormat(), QTextCursorPrivate::setCharFormat(), QTextDocumentPrivate::setCharFormat(), QTextTableCell::setFormat(), setProperty(), QTextCharFormat::setTableCellColumnSpan(), QTextCharFormat::setTableCellRowSpan(), and QTextHtmlExporter::toHtml().
QColor QTextFormat::colorProperty | ( | int | propertyId | ) | const |
Returns the value of the property given by propertyId; if the property isn't of QVariant::Color type, an invalid color is returned instead.
Definition at line 1051 of file qtextformat.cpp.
Referenced by QTextCharFormat::underlineColor().
qreal QTextFormat::doubleProperty | ( | int | propertyId | ) | const |
Returns the value of the property specified by propertyId.
If the property isn't of QVariant::Double or QMetaType::Float type, 0 is returned instead.
Definition at line 1016 of file qtextformat.cpp.
Referenced by QTextFrameFormat::bottomMargin(), QTextTableCellFormat::bottomPadding(), QTextCharFormat::fontLetterSpacing(), QTextCharFormat::fontPointSize(), QTextCharFormat::fontWordSpacing(), QTextFrameFormat::leftMargin(), QTextTableCellFormat::leftPadding(), QTextBlockFormat::lineHeight(), QTextFrameFormat::rightMargin(), QTextTableCellFormat::rightPadding(), QTextFrameFormat::topMargin(), and QTextTableCellFormat::topPadding().
|
inline |
Returns the brush used to render foreground details, such as text, frame outlines, and table borders.
Definition at line 352 of file qtextformat.h.
Referenced by QTextEditPrivate::_q_currentCharFormatChanged(), QAccessibleTextWidget::attributes(), QCalendarModel::data(), QTextLayout::draw(), QTextLine::draw(), QTextDocumentLayoutPrivate::drawListItem(), QTextHtmlExporter::emitCharFormatStyle(), setPenAndDrawBackground(), and QTextOdfWriter::writeCharacterFormat().
bool QTextFormat::hasProperty | ( | int | propertyId | ) | const |
Returns true if the text format has a property with the given propertyId; otherwise returns false.
Definition at line 1254 of file qtextformat.cpp.
Referenced by QTextControlPrivate::anchorForCursor(), QTextHtmlImporter::appendNodeText(), QTextFrameFormat::bottomMargin(), QTextDocumentLayoutPrivate::drawBlock(), QTextDocumentLayoutPrivate::drawListItem(), QTextHtmlExporter::emitBackgroundAttribute(), QTextHtmlExporter::emitBlock(), QTextHtmlExporter::emitBlockAttributes(), QTextHtmlExporter::emitCharFormatStyle(), QTextHtmlExporter::emitFragment(), QTextHtmlExporter::emitFrameStyle(), QTextHtmlExporter::emitTable(), QTextHtmlExporter::emitTextFrame(), QTextControl::findNextPrevAnchor(), QTextCharFormat::fontUnderline(), getImageSize(), getPixmapSize(), QTextHtmlImporter::import(), QTextHtmlParserNode::initializeProperties(), QTextItemInt::initWithScriptItem(), isEmptyBlockBeforeTable(), QTextDocumentLayoutPrivate::layoutBlock(), QTextFrameFormat::leftMargin(), QPlainTextEdit::paintEvent(), QTextFrameFormat::rightMargin(), QTextHtmlImporter::scanTable(), QTextHtmlExporter::toHtml(), QTextFrameFormat::topMargin(), QTextOdfWriter::writeBlockFormat(), QTextOdfWriter::writeCharacterFormat(), QTextOdfWriter::writeFrameFormat(), QTextOdfWriter::writeInlineCharacter(), QTextOdfWriter::writeListFormat(), and QTextOdfWriter::writeTableCellFormat().
int QTextFormat::intProperty | ( | int | propertyId | ) | const |
Returns the value of the property specified by propertyId.
If the property is not of QTextFormat::Integer type, 0 is returned instead.
Definition at line 996 of file qtextformat.cpp.
Referenced by QTextDocumentLayoutPrivate::drawListItem(), QTextHtmlExporter::emitCharFormatStyle(), QTextCharFormat::fontCapitalization(), QTextCharFormat::fontHintingPreference(), QTextCharFormat::fontStyleHint(), QTextCharFormat::fontStyleStrategy(), QTextCharFormat::fontWeight(), QTextBlockFormat::lineHeight(), QTextCharFormat::tableCellColumnSpan(), QTextCharFormat::tableCellRowSpan(), QTextHtmlExporter::toHtml(), QTextCharFormat::underlineStyle(), and QTextCharFormat::verticalAlignment().
|
inline |
Returns true if this text format is a BlockFormat
; otherwise returns false.
Definition at line 319 of file qtextformat.h.
Referenced by QTextCursorPrivate::insertBlock(), and QTextDocumentPrivate::insertBlock().
|
inline |
Returns true if this text format is a CharFormat
; otherwise returns false.
Definition at line 318 of file qtextformat.h.
Referenced by QTextDocumentPrivate::insert(), QTextDocumentPrivate::insertBlock(), QTextCursor::insertText(), and QTextCharFormat::isValid().
|
inline |
Returns true if this text format is a FrameFormat
; otherwise returns false.
Definition at line 321 of file qtextformat.h.
Referenced by QTextDocument::createObject().
|
inline |
Returns true if this text format is an image format; otherwise returns false.
Definition at line 322 of file qtextformat.h.
Referenced by QTextHtmlExporter::emitFragment(), and QTextOdfWriter::writeInlineCharacter().
|
inline |
Returns true if this text format is a ListFormat
; otherwise returns false.
Definition at line 320 of file qtextformat.h.
Referenced by QTextDocument::createObject().
|
inline |
Returns true if this text format is a TableCellFormat
; otherwise returns false.
Definition at line 324 of file qtextformat.h.
Referenced by QTextOdfWriter::writeFormats(), and QTextOdfWriter::writeFrame().
|
inline |
Returns true if this text format is a TableFormat
; otherwise returns false.
Definition at line 323 of file qtextformat.h.
Referenced by QTextDocument::createObject().
|
inline |
Returns true if the format is valid (i.
e. is not InvalidFormat); otherwise returns false.
Definition at line 287 of file qtextformat.h.
|
inline |
Returns the document's layout direction.
Definition at line 340 of file qtextformat.h.
Referenced by QAccessibleTextWidget::characterRect(), QTextHtmlParserNode::initializeProperties(), and QTextHtmlImporter::scanTable().
QTextLength QTextFormat::lengthProperty | ( | int | propertyId | ) | const |
Returns the value of the property given by propertyId.
Definition at line 1100 of file qtextformat.cpp.
Referenced by QTextDocumentLayoutPrivate::drawBlock(), and QTextHtmlExporter::emitBlock().
QVector< QTextLength > QTextFormat::lengthVectorProperty | ( | int | propertyId | ) | const |
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.
Definition at line 1114 of file qtextformat.cpp.
void QTextFormat::merge | ( | const QTextFormat & | other | ) |
Merges the other format with this format; where there are conflicts the other format takes precedence.
Definition at line 880 of file qtextformat.cpp.
Referenced by QTextLine::draw(), QTextHtmlExporter::emitBlock(), QTextHtmlExporter::emitTable(), QTextEngine::format(), QCalendarModel::formatForCell(), QTextCursor::mergeCharFormat(), QTextHtmlImporter::processBlockNode(), QTextHtmlImporter::processSpecialNodes(), QTextDocumentPrivate::setBlockFormat(), and QTextDocumentPrivate::setCharFormat().
int QTextFormat::objectIndex | ( | ) | const |
Returns the index of the format object, or -1 if the format object is invalid.
Definition at line 1215 of file qtextformat.cpp.
Referenced by QTextCopyHelper::appendFragment(), QTextCursorPrivate::canDelete(), QTextCopyHelper::convertFormatIndex(), QTextFormatCollection::createObjectIndex(), QTextDocumentPrivate::insertBlock(), QTextDocumentPrivate::objectForFormat(), QTextDocumentPrivate::setCharFormat(), QTextFormatCollection::setObjectFormat(), and QTextFormatCollection::setObjectFormatIndex().
|
inline |
Returns the text format's object type.
Definition at line 315 of file qtextformat.h.
Referenced by QTextCursorPrivate::canDelete(), QTextDocumentLayoutPrivate::drawFlow(), QAbstractTextDocumentLayout::drawInlineObject(), QTextDocumentLayout::positionInlineObject(), QTextDocumentLayout::resizeInlineObject(), and QAbstractTextDocumentLayout::resizeInlineObject().
QTextFormat::operator QVariant | ( | ) | const |
Returns the text format as a QVariant.
Definition at line 871 of file qtextformat.cpp.
|
inline |
Returns true if this text format is different from the other text format.
Definition at line 335 of file qtextformat.h.
QTextFormat & QTextFormat::operator= | ( | const QTextFormat & | rhs | ) |
Assigns the other text format to this text format, and returns a reference to this text format.
Definition at line 853 of file qtextformat.cpp.
bool QTextFormat::operator== | ( | const QTextFormat & | rhs | ) | const |
Returns true if this text format is the same as the other text format.
Definition at line 1310 of file qtextformat.cpp.
QPen QTextFormat::penProperty | ( | int | propertyId | ) | const |
Returns the value of the property given by propertyId; if the property isn't of QVariant::Pen type, Qt::NoPen is returned instead.
Definition at line 1068 of file qtextformat.cpp.
Referenced by QTextLayout::draw(), QTextLine::draw(), and QTextCharFormat::textOutline().
Returns a map with all properties of this text format.
Definition at line 1268 of file qtextformat.cpp.
Referenced by QTextHtmlExporter::emitBlock(), formatDifference(), and operator<<().
QVariant QTextFormat::property | ( | int | propertyId | ) | const |
Returns the property specified by the given propertyId.
Definition at line 1138 of file qtextformat.cpp.
Referenced by QTextCharFormat::anchorName(), QTextCharFormat::anchorNames(), QTextLayout::draw(), QTextLine::draw(), QTextHtmlExporter::emitBackgroundAttribute(), QTextHtmlExporter::emitBlockAttributes(), formatDifference(), QTextTableData::paddingProperty(), setPenAndDrawBackground(), and QTextBlockFormat::tabPositions().
int QTextFormat::propertyCount | ( | ) | const |
Returns the number of properties stored in the format.
Definition at line 1285 of file qtextformat.cpp.
Referenced by QTextHtmlImporter::processBlockNode().
|
inline |
Sets the brush use to paint the document's background to the brush specified.
Definition at line 343 of file qtextformat.h.
Referenced by QTextHtmlParser::applyAttributes(), QTextHtmlParserNode::applyBackgroundImage(), QTextHtmlParserNode::applyCssDeclarations(), QLineControl::draw(), QCalendarModel::formatForCell(), QTextControl::getPaintContext(), QTextControlPrivate::inputMethodEvent(), QPlainTextEdit::paintEvent(), QTextHtmlImporter::processBlockNode(), QLineControl::processInputMethodEvent(), QTextHtmlImporter::processSpecialNodes(), QTextHtmlImporter::scanTable(), QTextEdit::setTextBackgroundColor(), QInputContext::standardFormat(), and QScriptEdit::updateExtraSelections().
|
inline |
Sets the foreground brush to the specified brush.
The foreground brush is mostly used to render text.
Definition at line 350 of file qtextformat.h.
Referenced by QTextHtmlParser::applyAttributes(), QTextHtmlParserNode::applyCssDeclarations(), QSvgText::draw(), QLineControl::draw(), QCalendarModel::formatForCell(), QTextControl::getPaintContext(), QTextHtmlParserNode::initializeProperties(), QTextControlPrivate::inputMethodEvent(), QScriptDebuggerConsoleWidget::message(), QScriptDebugOutputWidget::message(), QPlainTextEdit::paintEvent(), QDeclarativeStyledTextPrivate::parseFontAttributes(), QLineControl::processInputMethodEvent(), QCalendarWidget::QCalendarWidget(), QScriptSyntaxHighlighter::QScriptSyntaxHighlighter(), QSyntaxHighlighter::setFormat(), QTextEdit::setTextColor(), and QInputContext::standardFormat().
|
inline |
Sets the document's layout direction to the specified direction.
Definition at line 338 of file qtextformat.h.
Referenced by QTextHtmlParser::applyAttributes(), QTextHtmlParserNode::initializeProperties(), QTextControlPrivate::keyPressEvent(), and QTextHtmlImporter::scanTable().
void QTextFormat::setObjectIndex | ( | int | index | ) |
Sets the format object's object index.
Definition at line 1235 of file qtextformat.cpp.
Referenced by QTextList::add(), QTextCopyHelper::convertFormatIndex(), QTextCursor::createList(), QTextTablePrivate::createTable(), QTextDocumentPrivate::insertFrame(), QTextCursor::insertImage(), QTextList::remove(), and QTextDocumentPrivate::setCharFormat().
|
inline |
Sets the text format's object type to type.
Definition at line 367 of file qtextformat.h.
Referenced by QTextTablePrivate::createTable(), QTextTableCell::format(), QTextImageFormat::QTextImageFormat(), QTextTableCellFormat::QTextTableCellFormat(), QTextTableFormat::QTextTableFormat(), and QTextTableCell::setFormat().
void QTextFormat::setProperty | ( | int | propertyId, |
const QVariant & | value | ||
) |
Sets the property specified by the propertyId to the given value.
Definition at line 1148 of file qtextformat.cpp.
Referenced by QTextHtmlParser::applyAttributes(), QTextHtmlParserNode::applyBackgroundImage(), QTextHtmlParserNode::applyCssDeclarations(), QTextLayout::draw(), QTextControl::getPaintContext(), QTextHtmlParserNode::initializeProperties(), QTextHtmlImporter::processSpecialNodes(), QTextHtmlImporter::scanTable(), QTextBlockFormat::setAlignment(), QTextTableFormat::setAlignment(), QTextCharFormat::setAnchor(), QTextCharFormat::setAnchorHref(), QTextCharFormat::setAnchorNames(), QTextFrameFormat::setBorder(), QTextFrameFormat::setBottomMargin(), QTextTableCellFormat::setBottomPadding(), QTextTableFormat::setCellPadding(), QTextTableFormat::setColumns(), QTextCharFormat::setFont(), QTextCharFormat::setFontCapitalization(), QTextCharFormat::setFontFamily(), QTextCharFormat::setFontFixedPitch(), QTextCharFormat::setFontHintingPreference(), QTextCharFormat::setFontItalic(), QTextCharFormat::setFontKerning(), QTextCharFormat::setFontLetterSpacing(), QTextCharFormat::setFontOverline(), QTextCharFormat::setFontPointSize(), QTextCharFormat::setFontStrikeOut(), QTextCharFormat::setFontStyleHint(), QTextCharFormat::setFontStyleStrategy(), QTextCharFormat::setFontUnderline(), QTextCharFormat::setFontWeight(), QTextCharFormat::setFontWordSpacing(), QTextImageFormat::setHeight(), QTextFrameFormat::setHeight(), QTextBlockFormat::setIndent(), QTextListFormat::setIndent(), QTextFrameFormat::setLeftMargin(), QTextTableCellFormat::setLeftPadding(), QTextHtmlParserNode::setListStyle(), QTextFrameFormat::setMargin(), QTextImageFormat::setName(), QTextListFormat::setNumberPrefix(), QTextListFormat::setNumberSuffix(), setObjectType(), QTextFrameFormat::setPadding(), QTextFrameFormat::setRightMargin(), QTextTableCellFormat::setRightPadding(), QTextListFormat::setStyle(), QTextCharFormat::setTableCellColumnSpan(), QTextCharFormat::setTableCellRowSpan(), QTextBlockFormat::setTabPositions(), QTextCharFormat::setTextOutline(), QTextCharFormat::setToolTip(), QTextFrameFormat::setTopMargin(), QTextTableCellFormat::setTopPadding(), QTextCharFormat::setUnderlineColor(), QTextCharFormat::setUnderlineStyle(), QTextCharFormat::setVerticalAlignment(), QTextImageFormat::setWidth(), QTextFrameFormat::setWidth(), QCommonStyle::styleHint(), and QScriptEdit::updateExtraSelections().
void QTextFormat::setProperty | ( | int | propertyId, |
const QVector< QTextLength > & | value | ||
) |
Sets the value of the property given by propertyId to value.
Definition at line 1163 of file qtextformat.cpp.
QString QTextFormat::stringProperty | ( | int | propertyId | ) | const |
Returns the value of the property given by propertyId; if the property isn't of QVariant::String type, an empty string is returned instead.
Definition at line 1033 of file qtextformat.cpp.
Referenced by QTextControlPrivate::anchorForCursor(), QTextCharFormat::anchorHref(), QTextCharFormat::fontFamily(), and QTextCharFormat::toolTip().
QTextBlockFormat QTextFormat::toBlockFormat | ( | ) | const |
Returns this format as a block format.
Definition at line 916 of file qtextformat.cpp.
Referenced by QTextBlock::blockFormat(), and QTextOdfWriter::writeFormats().
QTextCharFormat QTextFormat::toCharFormat | ( | ) | const |
Returns this format as a character format.
Definition at line 924 of file qtextformat.cpp.
Referenced by QTextBlock::charFormat(), QTextDocumentLayout::drawInlineObject(), QAbstractTextDocumentLayout::drawInlineObject(), QTextHtmlExporter::emitBlockAttributes(), QTextDocumentLayout::positionInlineObject(), QTextDocumentLayout::resizeInlineObject(), QAbstractTextDocumentLayout::resizeInlineObject(), and QTextOdfWriter::writeFormats().
QTextFrameFormat QTextFormat::toFrameFormat | ( | ) | const |
Returns this format as a frame format.
Definition at line 948 of file qtextformat.cpp.
Referenced by QTextFrame::frameFormat(), and QTextOdfWriter::writeFormats().
QTextImageFormat QTextFormat::toImageFormat | ( | ) | const |
Returns this format as an image format.
Definition at line 956 of file qtextformat.cpp.
Referenced by QTextImageHandler::drawObject(), QTextHtmlExporter::emitFragment(), QTextImageHandler::intrinsicSize(), and QTextOdfWriter::writeInlineCharacter().
QTextListFormat QTextFormat::toListFormat | ( | ) | const |
Returns this format as a list format.
Definition at line 932 of file qtextformat.cpp.
Referenced by QTextDocumentLayoutPrivate::blockIndent(), QTextDocumentLayoutPrivate::drawBlock(), QTextDocumentLayoutPrivate::drawListItem(), QTextList::format(), and QTextOdfWriter::writeFormats().
QTextTableCellFormat QTextFormat::toTableCellFormat | ( | ) | const |
Returns this format as a table cell format.
Definition at line 969 of file qtextformat.cpp.
Referenced by QTextHtmlExporter::emitTable(), QTextHtmlImporter::processBlockNode(), and QTextOdfWriter::writeFormats().
QTextTableFormat QTextFormat::toTableFormat | ( | ) | const |
Returns this format as a table format.
Definition at line 940 of file qtextformat.cpp.
Referenced by QTextTable::format(), and QTextHtmlImporter::scanTable().
int QTextFormat::type | ( | ) | const |
Returns the type of this format.
Definition at line 908 of file qtextformat.cpp.
Referenced by QTextCopyHelper::convertFormatIndex(), QTextDocumentPrivate::setCharFormat(), and QTextOdfWriter::writeFormats().
|
friend |
Definition at line 459 of file qtextformat.cpp.
|
friend |
Definition at line 465 of file qtextformat.cpp.
|
friend |
Definition at line 362 of file qtextformat.h.
Referenced by toCharFormat().
|
friend |
Definition at line 361 of file qtextformat.h.
|
private |
Definition at line 358 of file qtextformat.h.
Referenced by boolProperty(), brushProperty(), clearProperty(), colorProperty(), doubleProperty(), QTextCharFormat::font(), QTextFormatCollection::hasFormatCached(), hasProperty(), QTextFormatCollection::indexForFormat(), intProperty(), lengthProperty(), lengthVectorProperty(), merge(), objectIndex(), operator=(), operator==(), operator>>(), penProperty(), properties(), property(), propertyCount(), QTextFormatCollection::setDefaultFont(), setObjectIndex(), setProperty(), and stringProperty().
|
private |
Definition at line 359 of file qtextformat.h.
Referenced by QTextFormatCollection::hasFormatCached(), QTextFormatCollection::indexForFormat(), merge(), operator<<(), operator=(), operator==(), operator>>(), and type().