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

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

Перейти к: навигация, поиск
40px Внимание: Актуальная версия перевода документации находится здесь

__NOTOC__

Image:qt-logo.png

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

Image:trolltech-logo.png

Содержание

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

The QTextOption class provides a description of general rich text properties. Далее...

 #include <QTextOption>

[править] Открытые типы

  • enum Flag { IncludeTrailingSpaces }
  • flags Flags
  • enum WrapMode { NoWrap, WordWrap, ManualWrap, WrapAnywhere, WrapAtWordBoundaryOrAnywhere }

[править] Открытые функции


[править] Подробное описание

The QTextOption class provides a description of general rich text properties.

QTextOption is used to encapsulate common rich text properties in a single object. It contains information about text alignment, layout direction, word wrapping, and other standard properties associated with text rendering and layout.

See also QTextEdit, QTextDocument, and QTextCursor.


[править] Описание типов

[править]
enum QTextOption::Flag
flags QTextOption::Flags

Константа Значение
QTextOption::IncludeTrailingSpaces 0x80000000

The Flags type is a typedef for QFlags<Flag>. It stores an OR combination of Flag values.

[править]
enum QTextOption::WrapMode

This enum describes how text is wrapped in a document.


Константа Значение Описание
QTextOption::NoWrap 0 Text is not wrapped at all.
QTextOption::WordWrap 1 Text is wrapped at word boundaries.
QTextOption::ManualWrap 2 Wrapping occurs at a manually specified length from the start of the line.
QTextOption::WrapAnywhere 3 Text can be wrapped at any point on a line, even if it occurs in the middle of a word.
QTextOption::WrapAtWordBoundaryOrAnywhere 4 If possible, wrapping occurs at a word boundary; otherwise it will occur at the appropriate point on the line, even in the middle of a word.

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

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

Constructs a text option with default properties for text.

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

Constructs a text option with the given alignment for text.

[править]
QTextOption::QTextOption ( const QTextOption & other )

Construct a copy of the other text option.

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

Destroys the text option.

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

Returns the text alignment defined by the option.

See also setAlignment().

[править]
Flags QTextOption::flags () const

Returns the flags associated with the option.

See also setFlags().

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

Sets the option's text alignment to the specified alignment.

See also alignment().

[править]
void QTextOption::setFlags ( Flags flags )

Sets the flags associated with the option to the given flags.

See also flags().

[править]
void QTextOption::setTabArray ( QList< qreal> tabStops )

Sets the tab positions for the text layout to those specified by tabStops.

See also tabArray() and setTabStop().

[править]
void QTextOption::setTabStop ( qreal tabStop )

Sets the distance in device units between tab stops to the value specified by tabStop.

See also tabStop() and setTabArray().

[править]
void QTextOption::setTextDirection ( Qt::LayoutDirection direction )

Sets the direction of the text layout defined by the option to the given direction.

See also textDirection().

[править]
void QTextOption::setUseDesignMetrics ( bool enable )

If enable is true then the layout will use design metrics; otherwise it will use the metrics of the paint device (which is the default behavior).

See also useDesignMetrics().

[править]
void QTextOption::setWrapMode ( WrapMode mode )

Sets the option's text wrap mode to the given mode.

See also wrapMode().

[править]
QList< qreal> QTextOption::tabArray () const

Returns a list of tab positions defined for the text layout.

See also setTabArray() and tabStop().

[править]
qreal QTextOption::tabStop () const

Returns the distance in device units between tab stops.

See also setTabStop() and tabArray().

[править]
Qt::LayoutDirection QTextOption::textDirection () const

Returns the direction of the text layout defined by the option.

See also setTextDirection().

[править]
bool QTextOption::useDesignMetrics () const

Returns true if the layout uses design rather than device metrics; otherwise returns false.

See also setUseDesignMetrics().

[править]
WrapMode QTextOption::wrapMode () const

Returns the text wrap mode defined by the option.

See also setWrapMode().

[править]
QTextOption & QTextOption::operator= ( const QTextOption & other )

Returns true if the text option is the same as the other text option; otherwise returns false.



Copyright © 2007 Trolltech Trademarks
Qt 4.3.2