|  | Home · All Classes · Main Classes · Annotated · Grouped Classes · Functions |

# QTextOption Class Reference

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

    #include <QTextOption>

Part of the QtGui module.

- List of all members, including inherited members

### Public Types

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

### Public Functions

- QTextOption ()
- QTextOption ( Qt::Alignment alignment )
- QTextOption ( const QTextOption & o )
- ~QTextOption ()
- Qt::Alignment alignment () const
- Flags flags () const
- void setAlignment ( Qt::Alignment alignment )
- void setFlags ( Flags flags )
- void setTabArray ( QList<qreal> tabStops )
- void setTabStop ( qreal tabStop )
- void setTextDirection ( Qt::LayoutDirection aDirection )
- void setUseDesignMetrics ( bool b )
- void setWrapMode ( WrapMode wrap )
- QList<qreal> tabArray () const
- qreal tabStop () const
- Qt::LayoutDirection textDirection () const
- bool useDesignMetrics () const
- WrapMode wrapMode () const
- QTextOption & operator= ( const QTextOption & o )

## Detailed Description

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.

## Member Type Documentation

### enum QTextOption::Flag
flags QTextOption::Flags

The `Flags` type stores an OR combination of `Flag` values.

### enum QTextOption::WrapMode

This enum describes how text is wrapped in a document.

Constant | Value | Description
--- | --- | ---
`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.

## Member Function Documentation

### QTextOption::QTextOption ()

### QTextOption::QTextOption ( Qt::Alignment alignment )

### QTextOption::QTextOption ( const QTextOption & o )

### QTextOption::~QTextOption ()

### Qt::Alignment QTextOption::alignment () const

### Flags QTextOption::flags () const

### void QTextOption::setAlignment ( Qt::Alignment alignment )

### void QTextOption::setFlags ( Flags flags )

### void QTextOption::setTabArray ( QList<qreal> tabStops )

### void QTextOption::setTabStop ( qreal tabStop )

### void QTextOption::setTextDirection ( Qt::LayoutDirection aDirection )

### void QTextOption::setUseDesignMetrics ( bool b )

### void QTextOption::setWrapMode ( WrapMode wrap )

### QList<qreal> QTextOption::tabArray () const

### qreal QTextOption::tabStop () const

### Qt::LayoutDirection QTextOption::textDirection () const

### bool QTextOption::useDesignMetrics () const

### WrapMode QTextOption::wrapMode () const

### QTextOption & QTextOption::operator= ( const QTextOption & o )