QTextCursor Class Reference

QTextCursor Class Reference

#include <qtextcursor.h>

Class Description

Definition at line 70 of file qtextcursor.h.

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)
 
QTextCursoroperator= (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)
 
QTextListinsertList (const QTextListFormat &format)
 
QTextListinsertList (QTextListFormat::Style style)
 
QTextListcreateList (const QTextListFormat &format)
 
QTextListcreateList (QTextListFormat::Style style)
 
QTextListcurrentList () const
 
QTextTableinsertTable (int rows, int cols, const QTextTableFormat &format)
 
QTextTableinsertTable (int rows, int cols)
 
QTextTablecurrentTable () const
 
QTextFrameinsertFrame (const QTextFrameFormat &format)
 
QTextFramecurrentFrame () 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
 
QTextDocumentdocument () const
 

Friends

class QTextDocumentFragmentPrivate
 
class QTextCopyHelper
 
class QTextControlPrivate
 

Member Enumeration Documentation

enum MoveMode
Enumerator
MoveAnchor 
KeepAnchor 

Definition at line 85 of file qtextcursor.h.

Enumerator
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 

Definition at line 99 of file qtextcursor.h.

99  {
100  NoMove,
101 
102  Start,
103  Up,
104  StartOfLine,
105  StartOfBlock,
106  StartOfWord,
109  PreviousWord,
110  Left,
111  WordLeft,
112 
113  End,
114  Down,
115  EndOfLine,
116  EndOfWord,
117  EndOfBlock,
118  NextBlock,
120  NextWord,
121  Right,
122  WordRight,
123 
124  NextCell,
125  PreviousCell,
126  NextRow,
128  };
Enumerator
WordUnderCursor 
LineUnderCursor 
BlockUnderCursor 
Document 

Definition at line 144 of file qtextcursor.h.

Constructor & Destructor Documentation

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)

Member Function Documentation

QTextCursor& operator= ( const QTextCursor other)
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 And Related Function Documentation

friend class QTextDocumentFragmentPrivate
friend

Definition at line 231 of file qtextcursor.h.

friend class QTextCopyHelper
friend

Definition at line 232 of file qtextcursor.h.

friend class QTextControlPrivate
friend

Definition at line 233 of file qtextcursor.h.


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