![]() |
Qt 6.x
The Qt SDK
|
\reentrant More...
#include <qtextformat.h>
Public Member Functions | |
QTextCharFormat () | |
Constructs a new character format object. | |
bool | isValid () const |
Returns true if this character format is valid; otherwise returns false. | |
void | setFont (const QFont &font, FontPropertiesInheritanceBehavior behavior=FontPropertiesAll) |
QFont | font () const |
Returns the font for this character format. | |
void | setFontFamilies (const QStringList &families) |
QStringList | fontFamilies () const |
void | setFontStyleName (const QString &styleName) |
QStringList | fontStyleName () const |
void | setFontPointSize (qreal size) |
Sets the text format's font size. | |
qreal | fontPointSize () const |
Returns the font size used to display text in this format. | |
void | setFontWeight (int weight) |
Sets the text format's font weight to weight. | |
int | fontWeight () const |
Returns the text format's font weight. | |
void | setFontItalic (bool italic) |
If italic is true, sets the text format's font to be italic; otherwise the font will be non-italic. | |
bool | fontItalic () const |
Returns true if the text format's font is italic; otherwise returns false . | |
void | setFontCapitalization (QFont::Capitalization capitalization) |
QFont::Capitalization | fontCapitalization () const |
void | setFontLetterSpacingType (QFont::SpacingType letterSpacingType) |
QFont::SpacingType | fontLetterSpacingType () const |
void | setFontLetterSpacing (qreal spacing) |
qreal | fontLetterSpacing () const |
void | setFontWordSpacing (qreal spacing) |
qreal | fontWordSpacing () const |
void | setFontUnderline (bool underline) |
If underline is true, sets the text format's font to be underlined; otherwise it is displayed non-underlined. | |
bool | fontUnderline () const |
Returns true if the text format's font is underlined; otherwise returns false . | |
void | setFontOverline (bool overline) |
If overline is true, sets the text format's font to be overlined; otherwise the font is displayed non-overlined. | |
bool | fontOverline () const |
Returns true if the text format's font is overlined; otherwise returns false . | |
void | setFontStrikeOut (bool strikeOut) |
If strikeOut is true, sets the text format's font with strike-out enabled (with a horizontal line through it); otherwise it is displayed without strikeout. | |
bool | fontStrikeOut () const |
Returns true if the text format's font is struck out (has a horizontal line drawn through it); otherwise returns false . | |
void | setUnderlineColor (const QColor &color) |
Sets the color used to draw underlines, overlines and strikeouts on the characters with this format to the color specified. | |
QColor | underlineColor () const |
Returns the color used to draw underlines, overlines and strikeouts on the characters with this format. | |
void | setFontFixedPitch (bool fixedPitch) |
If fixedPitch is true, sets the text format's font to be fixed pitch; otherwise a non-fixed pitch font is used. | |
bool | fontFixedPitch () const |
Returns true if the text format's font is fixed pitch; otherwise returns false . | |
void | setFontStretch (int factor) |
int | fontStretch () const |
void | setFontStyleHint (QFont::StyleHint hint, QFont::StyleStrategy strategy=QFont::PreferDefault) |
void | setFontStyleStrategy (QFont::StyleStrategy strategy) |
QFont::StyleHint | fontStyleHint () const |
QFont::StyleStrategy | fontStyleStrategy () const |
void | setFontHintingPreference (QFont::HintingPreference hintingPreference) |
QFont::HintingPreference | fontHintingPreference () const |
void | setFontKerning (bool enable) |
bool | fontKerning () const |
void | setUnderlineStyle (UnderlineStyle style) |
UnderlineStyle | underlineStyle () const |
void | setVerticalAlignment (VerticalAlignment alignment) |
Sets the vertical alignment used for the characters with this format to the alignment specified. | |
VerticalAlignment | verticalAlignment () const |
Returns the vertical alignment used for characters with this format. | |
void | setTextOutline (const QPen &pen) |
Sets the pen used to draw the outlines of characters to the given pen. | |
QPen | textOutline () const |
Returns the pen used to draw the outlines of characters in this format. | |
void | setToolTip (const QString &tip) |
QString | toolTip () const |
void | setSuperScriptBaseline (qreal baseline) |
qreal | superScriptBaseline () const |
void | setSubScriptBaseline (qreal baseline) |
qreal | subScriptBaseline () const |
void | setBaselineOffset (qreal baseline) |
qreal | baselineOffset () const |
void | setAnchor (bool anchor) |
If anchor is true, text with this format represents an anchor, and is formatted in the appropriate way; otherwise the text is formatted normally. | |
bool | isAnchor () const |
Returns true if the text is formatted as an anchor; otherwise returns false . | |
void | setAnchorHref (const QString &value) |
Sets the hypertext link for the text format to the given value. | |
QString | anchorHref () const |
Returns the text format's hypertext link, or an empty string if none has been set. | |
void | setAnchorNames (const QStringList &names) |
QStringList | anchorNames () const |
void | setTableCellRowSpan (int tableCellRowSpan) |
int | tableCellRowSpan () const |
void | setTableCellColumnSpan (int tableCellColumnSpan) |
int | tableCellColumnSpan () const |
![]() | |
QTextFormat () | |
Creates a new text format with an InvalidFormat . | |
QTextFormat (int type) | |
Creates a new text format of the given type. | |
QTextFormat (const QTextFormat &rhs) | |
Creates a new text format with the same attributes as the other text format. | |
QTextFormat & | operator= (const QTextFormat &rhs) |
Assigns the other text format to this text format, and returns a reference to this text format. | |
~QTextFormat () | |
Destroys this text format. | |
void | swap (QTextFormat &other) |
void | merge (const QTextFormat &other) |
Merges the other format with this format; where there are conflicts the other format takes precedence. | |
bool | isValid () const |
Returns true if the format is valid (i.e. | |
bool | isEmpty () const |
int | type () const |
Returns the type of this format. | |
int | objectIndex () const |
Returns the index of the format object, or -1 if the format object is invalid. | |
void | setObjectIndex (int object) |
Sets the format object's object index. | |
QVariant | property (int propertyId) const |
Returns the property specified by the given propertyId. | |
void | setProperty (int propertyId, const QVariant &value) |
Sets the property specified by the propertyId to the given value. | |
void | clearProperty (int propertyId) |
Clears the value of the property given by propertyId. | |
bool | hasProperty (int propertyId) const |
Returns true if the text format has a property with the given propertyId; otherwise returns false . | |
bool | boolProperty (int propertyId) const |
Returns the value of the property specified by propertyId. | |
int | intProperty (int propertyId) const |
Returns the value of the property specified by propertyId. | |
qreal | doubleProperty (int propertyId) const |
Returns the value of the property specified by propertyId. | |
QString | stringProperty (int propertyId) const |
Returns the value of the property given by propertyId; if the property isn't of QMetaType::QString type, an empty string is returned instead. | |
QColor | colorProperty (int propertyId) const |
Returns the value of the property given by propertyId; if the property isn't of QMetaType::QColor type, an invalid color is returned instead. | |
QPen | penProperty (int propertyId) const |
Returns the value of the property given by propertyId; if the property isn't of QMetaType::QPen type, Qt::NoPen is returned instead. | |
QBrush | brushProperty (int propertyId) const |
Returns the value of the property given by propertyId; if the property isn't of QMetaType::QBrush type, Qt::NoBrush is returned instead. | |
QTextLength | lengthProperty (int propertyId) const |
Returns the value of the property given by propertyId. | |
QList< QTextLength > | lengthVectorProperty (int propertyId) const |
Returns the value of the property given by propertyId. | |
void | setProperty (int propertyId, const QList< QTextLength > &lengths) |
Sets the value of the property given by propertyId to value. | |
QMap< int, QVariant > | properties () const |
Returns a map with all properties of this text format. | |
int | propertyCount () const |
void | setObjectType (int type) |
Sets the text format's object type to type. | |
int | objectType () const |
Returns the text format's object type. | |
bool | isCharFormat () const |
Returns true if this text format is a CharFormat ; otherwise returns false . | |
bool | isBlockFormat () const |
Returns true if this text format is a BlockFormat ; otherwise returns false . | |
bool | isListFormat () const |
Returns true if this text format is a ListFormat ; otherwise returns false . | |
bool | isFrameFormat () const |
Returns true if this text format is a FrameFormat ; otherwise returns false . | |
bool | isImageFormat () const |
Returns true if this text format is an image format; otherwise returns false . | |
bool | isTableFormat () const |
Returns true if this text format is a TableFormat ; otherwise returns false . | |
bool | isTableCellFormat () const |
QTextBlockFormat | toBlockFormat () const |
Returns this format as a block format. | |
QTextCharFormat | toCharFormat () const |
Returns this format as a character format. | |
QTextListFormat | toListFormat () const |
Returns this format as a list format. | |
QTextTableFormat | toTableFormat () const |
Returns this format as a table format. | |
QTextFrameFormat | toFrameFormat () const |
Returns this format as a frame format. | |
QTextImageFormat | toImageFormat () const |
Returns this format as an image format. | |
QTextTableCellFormat | toTableCellFormat () const |
bool | operator== (const QTextFormat &rhs) const |
Returns true if this text format is the same as the other text format. | |
bool | operator!= (const QTextFormat &rhs) const |
Returns true if this text format is different from the other text format. | |
operator QVariant () const | |
Returns the text format as a QVariant. | |
void | setLayoutDirection (Qt::LayoutDirection direction) |
Sets the document's layout direction to the specified direction. | |
Qt::LayoutDirection | layoutDirection () const |
Returns the document's layout direction. | |
void | setBackground (const QBrush &brush) |
Sets the brush use to paint the document's background to the brush specified. | |
QBrush | background () const |
Returns the brush used to paint the document's background. | |
void | clearBackground () |
Clears the brush used to paint the document's background. | |
void | setForeground (const QBrush &brush) |
Sets the foreground brush to the specified brush. | |
QBrush | foreground () const |
Returns the brush used to render foreground details, such as text, frame outlines, and table borders. | |
void | clearForeground () |
Clears the brush used to paint the document's foreground. | |
Protected Member Functions | |
QTextCharFormat (const QTextFormat &fmt) | |
Friends | |
class | QTextFormat |
Q_GUI_EXPORT QDataStream & | operator<< (QDataStream &, const QTextCharFormat &) |
Q_GUI_EXPORT QDataStream & | operator>> (QDataStream &, QTextCharFormat &) |
\reentrant
The QTextCharFormat class provides formatting information for characters in a QTextDocument. \inmodule QtGui
The character format of text in a document specifies the visual properties of the text, as well as information about its role in a hypertext document.
The font used can be set by supplying a font to the setFont() function, and each aspect of its appearance can be adjusted to give the desired effect. setFontFamilies() and setFontPointSize() define the font's family (e.g. Times) and printed size; setFontWeight() and setFontItalic() provide control over the style of the font. setFontUnderline(), setFontOverline(), setFontStrikeOut(), and setFontFixedPitch() provide additional effects for text.
The color is set with setForeground(). If the text is intended to be used as an anchor (for hyperlinks), this can be enabled with setAnchor(). The setAnchorHref() and setAnchorNames() functions are used to specify the information about the hyperlink's destination and the anchor's name.
Definition at line 381 of file qtextformat.h.
This enum specifies how the setFont() function should behave with respect to unset font properties.
\value FontPropertiesSpecifiedOnly If a property is not explicitly set, do not change the text format's property value. \value FontPropertiesAll If a property is not explicitly set, override the text format's property with a default value.
Enumerator | |
---|---|
FontPropertiesSpecifiedOnly | |
FontPropertiesAll |
Definition at line 408 of file qtextformat.h.
This enum describes the different ways drawing underlined text.
\value NoUnderline Text is draw without any underlining decoration. \value SingleUnderline A line is drawn using Qt::SolidLine. \value DashUnderline Dashes are drawn using Qt::DashLine. \value DotLine Dots are drawn using Qt::DotLine; \value DashDotLine Dashes and dots are drawn using Qt::DashDotLine. \value DashDotDotLine Underlines draw drawn using Qt::DashDotDotLine. \value WaveUnderline The text is underlined using a wave shaped line. \value SpellCheckUnderline The underline is drawn depending on the SpellCheckUnderlineStyle theme hint of QPlatformTheme. By default this is mapped to WaveUnderline, on \macos it is mapped to DotLine.
Enumerator | |
---|---|
NoUnderline | |
SingleUnderline | |
DashUnderline | |
DotLine | |
DashDotLine | |
DashDotDotLine | |
WaveUnderline | |
SpellCheckUnderline |
Definition at line 393 of file qtextformat.h.
This enum describes the ways that adjacent characters can be vertically aligned.
\value AlignNormal Adjacent characters are positioned in the standard way for text in the writing system in use. \value AlignSuperScript Characters are placed above the base line for normal text. \value AlignSubScript Characters are placed below the base line for normal text. \value AlignMiddle The center of the object is vertically aligned with the base line. Currently, this is only implemented for inline objects. \value AlignBottom The bottom edge of the object is vertically aligned with the base line. \value AlignTop The top edge of the object is vertically aligned with the base line. \value AlignBaseline The base lines of the characters are aligned.
Enumerator | |
---|---|
AlignNormal | |
AlignSuperScript | |
AlignSubScript | |
AlignMiddle | |
AlignTop | |
AlignBottom | |
AlignBaseline |
Definition at line 384 of file qtextformat.h.
QTextCharFormat::QTextCharFormat | ( | ) |
Constructs a new character format object.
Definition at line 1453 of file qtextformat.cpp.
|
explicitprotected |
Creates a new character format with the same attributes as the given text format.
Definition at line 1462 of file qtextformat.cpp.
|
inline |
Returns the text format's hypertext link, or an empty string if none has been set.
Definition at line 566 of file qtextformat.h.
References QTextFormat::AnchorHref, and QTextFormat::stringProperty().
Referenced by QWidgetTextControlPrivate::activateLinkUnderCursor(), QQuickTextControlPrivate::activateLinkUnderCursor(), QPdfEnginePrivate::drawTextItem(), QPlainTextEdit::keyPressEvent(), QTextEdit::keyPressEvent(), and QTextBrowser::keyPressEvent().
QStringList QTextCharFormat::anchorNames | ( | ) | const |
Returns the anchor names associated with this text format, or an empty string list if none has been set. If the anchor names are set, text with this format can be the destination of a hypertext link.
Definition at line 1984 of file qtextformat.cpp.
References QTextFormat::AnchorName, property, QVariant::toString(), QVariant::toStringList(), and QVariant::userType().
Referenced by QPdfEnginePrivate::drawTextItem(), and QTextHtmlImporter::import().
|
inline |
Returns the the baseline offset in %.
Definition at line 556 of file qtextformat.h.
References QTextFormat::doubleProperty(), QTextFormat::hasProperty(), and QTextFormat::TextBaselineOffset.
QFont QTextCharFormat::font | ( | ) | const |
Returns the font for this character format.
Definition at line 2150 of file qtextformat.cpp.
References d.
Referenced by QQuickTextNodeEngine::addTextBlock(), QAbstractTextDocumentLayout::blockWithMarkerAt(), QTextMarkdownImporter::cbEnterSpan(), QTextMarkdownImporter::cbLeaveSpan(), QTextDocumentLayoutPrivate::drawListItem(), QTextDocumentLayoutPrivate::layoutBlock(), QScriptLine::setDefaultHeight(), and setFont().
|
inline |
Returns the current capitalization type of the font.
Definition at line 457 of file qtextformat.h.
References QTextFormat::FontCapitalization, and QTextFormat::intProperty().
Referenced by QTextEngine::itemize().
|
inline |
Definition at line 428 of file qtextformat.h.
References QTextFormat::FontFamilies, and property.
|
inline |
Returns true
if the text format's font is fixed pitch; otherwise returns false
.
Definition at line 493 of file qtextformat.h.
References QTextFormat::boolProperty(), and QTextFormat::FontFixedPitch.
|
inline |
Returns the hinting preference set for this text format.
Definition at line 515 of file qtextformat.h.
References QTextFormat::FontHintingPreference, and QTextFormat::intProperty().
|
inline |
Returns true
if the text format's font is italic; otherwise returns false
.
Definition at line 453 of file qtextformat.h.
References QTextFormat::boolProperty(), and QTextFormat::FontItalic.
Referenced by QTextMarkdownImporter::cbEnterSpan(), QTextMarkdownImporter::cbLeaveSpan(), and QTextHtmlExporter::toHtml().
|
inline |
Returns true
if the font kerning is enabled.
Definition at line 522 of file qtextformat.h.
References QTextFormat::boolProperty(), and QTextFormat::FontKerning.
|
inline |
Returns the current letter spacing.
Definition at line 465 of file qtextformat.h.
References QTextFormat::doubleProperty(), and QTextFormat::FontLetterSpacing.
Referenced by QTextHtmlExporter::toHtml().
|
inline |
Returns the letter spacing type of this format..
Definition at line 461 of file qtextformat.h.
References QTextFormat::FontLetterSpacingType, and QTextFormat::intProperty().
Referenced by QTextHtmlExporter::toHtml().
|
inline |
Returns true
if the text format's font is overlined; otherwise returns false
.
Definition at line 478 of file qtextformat.h.
References QTextFormat::boolProperty(), and QTextFormat::FontOverline.
Referenced by QTextItemInt::initWithScriptItem(), and QTextHtmlExporter::toHtml().
|
inline |
Returns the font size used to display text in this format.
Definition at line 444 of file qtextformat.h.
References QTextFormat::doubleProperty(), and QTextFormat::FontPointSize.
Referenced by QTextHtmlExporter::toHtml().
|
inline |
Returns the current font stretching.
Definition at line 498 of file qtextformat.h.
References QTextFormat::FontStretch, and QTextFormat::intProperty().
|
inline |
Returns true
if the text format's font is struck out (has a horizontal line drawn through it); otherwise returns false
.
Definition at line 483 of file qtextformat.h.
References QTextFormat::boolProperty(), and QTextFormat::FontStrikeOut.
Referenced by QTextItemInt::initWithScriptItem(), and QTextHtmlExporter::toHtml().
|
inline |
Returns the font style hint.
Definition at line 505 of file qtextformat.h.
References QTextFormat::FontStyleHint, and QTextFormat::intProperty().
|
inline |
Definition at line 438 of file qtextformat.h.
References QTextFormat::FontStyleName, and property.
|
inline |
Returns the current font style strategy.
Definition at line 507 of file qtextformat.h.
References QTextFormat::FontStyleStrategy, and QTextFormat::intProperty().
bool QTextCharFormat::fontUnderline | ( | ) | const |
Returns true
if the text format's font is underlined; otherwise returns false
.
Definition at line 1634 of file qtextformat.cpp.
References QTextFormat::boolProperty(), QTextFormat::FontUnderline, QTextFormat::hasProperty(), SingleUnderline, QTextFormat::TextUnderlineStyle, and underlineStyle().
Referenced by QTextHtmlExporter::toHtml().
|
inline |
Returns the text format's font weight.
Definition at line 449 of file qtextformat.h.
References FontWeight, QTextFormat::hasProperty(), QTextFormat::intProperty(), and QFont::Normal.
Referenced by QTextMarkdownImporter::cbEnterSpan(), QTextMarkdownImporter::cbLeaveSpan(), and QTextHtmlExporter::toHtml().
|
inline |
Returns the current word spacing value.
Definition at line 469 of file qtextformat.h.
References QTextFormat::doubleProperty(), and QTextFormat::FontWordSpacing.
Referenced by QTextHtmlExporter::toHtml().
|
inline |
Returns true
if the text is formatted as an anchor; otherwise returns false
.
Definition at line 561 of file qtextformat.h.
References QTextFormat::boolProperty(), and QTextFormat::IsAnchor.
Referenced by QQuickTextNodeEngine::addTextBlock(), and QTextHtmlImporter::import().
|
inline |
Returns true
if this character format is valid; otherwise returns false.
Definition at line 406 of file qtextformat.h.
References QTextFormat::isCharFormat().
Referenced by QTextCursor::charFormat(), QWidgetTextControlPrivate::inputMethodEvent(), QTextCursor::insertText(), and QTextDocumentPrivate::setCharFormat().
|
inline |
If anchor is true, text with this format represents an anchor, and is formatted in the appropriate way; otherwise the text is formatted normally.
(Anchors are hyperlinks which are often shown underlined and in a different color from plain text.)
The way the text is rendered is independent of whether or not the format has a valid anchor defined. Use setAnchorHref(), and optionally setAnchorNames() to create a hypertext link.
Definition at line 559 of file qtextformat.h.
References QTextFormat::IsAnchor, and setProperty().
Referenced by QTextHtmlParser::applyAttributes(), QTextMarkdownImporter::cbEnterSpan(), and QTextHtmlParserNode::initializeProperties().
Sets the hypertext link for the text format to the given value.
This is typically a URL like "http://example.com/index.html".
The anchor will be displayed with the value as its display text; if you want to display different text call setAnchorNames().
To format the text as a hypertext link use setAnchor().
Definition at line 564 of file qtextformat.h.
References QTextFormat::AnchorHref, and setProperty().
Referenced by QTextHtmlParser::applyAttributes(), and QTextMarkdownImporter::cbEnterSpan().
|
inline |
Sets the text format's anchor names. For the anchor to work as a hyperlink, the destination must be set with setAnchorHref() and the anchor must be enabled with setAnchor().
Definition at line 569 of file qtextformat.h.
References QTextFormat::AnchorName, and setProperty().
Referenced by QTextHtmlParser::applyAttributes().
Sets the base line (in % of height) of text to baseline. A positive value moves the text up, by the corresponding %; a negative value moves it down. The default value is 0.
Definition at line 554 of file qtextformat.h.
References setProperty(), and QTextFormat::TextBaselineOffset.
void QTextCharFormat::setFont | ( | const QFont & | font, |
FontPropertiesInheritanceBehavior | behavior = FontPropertiesAll |
||
) |
Sets the text format's font.
If behavior is QTextCharFormat::FontPropertiesAll, the font property that has not been explicitly set is treated like as it were set with default value; If behavior is QTextCharFormat::FontPropertiesSpecifiedOnly, the font property that has not been explicitly set is ignored and the respective property value remains unchanged.
Definition at line 2094 of file qtextformat.cpp.
References QFont::AllPropertiesResolved, QFont::capitalization(), QFont::CapitalizationResolved, QFont::families(), QFont::FamiliesResolved, QFont::fixedPitch(), QFont::FixedPitchResolved, font(), QTextFormat::FontPixelSize, FontPropertiesAll, QFont::hintingPreference(), QFont::HintingPreferenceResolved, QFont::kerning(), QFont::KerningResolved, QFont::letterSpacing(), QFont::LetterSpacingResolved, QFont::letterSpacingType(), NoUnderline, QFont::overline(), QFont::OverlineResolved, QFont::pixelSize(), QFont::pointSizeF(), QFont::resolveMask(), setFontCapitalization(), setFontFamilies(), setFontFixedPitch(), setFontHintingPreference(), setFontItalic(), setFontKerning(), setFontLetterSpacing(), setFontLetterSpacingType(), setFontOverline(), setFontPointSize(), setFontStretch(), setFontStrikeOut(), setFontStyleHint(), setFontStyleName(), setFontStyleStrategy(), setFontWeight(), setFontWordSpacing(), QTextFormat::setProperty(), setUnderlineStyle(), SingleUnderline, QFont::SizeResolved, QFont::stretch(), QFont::StretchResolved, QFont::strikeOut(), QFont::StrikeOutResolved, QFont::style(), QFont::styleHint(), QFont::StyleHintResolved, QFont::styleName(), QFont::StyleNameResolved, QFont::StyleNormal, QFont::StyleResolved, QFont::styleStrategy(), QFont::StyleStrategyResolved, QFont::underline(), QFont::UnderlineResolved, QFont::weight(), QFont::WeightResolved, QFont::wordSpacing(), and QFont::WordSpacingResolved.
Referenced by QTextHtmlExporter::QTextHtmlExporter(), and QTextMarkdownImporter::cbEnterSpan().
|
inline |
Sets the capitalization of the text that appears in this font to capitalization.
A font's capitalization makes the text appear in the selected capitalization mode.
Definition at line 455 of file qtextformat.h.
References QTextFormat::FontCapitalization, and setProperty().
Referenced by setFont().
|
inline |
Sets the text format's font families.
Definition at line 422 of file qtextformat.h.
References QTextFormat::FontFamilies, and setProperty().
Referenced by QTextHtmlParser::applyAttributes(), and setFont().
|
inline |
If fixedPitch is true, sets the text format's font to be fixed pitch; otherwise a non-fixed pitch font is used.
Definition at line 491 of file qtextformat.h.
References QTextFormat::FontFixedPitch, and setProperty().
Referenced by QTextMarkdownImporter::cbEnterSpan(), and setFont().
|
inline |
Sets the hinting preference of the text format's font to be hintingPreference.
Definition at line 510 of file qtextformat.h.
References QTextFormat::FontHintingPreference, and setProperty().
Referenced by setFont().
|
inline |
If italic is true, sets the text format's font to be italic; otherwise the font will be non-italic.
Definition at line 451 of file qtextformat.h.
References QTextFormat::FontItalic, and setProperty().
Referenced by QTextMarkdownImporter::cbEnterSpan(), main(), and setFont().
|
inline |
Enables kerning for this font if enable is true; otherwise disables it.
When kerning is enabled, glyph metrics do not add up anymore, even for Latin text. In other words, the assumption that width('a') + width('b') is equal to width("ab") is not neccesairly true.
Definition at line 520 of file qtextformat.h.
References QTextFormat::FontKerning, and setProperty().
Referenced by setFont().
Sets the letter spacing of this format to the given spacing. The meaning of the value depends on the font letter spacing type.
For percentage spacing a value of 100 indicates default spacing; a value of 200 doubles the amount of space a letter takes.
Definition at line 463 of file qtextformat.h.
References QTextFormat::FontLetterSpacing, setProperty(), and spacing.
Referenced by setFont().
|
inline |
Sets the letter spacing type of this format to letterSpacingType.
Definition at line 459 of file qtextformat.h.
References QTextFormat::FontLetterSpacingType, and setProperty().
Referenced by setFont().
|
inline |
If overline is true, sets the text format's font to be overlined; otherwise the font is displayed non-overlined.
Definition at line 476 of file qtextformat.h.
References QTextFormat::FontOverline, and setProperty().
Referenced by setFont().
Sets the text format's font size.
Definition at line 442 of file qtextformat.h.
References QTextFormat::FontPointSize, and setProperty().
Referenced by main(), and setFont().
|
inline |
Sets the stretch factor for the font to factor.
The stretch factor changes the width of all characters in the font by factor percent. For example, setting factor to 150 results in all characters in the font being 1.5 times (ie. 150%) wider. The default stretch factor is 100. The minimum stretch factor is 1, and the maximum stretch factor is 4000.
The stretch factor is only applied to outline fonts. The stretch factor is ignored for bitmap fonts.
Definition at line 496 of file qtextformat.h.
References QTextFormat::FontStretch, and setProperty().
Referenced by setFont().
|
inline |
If strikeOut is true, sets the text format's font with strike-out enabled (with a horizontal line through it); otherwise it is displayed without strikeout.
Definition at line 481 of file qtextformat.h.
References QTextFormat::FontStrikeOut, and setProperty().
Referenced by QTextMarkdownImporter::cbEnterSpan(), and setFont().
|
inline |
Sets the font style hint and strategy.
Qt does not support style hints on X11 since this information is not provided by the window system.
Definition at line 501 of file qtextformat.h.
References QTextFormat::FontStyleHint, QTextFormat::FontStyleStrategy, hint(), and setProperty().
Referenced by setFont().
Sets the text format's font styleName.
Definition at line 432 of file qtextformat.h.
References QTextFormat::FontStyleName, and setProperty().
Referenced by setFont().
|
inline |
Sets the font style strategy.
Definition at line 503 of file qtextformat.h.
References QTextFormat::FontStyleStrategy, and setProperty().
Referenced by setFont().
|
inline |
If underline is true, sets the text format's font to be underlined; otherwise it is displayed non-underlined.
Definition at line 472 of file qtextformat.h.
References NoUnderline, setProperty(), SingleUnderline, and QTextFormat::TextUnderlineStyle.
Referenced by QTextMarkdownImporter::cbEnterSpan(), main(), QAndroidInputContext::setComposingText(), and QAndroidInputContext::setSelection().
|
inline |
Sets the text format's font weight to weight.
Definition at line 447 of file qtextformat.h.
References FontWeight, and setProperty().
Referenced by QTextMarkdownImporter::cbEnterBlock(), QTextMarkdownImporter::cbEnterSpan(), src_gui_text_qsyntaxhighlighter::MyHighlighter::highlightBlock(), MainWindow::insertCalendar(), main(), and setFont().
Sets the word spacing of this format to the given spacing, in pixels.
Definition at line 467 of file qtextformat.h.
References QTextFormat::FontWordSpacing, setProperty(), and spacing.
Referenced by setFont().
Sets the subscript's base line as a % of font height to baseline. The default value is 16.67% (1/6 of height)
Definition at line 549 of file qtextformat.h.
References setProperty(), and QTextFormat::TextSubScriptBaseline.
Sets the superscript's base line as a % of font height to baseline. The default value is 50% (1/2 of height).
Definition at line 544 of file qtextformat.h.
References setProperty(), and QTextFormat::TextSuperScriptBaseline.
|
inline |
If this character format is applied to characters in a table cell, the cell will span tableCellColumnSpan columns.
Definition at line 597 of file qtextformat.h.
References QTextFormat::clearProperty(), QTextFormat::setProperty(), and QTextFormat::TableCellColumnSpan.
Referenced by QTextCopyHelper::copy().
|
inline |
If this character format is applied to characters in a table cell, the cell will span tableCellRowSpan rows.
Definition at line 589 of file qtextformat.h.
References QTextFormat::clearProperty(), setProperty(), and QTextFormat::TableCellRowSpan.
Referenced by QTextCopyHelper::copy().
Sets the pen used to draw the outlines of characters to the given pen.
Definition at line 534 of file qtextformat.h.
References setProperty(), and QTextFormat::TextOutline.
Sets the tool tip for a fragment of text to the given text.
Definition at line 539 of file qtextformat.h.
References setProperty(), and QTextFormat::TextToolTip.
Referenced by QTextHtmlParser::applyAttributes(), and QTextMarkdownImporter::cbEnterSpan().
Sets the color used to draw underlines, overlines and strikeouts on the characters with this format to the color specified.
Definition at line 486 of file qtextformat.h.
References setProperty(), and QTextFormat::TextUnderlineColor.
void QTextCharFormat::setUnderlineStyle | ( | UnderlineStyle | style | ) |
Sets the style of underlining the text to style.
Definition at line 1654 of file qtextformat.cpp.
References QTextFormat::FontUnderline, QTextFormat::setProperty(), SingleUnderline, and QTextFormat::TextUnderlineStyle.
Referenced by setFont().
|
inline |
Sets the vertical alignment used for the characters with this format to the alignment specified.
Definition at line 529 of file qtextformat.h.
References alignment, setProperty(), and QTextFormat::TextVerticalAlignment.
Referenced by QTextHtmlParser::applyAttributes().
|
inline |
Returns the subscript's base line as a % of font height.
Definition at line 551 of file qtextformat.h.
References QTextFormat::doubleProperty(), QTextFormat::hasProperty(), and QTextFormat::TextSubScriptBaseline.
|
inline |
Returns the superscript's base line as a % of font height.
Definition at line 546 of file qtextformat.h.
References QTextFormat::doubleProperty(), QTextFormat::hasProperty(), and QTextFormat::TextSuperScriptBaseline.
|
inline |
If this character format is applied to characters in a table cell, this function returns the number of columns spanned by the text (this may be 1); otherwise it returns 1.
Definition at line 577 of file qtextformat.h.
References QTextFormat::intProperty(), and QTextFormat::TableCellColumnSpan.
Referenced by QTextTableCell::columnSpan(), and QTextTableCell::setFormat().
|
inline |
If this character format is applied to characters in a table cell, this function returns the number of rows spanned by the text (this may be 1); otherwise it returns 1.
Definition at line 574 of file qtextformat.h.
References QTextFormat::intProperty(), and QTextFormat::TableCellRowSpan.
Referenced by QTextTableCell::rowSpan(), and QTextTableCell::setFormat().
|
inline |
Returns the pen used to draw the outlines of characters in this format.
Definition at line 536 of file qtextformat.h.
References QTextFormat::penProperty(), and QTextFormat::TextOutline.
|
inline |
Returns the tool tip that is displayed for a fragment of text.
Definition at line 541 of file qtextformat.h.
References QTextFormat::stringProperty(), and QTextFormat::TextToolTip.
|
inline |
Returns the color used to draw underlines, overlines and strikeouts on the characters with this format.
Definition at line 488 of file qtextformat.h.
References QTextFormat::colorProperty(), and QTextFormat::TextUnderlineColor.
Referenced by drawTextItemDecoration().
|
inline |
Returns the style of underlining the text.
Definition at line 526 of file qtextformat.h.
References QTextFormat::intProperty(), and QTextFormat::TextUnderlineStyle.
Referenced by fontUnderline(), and QTextItemInt::initWithScriptItem().
|
inline |
Returns the vertical alignment used for characters with this format.
Definition at line 531 of file qtextformat.h.
References QTextFormat::intProperty(), and QTextFormat::TextVerticalAlignment.
Referenced by QQuickTextNodeEngine::addTextBlock(), and QTextDocumentLayoutPrivate::layoutTable().
|
friend |
Definition at line 464 of file qtextformat.cpp.
|
friend |
Definition at line 469 of file qtextformat.cpp.
|
friend |
Definition at line 582 of file qtextformat.h.