Qt:Документация 4.3.2/qtextblockformat

Материал из Wiki.crossplatform.ru

Версия от 12:02, 12 января 2009; Root (Обсуждение | вклад)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск
40px Внимание: Актуальная версия перевода документации находится здесь

__NOTOC__

Image:qt-logo.png

Главная · Все классы · Основные классы · Классы по группам · Модули · Функции

Image:trolltech-logo.png

Содержание

[править] QTextBlockFormat Class Reference
[модуль QtGui ]

The 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 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.


[править] Описание функций-членов

[править]
QTextBlockFormat::QTextBlockFormat ()

Constructs a new QTextBlockFormat.

[править]
Qt::Alignment QTextBlockFormat::alignment () const

Returns the paragraph's alignment.

See also setAlignment().

[править]
qreal QTextBlockFormat::bottomMargin () const

Returns the paragraph's bottom margin.

See also setBottomMargin() and topMargin().

[править]
int QTextBlockFormat::indent () const

Returns the paragraph's indent.

See also setIndent().

[править]
bool QTextBlockFormat::isValid () const

Returns true if this block format is valid; otherwise returns false.

[править]
qreal QTextBlockFormat::leftMargin () const

Returns the paragraph's left margin.

See also setLeftMargin(), rightMargin(), and indent().

[править]
bool QTextBlockFormat::nonBreakableLines () const

Returns true if the lines in the paragraph are non-breakable; otherwise returns false.

See also setNonBreakableLines().

[править]
PageBreakFlags QTextBlockFormat::pageBreakPolicy () const

Returns the currently set page break policy for the paragraph. The default is QTextFormat::PageBreak_Auto.

Эта функция была введена в Qt 4.2.

See also setPageBreakPolicy().

[править]
qreal QTextBlockFormat::rightMargin () const

Returns the paragraph's right margin.

See also setRightMargin() and leftMargin().

[править]
void QTextBlockFormat::setAlignment ( Qt::Alignment alignment )

Sets the paragraph's alignment.

See also 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 setTextIdent().

See also indent().

[править]
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::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::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().

[править]
qreal QTextBlockFormat::textIndent () const

Returns the paragraph's text indent.

See also setTextIndent().

[править]
qreal QTextBlockFormat::topMargin () const

Returns the paragraph's top margin.

See also setTopMargin() and bottomMargin().



Copyright © 2007 Trolltech Trademarks
Qt 4.3.2