QTextCharFormat Class ReferenceThe QTextCharFormat class provides formatting information for characters in a QTextDocument. Далее... #include <QTextCharFormat> Inherits: QTextFormat. Inherited by: QTextImageFormat and QTextTableCellFormat. Замечание: Все функции в этом классе реентерабельны. Открытые типы
Открытые функции
Подробное описаниеThe QTextCharFormat class provides formatting information for characters in a QTextDocument. 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. setFontFamily() 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. See also QTextFormat, QTextBlockFormat, QTextTableFormat, and QTextListFormat. Описание типов-членовenum QTextCharFormat::UnderlineStyleThis enum describes the different ways drawing underlined text.
See also Qt::PenStyle. enum QTextCharFormat::VerticalAlignmentThis enum describes the ways that adjacent characters can be vertically aligned.
Описание функций-членовQTextCharFormat::QTextCharFormat ()Constructs a new character format object. QString QTextCharFormat::anchorHref () constReturns the text format's hypertext link, or an empty string if none has been set. See also setAnchorHref(). QStringList QTextCharFormat::anchorNames () constReturns 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. Эта функция была введена в Qt 4.3. See also setAnchorNames(). QFont QTextCharFormat::font () constReturns the font for this character format. Смотрите также setFont(). QFont::Capitalization QTextCharFormat::fontCapitalization () constReturns the current capitalization type of the font. Эта функция была введена в Qt 4.4. See also setFontCapitalization(). QString QTextCharFormat::fontFamily () constReturns the text format's font family. See also setFontFamily() and font(). bool QTextCharFormat::fontFixedPitch () constReturns true if the text format's font is fixed pitch; otherwise returns false. See also setFontFixedPitch() and font(). QFont::HintingPreference QTextCharFormat::fontHintingPreference () constReturns the hinting preference set for this text format. Эта функция была введена в Qt 4.8. See also setFontHintingPreference(), font(), and QFont::hintingPreference(). bool QTextCharFormat::fontItalic () constReturns true if the text format's font is italic; otherwise returns false. See also setFontItalic() and font(). bool QTextCharFormat::fontKerning () constReturns true if the font kerning is enabled. Эта функция была введена в Qt 4.5. See also setFontKerning() and font(). qreal QTextCharFormat::fontLetterSpacing () constReturns the current letter spacing percentage. Эта функция была введена в Qt 4.4. See also setFontLetterSpacing(). bool QTextCharFormat::fontOverline () constReturns true if the text format's font is overlined; otherwise returns false. See also setFontOverline() and font(). qreal QTextCharFormat::fontPointSize () constReturns the font size used to display text in this format. See also setFontPointSize() and font(). bool QTextCharFormat::fontStrikeOut () constReturns true if the text format's font is struck out (has a horizontal line drawn through it); otherwise returns false. See also setFontStrikeOut() and font(). QFont::StyleHint QTextCharFormat::fontStyleHint () constReturns the font style hint. Эта функция была введена в Qt 4.5. See also setFontStyleHint() and font(). QFont::StyleStrategy QTextCharFormat::fontStyleStrategy () constReturns the current font style strategy. Эта функция была введена в Qt 4.5. See also setFontStyleStrategy() and font(). bool QTextCharFormat::fontUnderline () constReturns true if the text format's font is underlined; otherwise returns false. See also setFontUnderline() and font(). int QTextCharFormat::fontWeight () constReturns the text format's font weight. See also setFontWeight(), font(), and QFont::Weight. qreal QTextCharFormat::fontWordSpacing () constReturns the current word spacing value. Эта функция была введена в Qt 4.4. See also setFontWordSpacing(). bool QTextCharFormat::isAnchor () constReturns true if the text is formatted as an anchor; otherwise returns false. See also setAnchor(), setAnchorHref(), and setAnchorNames(). bool QTextCharFormat::isValid () constReturns true if this character format is valid; otherwise returns false. void QTextCharFormat::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. (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. See also isAnchor(). void QTextCharFormat::setAnchorHref ( const QString & value )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(). See also anchorHref(). void QTextCharFormat::setAnchorNames ( const QStringList & names )Sets the text format's anchor names. Для того, чтобы якорь работал как гиперссылка, приёмник должен быть присвоен с помощью setAnchorHref(), а якорь должен быть разрешён с помощью setAnchor(). Эта функция была введена в Qt 4.3. See also anchorNames(). void QTextCharFormat::setFont ( const QFont & font )Sets the text format's font. Смотрите также font(). void QTextCharFormat::setFontCapitalization ( QFont::Capitalization capitalization )Sets the capitalization of the text that apppears in this font to capitalization. A font's capitalization makes the text appear in the selected capitalization mode. Эта функция была введена в Qt 4.4. See also fontCapitalization(). void QTextCharFormat::setFontFamily ( const QString & family )Sets the text format's font family. See also fontFamily() and setFont(). void QTextCharFormat::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. See also fontFixedPitch() and setFont(). void QTextCharFormat::setFontHintingPreference ( QFont::HintingPreference hintingPreference )Sets the hinting preference of the text format's font to be hintingPreference. Эта функция была введена в Qt 4.8. See also fontHintingPreference(), setFont(), and QFont::setHintingPreference(). void QTextCharFormat::setFontItalic ( bool italic )If italic is true, sets the text format's font to be italic; otherwise the font will be non-italic. See also fontItalic() and setFont(). void QTextCharFormat::setFontKerning ( bool enable )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. Эта функция была введена в Qt 4.5. See also fontKerning() and setFont(). void QTextCharFormat::setFontLetterSpacing ( qreal spacing )Sets the letter spacing of this format to the given spacing, in percent. A value of 100 indicates default spacing; a value of 200 doubles the amount of space a letter takes. Эта функция была введена в Qt 4.4. See also fontLetterSpacing(). void QTextCharFormat::setFontOverline ( bool overline )If overline is true, sets the text format's font to be overlined; otherwise the font is displayed non-overlined. See also fontOverline() and setFont(). void QTextCharFormat::setFontPointSize ( qreal size )Sets the text format's font size. See also fontPointSize() and setFont(). void QTextCharFormat::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. See also fontStrikeOut() and setFont(). void QTextCharFormat::setFontStyleHint ( QFont::StyleHint hint, QFont::StyleStrategy strategy = QFont::PreferDefault )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. Эта функция была введена в Qt 4.5. See also fontStyleHint(), setFont(), and QFont::setStyleHint(). void QTextCharFormat::setFontStyleStrategy ( QFont::StyleStrategy strategy )Sets the font style strategy. Эта функция была введена в Qt 4.5. See also fontStyleStrategy(), setFont(), and QFont::setStyleStrategy(). void QTextCharFormat::setFontUnderline ( bool underline )If underline is true, sets the text format's font to be underlined; otherwise it is displayed non-underlined. See also fontUnderline() and setFont(). void QTextCharFormat::setFontWeight ( int weight )Sets the text format's font weight to weight. See also fontWeight(), setFont(), and QFont::Weight. void QTextCharFormat::setFontWordSpacing ( qreal spacing )Sets the word spacing of this format to the given spacing, in pixels. Эта функция была введена в Qt 4.4. See also fontWordSpacing(). void QTextCharFormat::setTextOutline ( const QPen & pen )Sets the pen used to draw the outlines of characters to the given pen. See also textOutline(). void QTextCharFormat::setToolTip ( const QString & text )Sets the tool tip for a fragment of text to the given text. Эта функция была введена в Qt 4.3. See also toolTip(). void QTextCharFormat::setUnderlineColor ( const QColor & color )Sets the underline color used for the characters with this format to the color specified. See also underlineColor(). void QTextCharFormat::setUnderlineStyle ( UnderlineStyle style )Sets the style of underlining the text to style. Эта функция была введена в Qt 4.2. See also underlineStyle(). void QTextCharFormat::setVerticalAlignment ( VerticalAlignment alignment )Sets the vertical alignment used for the characters with this format to the alignment specified. See also verticalAlignment(). QPen QTextCharFormat::textOutline () constReturns the pen used to draw the outlines of characters in this format. See also setTextOutline(). QString QTextCharFormat::toolTip () constReturns the tool tip that is displayed for a fragment of text. Эта функция была введена в Qt 4.3. Смотрите также setToolTip(). QColor QTextCharFormat::underlineColor () constReturns the color used to underline the characters with this format. See also setUnderlineColor(). UnderlineStyle QTextCharFormat::underlineStyle () constReturns the style of underlining the text. Эта функция была введена в Qt 4.2. See also setUnderlineStyle(). VerticalAlignment QTextCharFormat::verticalAlignment () constReturns the vertical alignment used for characters with this format. See also setVerticalAlignment(). |
Попытка перевода Qt документации. Если есть желание присоединиться, или если есть замечания или пожелания, то заходите на форум: Перевод Qt документации на русский язык... Люди внесшие вклад в перевод: Команда переводчиков |