- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Classes | Public Types | Public Member Functions | Friends

# QTextLayout Class Reference

Search for all occurrences

## Detailed Description

Definition at line 103 of file qtextlayout.h.

`#include <qtextlayout.h>`

List of all members.

## Classes
struct | FormatRange
## Public Types
enum | CursorMode { SkipCharacters, SkipWords }
## Public Member Functions
| QTextLayout ()
| QTextLayout (const QString &text)
| QTextLayout (const QString &text, const QFont &font, QPaintDevice *paintdevice=0)
| QTextLayout (const QTextBlock &b)
| ~QTextLayout ()
void | setFont (const QFont &f)
QFont | font () const
void | setText (const QString &string)
QString | text () const
void | setTextOption (const QTextOption &option)
QTextOption | textOption () const
void | setPreeditArea (int position, const QString &text)
int | preeditAreaPosition () const
QString | preeditAreaText () const
void | setAdditionalFormats (const QList< FormatRange > &overrides)
QList< FormatRange > | additionalFormats () const
void | clearAdditionalFormats ()
void | setCacheEnabled (bool enable)
bool | cacheEnabled () const
void | beginLayout ()
void | endLayout ()
void | clearLayout ()
QTextLine | createLine ()
int | lineCount () const
QTextLine | lineAt (int i) const
QTextLine | lineForTextPosition (int pos) const
bool | isValidCursorPosition (int pos) const
int | nextCursorPosition (int oldPos, CursorMode mode=SkipCharacters) const
int | previousCursorPosition (int oldPos, CursorMode mode=SkipCharacters) const
void | draw (QPainter *p, const QPointF &pos, const QVector< FormatRange > &selections=QVector< FormatRange >(), const QRectF &clip=QRectF()) const
void | drawCursor (QPainter *p, const QPointF &pos, int cursorPosition) const
void | drawCursor (QPainter *p, const QPointF &pos, int cursorPosition, int width) const
QPointF | position () const
void | setPosition (const QPointF &p)
QRectF | boundingRect () const
qreal | minimumWidth () const
qreal | maximumWidth () const
QTextEngine * | engine () const
void | setFlags (int flags)
## Friends
class | QPainter
class | QPSPrinter
class | QGraphicsSimpleTextItemPrivate
class | QGraphicsSimpleTextItem
void | qt_format_text (const QFont &font, const QRectF &_r, int tf, const QTextOption *, const QString &str, QRectF *brect, int tabstops, int *tabarray, int tabarraylen, QPainter *painter)

## Member Enumeration Documentation

enum CursorMode

Search for all occurrences

Enumerator:

  SkipCharacters | Search for all occurrences
  SkipWords | Search for all occurrences

Definition at line 148 of file qtextlayout.h.

                        {
            SkipCharacters,
            SkipWords
        };

## Constructor & Destructor Documentation

QTextLayout | ( |  | ) |

QTextLayout | ( | const QString & | text | ) |

QTextLayout | ( | const QString & | text,
|  | const QFont & | font,
|  | QPaintDevice * | paintdevice = `0`
| ) |  |

QTextLayout | ( | const QTextBlock & | b | ) |

~QTextLayout | ( |  | ) |

## Member Function Documentation

void setFont | ( | const QFont & | f | ) |

Search for all occurrences

QFont font | ( |  | ) | const

Search for all occurrences

void setText | ( | const QString & | string | ) |

Search for all occurrences

QString text | ( |  | ) | const

Search for all occurrences

void setTextOption | ( | const QTextOption & | option | ) |

Search for all occurrences

QTextOption textOption | ( |  | ) | const

Search for all occurrences

void setPreeditArea | ( | int | position,
|  | const QString & | text
| ) |  |

Search for all occurrences

int preeditAreaPosition | ( |  | ) | const

Search for all occurrences

QString preeditAreaText | ( |  | ) | const

Search for all occurrences

void setAdditionalFormats | ( | const QList< FormatRange > & | overrides | ) |

Search for all occurrences

QList<FormatRange> additionalFormats | ( |  | ) | const

Search for all occurrences

void clearAdditionalFormats | ( |  | ) |

Search for all occurrences

void setCacheEnabled | ( | bool | enable | ) |

Search for all occurrences

bool cacheEnabled | ( |  | ) | const

Search for all occurrences

void beginLayout | ( |  | ) |

Search for all occurrences

void endLayout | ( |  | ) |

Search for all occurrences

void clearLayout | ( |  | ) |

Search for all occurrences

QTextLine createLine | ( |  | ) |

Search for all occurrences

int lineCount | ( |  | ) | const

Search for all occurrences

QTextLine lineAt | ( | int | i | ) | const

Search for all occurrences

QTextLine lineForTextPosition | ( | int | pos | ) | const

Search for all occurrences

bool isValidCursorPosition | ( | int | pos | ) | const

Search for all occurrences

int nextCursorPosition | ( | int | oldPos,
|  | CursorMode | mode = `SkipCharacters`
| ) |  | const

Search for all occurrences

int previousCursorPosition | ( | int | oldPos,
|  | CursorMode | mode = `SkipCharacters`
| ) |  | const

Search for all occurrences

void draw | ( | QPainter * | p,
|  | const QPointF & | pos,
|  | const QVector< FormatRange > & | selections = `QVector< FormatRange >()`,
|  | const QRectF & | clip = `QRectF()`
| ) |  | const

Search for all occurrences

void drawCursor | ( | QPainter * | p,
|  | const QPointF & | pos,
|  | int | cursorPosition
| ) |  | const

Search for all occurrences

void drawCursor | ( | QPainter * | p,
|  | const QPointF & | pos,
|  | int | cursorPosition,
|  | int | width
| ) |  | const

Search for all occurrences

QPointF position | ( |  | ) | const

Search for all occurrences

void setPosition | ( | const QPointF & | p | ) |

Search for all occurrences

QRectF boundingRect | ( |  | ) | const

Search for all occurrences

qreal minimumWidth | ( |  | ) | const

Search for all occurrences

qreal maximumWidth | ( |  | ) | const

Search for all occurrences

QTextEngine* engine | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 169 of file qtextlayout.h.

    { return d; }

void setFlags | ( | int | flags | ) |

Search for all occurrences

## Friends And Related Function Documentation

friend class QPainter `[friend]`

Search for all occurrences

Definition at line 175 of file qtextlayout.h.

friend class QPSPrinter `[friend]`

Search for all occurrences

Definition at line 176 of file qtextlayout.h.

friend class QGraphicsSimpleTextItemPrivate `[friend]`

Search for all occurrences

Definition at line 177 of file qtextlayout.h.

friend class QGraphicsSimpleTextItem `[friend]`

Search for all occurrences

Definition at line 178 of file qtextlayout.h.

void qt_format_text | ( | const QFont & | font,
|  | const QRectF & | _r,
|  | int | tf,
|  | const QTextOption * | ,
|  | const QString & | str,
|  | QRectF * | brect,
|  | int | tabstops,
|  | int * | tabarray,
|  | int | tabarraylen,
|  | QPainter * | painter
| ) |  | `[friend]`

Search for all occurrences

The documentation for this class was generated from the following file:

- QtGui/qtextlayout.h

QTextLayout QTextLayout QTextLayout QTextLayout QTextLayout QTextLayout QTextLayout QTextLayout QTextLayout QTextLayout
QTextLayout QTextLayout QTextLayout QTextLayout QTextLayout QTextLayout QTextLayout QTextLayout QTextLayout QTextLayout