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

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Friends

# QTextCursor Class Reference

Search for all occurrences

## Detailed Description

Definition at line 70 of file qtextcursor.h.

`#include <qtextcursor.h>`

List of all members.

## Public Types
enum | MoveMode { MoveAnchor, KeepAnchor }
enum | MoveOperation { NoMove, Start, Up, StartOfLine, StartOfBlock, StartOfWord, PreviousBlock, PreviousCharacter, PreviousWord, Left, WordLeft, End, Down, EndOfLine, EndOfWord, EndOfBlock, NextBlock, NextCharacter, NextWord, Right, WordRight, NextCell, PreviousCell, NextRow, PreviousRow }
enum | SelectionType { WordUnderCursor, LineUnderCursor, BlockUnderCursor, Document }
## Public Member Functions
| QTextCursor ()
| QTextCursor (QTextDocument *document)
| QTextCursor (QTextDocumentPrivate *p, int pos)
| QTextCursor (QTextFrame *frame)
| QTextCursor (const QTextBlock &block)
| QTextCursor (QTextCursorPrivate *d)
| QTextCursor (const QTextCursor &cursor)
QTextCursor & | operator= (const QTextCursor &other)
| ~QTextCursor ()
bool | isNull () const
void | setPosition (int pos, MoveMode mode=MoveAnchor)
int | position () const
int | positionInBlock () const
int | anchor () const
void | insertText (const QString &text)
void | insertText (const QString &text, const QTextCharFormat &format)
bool | movePosition (MoveOperation op, MoveMode=MoveAnchor, int n=1)
bool | visualNavigation () const
void | setVisualNavigation (bool b)
void | setVerticalMovementX (int x)
int | verticalMovementX () const
void | setKeepPositionOnInsert (bool b)
bool | keepPositionOnInsert () const
void | deleteChar ()
void | deletePreviousChar ()
void | select (SelectionType selection)
bool | hasSelection () const
bool | hasComplexSelection () const
void | removeSelectedText ()
void | clearSelection ()
int | selectionStart () const
int | selectionEnd () const
QString | selectedText () const
QTextDocumentFragment | selection () const
void | selectedTableCells (int *firstRow, int *numRows, int *firstColumn, int *numColumns) const
QTextBlock | block () const
QTextCharFormat | charFormat () const
void | setCharFormat (const QTextCharFormat &format)
void | mergeCharFormat (const QTextCharFormat &modifier)
QTextBlockFormat | blockFormat () const
void | setBlockFormat (const QTextBlockFormat &format)
void | mergeBlockFormat (const QTextBlockFormat &modifier)
QTextCharFormat | blockCharFormat () const
void | setBlockCharFormat (const QTextCharFormat &format)
void | mergeBlockCharFormat (const QTextCharFormat &modifier)
bool | atBlockStart () const
bool | atBlockEnd () const
bool | atStart () const
bool | atEnd () const
void | insertBlock ()
void | insertBlock (const QTextBlockFormat &format)
void | insertBlock (const QTextBlockFormat &format, const QTextCharFormat &charFormat)
QTextList * | insertList (const QTextListFormat &format)
QTextList * | insertList (QTextListFormat::Style style)
QTextList * | createList (const QTextListFormat &format)
QTextList * | createList (QTextListFormat::Style style)
QTextList * | currentList () const
QTextTable * | insertTable (int rows, int cols, const QTextTableFormat &format)
QTextTable * | insertTable (int rows, int cols)
QTextTable * | currentTable () const
QTextFrame * | insertFrame (const QTextFrameFormat &format)
QTextFrame * | currentFrame () const
void | insertFragment (const QTextDocumentFragment &fragment)
void | insertHtml (const QString &html)
void | insertImage (const QTextImageFormat &format, QTextFrameFormat::Position alignment)
void | insertImage (const QTextImageFormat &format)
void | insertImage (const QString &name)
void | insertImage (const QImage &image, const QString &name=QString())
void | beginEditBlock ()
void | joinPreviousEditBlock ()
void | endEditBlock ()
bool | operator!= (const QTextCursor &rhs) const
bool | operator< (const QTextCursor &rhs) const
bool | operator<= (const QTextCursor &rhs) const
bool | operator== (const QTextCursor &rhs) const
bool | operator>= (const QTextCursor &rhs) const
bool | operator> (const QTextCursor &rhs) const
bool | isCopyOf (const QTextCursor &other) const
int | blockNumber () const
int | columnNumber () const
QTextDocument * | document () const
## Friends
class | QTextDocumentFragmentPrivate
class | QTextCopyHelper

## Member Enumeration Documentation

enum MoveMode

Search for all occurrences

Enumerator:

  MoveAnchor | Search for all occurrences
  KeepAnchor | Search for all occurrences

