QTextBlockFormat Class ReferenceThe QTextBlockFormat class provides formatting information for blocks of text in a QTextDocument. Далее... #include <QTextBlockFormat> Inherits: QTextFormat. Замечание: Все функции в этом классе реентерабельны. Открытые типы
Открытые функции
Подробное описаниеThe QTextBlockFormat class provides formatting information for blocks of text in a QTextDocument. A document is composed of a list of blocks, represented by QTextBlock objects. Each block can contain an item of some kind, such as a paragraph of text, a table, a list, or an image. Every block has an associated QTextBlockFormat that specifies its characteristics. To cater for left-to-right and right-to-left languages you can set a block's direction with setDirection(). Paragraph alignment is set with setAlignment(). Margins are controlled by setTopMargin(), setBottomMargin(), setLeftMargin(), setRightMargin(). Overall indentation is set with setIndent(), the indentation of the first line with setTextIndent(). Line spacing is set with setLineHeight() and retrieved via lineHeight() and lineHeightType(). The types of line spacing available are in the LineHeightTypes enum. Line breaking can be enabled and disabled with setNonBreakableLines(). The brush used to paint the paragraph's background is set with setBackground(), and other aspects of the text's appearance can be customized by using the setProperty() function with the OutlinePen, ForegroundBrush, and BackgroundBrush QTextFormat::Property values. If a text block is part of a list, it can also have a list format that is accessible with the listFormat() function. See also QTextBlock and QTextCharFormat. Описание типов-членовenum QTextBlockFormat::LineHeightTypesThis enum describes the various types of line spacing support paragraphs can have.
Данное перечисление было введено или модифицировано в Qt 4.8. See also lineHeight(), lineHeightType(), and setLineHeight(). Описание функций-членовQTextBlockFormat::QTextBlockFormat ()Constructs a new QTextBlockFormat. Qt::Alignment QTextBlockFormat::alignment () constReturns the paragraph's alignment. Смотрите также setAlignment(). qreal QTextBlockFormat::bottomMargin () constReturns the paragraph's bottom margin. See also setBottomMargin() and topMargin(). int QTextBlockFormat::indent () constReturns the paragraph's indent. See also setIndent(). bool QTextBlockFormat::isValid () constReturns true if this block format is valid; otherwise returns false. qreal QTextBlockFormat::leftMargin () constReturns the paragraph's left margin. See also setLeftMargin(), rightMargin(), and indent(). qreal QTextBlockFormat::lineHeight ( qreal scriptLineHeight, qreal scaling ) constReturns the height of the lines in the paragraph based on the height of the script line given by scriptLineHeight and the specified scaling factor. The value that is returned is also dependent on the given LineHeightType of the paragraph as well as the LineHeight setting that has been set for the paragraph. The scaling is needed for heights that include a fixed number of pixels, to scale them appropriately for printing. Эта функция была введена в Qt 4.8. See also LineHeightTypes, setLineHeight(), and lineHeightType(). qreal QTextBlockFormat::lineHeight () constThis returns the LineHeight property for the paragraph. Эта функция была введена в Qt 4.8. See also LineHeightTypes, setLineHeight(), and lineHeightType(). int QTextBlockFormat::lineHeightType () constThis returns the LineHeightType property of the paragraph. Эта функция была введена в Qt 4.8. See also LineHeightTypes, setLineHeight(), and lineHeight(). bool QTextBlockFormat::nonBreakableLines () constReturns true if the lines in the paragraph are non-breakable; otherwise returns false. See also setNonBreakableLines(). PageBreakFlags QTextBlockFormat::pageBreakPolicy () constReturns the currently set page break policy for the paragraph. The default is QTextFormat::PageBreak_Auto. Эта функция была введена в Qt 4.2. See also setPageBreakPolicy(). qreal QTextBlockFormat::rightMargin () constReturns the paragraph's right margin. See also setRightMargin() and leftMargin(). void QTextBlockFormat::setAlignment ( Qt::Alignment alignment )Sets the paragraph's alignment. Смотрите также alignment(). void QTextBlockFormat::setBottomMargin ( qreal margin )Sets the paragraph's bottom margin. See also bottomMargin(), setTopMargin(), setLeftMargin(), and setRightMargin(). void QTextBlockFormat::setIndent ( int indentation )Sets the paragraph's indentation. Margins are set independently of indentation with setLeftMargin() and setTextIndent(). The indentation is an integer that is multiplied with the document-wide standard indent, resulting in the actual indent of the paragraph. See also indent() and QTextDocument::indentWidth(). void QTextBlockFormat::setLeftMargin ( qreal margin )Sets the paragraph's left margin. Indentation can be applied separately with setIndent(). See also leftMargin(), setRightMargin(), setTopMargin(), and setBottomMargin(). void QTextBlockFormat::setLineHeight ( qreal height, int heightType )Sets the line height for the paragraph to the value given by height which is dependent on heightType in the way described by the LineHeightTypes enum. Эта функция была введена в Qt 4.8. See also LineHeightTypes, lineHeight(), and lineHeightType(). void QTextBlockFormat::setNonBreakableLines ( bool b )If b is true, the lines in the paragraph are treated as non-breakable; otherwise they are breakable. See also nonBreakableLines(). void QTextBlockFormat::setPageBreakPolicy ( PageBreakFlags policy )Sets the page break policy for the paragraph to policy. Эта функция была введена в Qt 4.2. See also pageBreakPolicy(). void QTextBlockFormat::setRightMargin ( qreal margin )Sets the paragraph's right margin. See also rightMargin(), setLeftMargin(), setTopMargin(), and setBottomMargin(). void QTextBlockFormat::setTabPositions ( const QList<QTextOption::Tab> & tabs )Sets the tab positions for the text block to those specified by tabs. Эта функция была введена в Qt 4.4. See also tabPositions(). void QTextBlockFormat::setTextIndent ( qreal indent )Sets the indent for the first line in the block. This allows the first line of a paragraph to be indented differently to the other lines, enhancing the readability of the text. See also textIndent(), setLeftMargin(), setRightMargin(), setTopMargin(), and setBottomMargin(). void QTextBlockFormat::setTopMargin ( qreal margin )Sets the paragraph's top margin. See also topMargin(), setBottomMargin(), setLeftMargin(), and setRightMargin(). QList<QTextOption::Tab> QTextBlockFormat::tabPositions () constReturns a list of tab positions defined for the text block. Эта функция была введена в Qt 4.4. See also setTabPositions(). qreal QTextBlockFormat::textIndent () constReturns the paragraph's text indent. See also setTextIndent(). qreal QTextBlockFormat::topMargin () constReturns the paragraph's top margin. See also setTopMargin() and bottomMargin(). |
Попытка перевода Qt документации. Если есть желание присоединиться, или если есть замечания или пожелания, то заходите на форум: Перевод Qt документации на русский язык... Люди внесшие вклад в перевод: Команда переводчиков |