Definition at line 85 of file qtextcursor.h.

                      {
            MoveAnchor,
            KeepAnchor
        };

enum MoveOperation

Search for all occurrences

Enumerator:

  NoMove | Search for all occurrences
  Start | Search for all occurrences
  Up | Search for all occurrences
  StartOfLine | Search for all occurrences
  StartOfBlock | Search for all occurrences
  StartOfWord | Search for all occurrences
  PreviousBlock | Search for all occurrences
  PreviousCharacter | Search for all occurrences
  PreviousWord | Search for all occurrences
  Left | Search for all occurrences
  WordLeft | Search for all occurrences
  End | Search for all occurrences
  Down | Search for all occurrences
  EndOfLine | Search for all occurrences
  EndOfWord | Search for all occurrences
  EndOfBlock | Search for all occurrences
  NextBlock | Search for all occurrences
  NextCharacter | Search for all occurrences
  NextWord | Search for all occurrences
  Right | Search for all occurrences
  WordRight | Search for all occurrences
  NextCell | Search for all occurrences
  PreviousCell | Search for all occurrences
  NextRow | Search for all occurrences
  PreviousRow | Search for all occurrences

Definition at line 99 of file qtextcursor.h.

                           {
            NoMove,

            Start,
            Up,
            StartOfLine,
            StartOfBlock,
            StartOfWord,
            PreviousBlock,
            PreviousCharacter,
            PreviousWord,
            Left,
            WordLeft,

            End,
            Down,
            EndOfLine,
            EndOfWord,
            EndOfBlock,
            NextBlock,
            NextCharacter,
            NextWord,
            Right,
            WordRight,

            NextCell,
            PreviousCell,
            NextRow,
            PreviousRow
        };

enum SelectionType

Search for all occurrences

Enumerator:

  WordUnderCursor | Search for all occurrences
  LineUnderCursor | Search for all occurrences
  BlockUnderCursor | Search for all occurrences
  Document | Search for all occurrences

Definition at line 144 of file qtextcursor.h.

                           {
            WordUnderCursor,
            LineUnderCursor,
            BlockUnderCursor,
            Document
        };

## Constructor & Destructor Documentation

QTextCursor | ( |  | ) |

QTextCursor | ( | QTextDocument * | document | ) | `[explicit]`

QTextCursor | ( | QTextDocumentPrivate * | p,
|  | int | pos
| ) |  |

QTextCursor | ( | QTextFrame * | frame | ) | `[explicit]`

QTextCursor | ( | const QTextBlock & | block | ) | `[explicit]`

QTextCursor | ( | QTextCursorPrivate * | d | ) | `[explicit]`

QTextCursor | ( | const QTextCursor & | cursor | ) |

~QTextCursor | ( |  | ) |

## Member Function Documentation

QTextCursor& operator= | ( | const QTextCursor & | other | ) |

bool isNull | ( |  | ) | const

Search for all occurrences

void setPosition | ( | int | pos,
|  | MoveMode | mode = `MoveAnchor`
| ) |  |

Search for all occurrences

int position | ( |  | ) | const

Search for all occurrences

int positionInBlock | ( |  | ) | const

Search for all occurrences

int anchor | ( |  | ) | const

Search for all occurrences

void insertText | ( | const QString & | text | ) |

Search for all occurrences

void insertText | ( | const QString & | text,
|  | const QTextCharFormat & | format
| ) |  |

Search for all occurrences

bool movePosition | ( | MoveOperation | op,
|  | MoveMode | = `MoveAnchor`,
|  | int | n = `1`
| ) |  |

Search for all occurrences

bool visualNavigation | ( |  | ) | const

Search for all occurrences

void setVisualNavigation | ( | bool | b | ) |

Search for all occurrences

void setVerticalMovementX | ( | int | x | ) |

Search for all occurrences

int verticalMovementX | ( |  | ) | const

Search for all occurrences

void setKeepPositionOnInsert | ( | bool | b | ) |

Search for all occurrences

bool keepPositionOnInsert | ( |  | ) | const

Search for all occurrences

void deleteChar | ( |  | ) |

Search for all occurrences

void deletePreviousChar | ( |  | ) |

Search for all occurrences

void select | ( | SelectionType | selection | ) |

Search for all occurrences

bool hasSelection | ( |  | ) | const

Search for all occurrences

bool hasComplexSelection | ( |  | ) | const

Search for all occurrences

void removeSelectedText | ( |  | ) |

Search for all occurrences

void clearSelection | ( |  | ) |

Search for all occurrences

int selectionStart | ( |  | ) | const

Search for all occurrences

int selectionEnd | ( |  | ) | const

Search for all occurrences

QString selectedText | ( |  | ) | const

Search for all occurrences

QTextDocumentFragment selection | ( |  | ) | const

Search for all occurrences

void selectedTableCells | ( | int * | firstRow,
|  | int * | numRows,
|  | int * | firstColumn,
|  | int * | numColumns
| ) |  | const

Search for all occurrences

QTextBlock block | ( |  | ) | const

Search for all occurrences

QTextCharFormat charFormat | ( |  | ) | const

Search for all occurrences

void setCharFormat | ( | const QTextCharFormat & | format | ) |

Search for all occurrences

void mergeCharFormat | ( | const QTextCharFormat & | modifier | ) |

Search for all occurrences

QTextBlockFormat blockFormat | ( |  | ) | const

Search for all occurrences

void setBlockFormat | ( | const QTextBlockFormat & | format | ) |

Search for all occurrences

void mergeBlockFormat | ( | const QTextBlockFormat & | modifier | ) |

Search for all occurrences

QTextCharFormat blockCharFormat | ( |  | ) | const

Search for all occurrences

void setBlockCharFormat | ( | const QTextCharFormat & | format | ) |

Search for all occurrences

void mergeBlockCharFormat | ( | const QTextCharFormat & | modifier | ) |

Search for all occurrences

bool atBlockStart | ( |  | ) | const

Search for all occurrences

bool atBlockEnd | ( |  | ) | const

Search for all occurrences

bool atStart | ( |  | ) | const

Search for all occurrences

bool atEnd | ( |  | ) | const

Search for all occurrences

void insertBlock | ( |  | ) |

Search for all occurrences

void insertBlock | ( | const QTextBlockFormat & | format | ) |

Search for all occurrences

void insertBlock | ( | const QTextBlockFormat & | format,
|  | const QTextCharFormat & | charFormat
| ) |  |

Search for all occurrences

QTextList* insertList | ( | const QTextListFormat & | format | ) |

Search for all occurrences

QTextList* insertList | ( | QTextListFormat::Style | style | ) |

Search for all occurrences

QTextList* createList | ( | const QTextListFormat & | format | ) |

Search for all occurrences

QTextList* createList | ( | QTextListFormat::Style | style | ) |

Search for all occurrences

QTextList* currentList | ( |  | ) | const

Search for all occurrences

QTextTable* insertTable | ( | int | rows,
|  | int | cols,
|  | const QTextTableFormat & | format
| ) |  |

Search for all occurrences

QTextTable* insertTable | ( | int | rows,
|  | int | cols
| ) |  |

Search for all occurrences

QTextTable* currentTable | ( |  | ) | const

Search for all occurrences

QTextFrame* insertFrame | ( | const QTextFrameFormat & | format | ) |

Search for all occurrences

QTextFrame* currentFrame | ( |  | ) | const

Search for all occurrences

void insertFragment | ( | const QTextDocumentFragment & | fragment | ) |

Search for all occurrences

void insertHtml | ( | const QString & | html | ) |

Search for all occurrences

void insertImage | ( | const QTextImageFormat & | format,
|  | QTextFrameFormat::Position | alignment
| ) |  |

Search for all occurrences

void insertImage | ( | const QTextImageFormat & | format | ) |

Search for all occurrences

void insertImage | ( | const QString & | name | ) |

Search for all occurrences

void insertImage | ( | const QImage & | image,
|  | const QString & | name = `QString()`
| ) |  |

Search for all occurrences

void beginEditBlock | ( |  | ) |

Search for all occurrences

void joinPreviousEditBlock | ( |  | ) |

Search for all occurrences

void endEditBlock | ( |  | ) |

Search for all occurrences

bool operator!= | ( | const QTextCursor & | rhs | ) | const

bool operator< | ( | const QTextCursor & | rhs | ) | const

bool operator<= | ( | const QTextCursor & | rhs | ) | const

bool operator== | ( | const QTextCursor & | rhs | ) | const

bool operator>= | ( | const QTextCursor & | rhs | ) | const

bool operator> | ( | const QTextCursor & | rhs | ) | const

bool isCopyOf | ( | const QTextCursor & | other | ) | const

Search for all occurrences

int blockNumber | ( |  | ) | const

Search for all occurrences

int columnNumber | ( |  | ) | const

Search for all occurrences

QTextDocument* document | ( |  | ) | const

Search for all occurrences

## Friends And Related Function Documentation

friend class QTextDocumentFragmentPrivate `[friend]`

Search for all occurrences

Definition at line 231 of file qtextcursor.h.

friend class QTextCopyHelper `[friend]`

Search for all occurrences

Definition at line 232 of file qtextcursor.h.

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

- QtGui/qtextcursor.h

QTextCursor QTextCursor QTextCursor QTextCursor QTextCursor QTextCursor QTextCursor QTextCursor QTextCursor QTextCursor
QTextCursor QTextCursor QTextCursor QTextCursor QTextCursor QTextCursor QTextCursor QTextCursor QTextCursor QTextCursor