Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
Utils::TextCursor Class Reference

#include <qtextcursor_p.h>

Collaboration diagram for Utils::TextCursor:

Public Types

enum  MoveOperation {
  NoMove , Start , PreviousCharacter , End ,
  NextCharacter
}
enum  MoveMode { MoveAnchor , KeepAnchor }
enum  SelectionType { Document }

Public Member Functions

 TextCursor ()
 TextCursor (const TextBlock &block)
 TextCursor (TextDocument *document)
bool movePosition (MoveOperation op, MoveMode=MoveAnchor, int n=1)
int position () const
void setPosition (int pos, MoveMode mode=MoveAnchor)
QString selectedText () const
void clearSelection ()
int anchor () const
TextDocumentdocument () const
void insertText (const QString &text)
TextBlock block () const
int positionInBlock () const
int blockNumber () const
void select (SelectionType selection)
bool hasSelection () const
void removeSelectedText ()
int selectionEnd () const
bool isNull () const

Detailed Description

Definition at line 28 of file qtextcursor_p.h.

Member Enumeration Documentation

◆ MoveMode

Enumerator
MoveAnchor 
KeepAnchor 

Definition at line 39 of file qtextcursor_p.h.

◆ MoveOperation

Enumerator
NoMove 
Start 
PreviousCharacter 
End 
NextCharacter 

Definition at line 31 of file qtextcursor_p.h.

◆ SelectionType

Enumerator
Document 

Definition at line 41 of file qtextcursor_p.h.

Constructor & Destructor Documentation

◆ TextCursor() [1/3]

Utils::TextCursor::TextCursor ( )

◆ TextCursor() [2/3]

Utils::TextCursor::TextCursor ( const TextBlock & block)

◆ TextCursor() [3/3]

Utils::TextCursor::TextCursor ( TextDocument * document)

Definition at line 17 of file qtextcursor.cpp.

Member Function Documentation

◆ anchor()

int Utils::TextCursor::anchor ( ) const

◆ block()

TextBlock Utils::TextCursor::block ( ) const

Definition at line 88 of file qtextcursor.cpp.

References Utils::TextDocument::firstBlock(), Utils::TextBlock::isValid(), Utils::TextBlock::length(), Utils::TextBlock::next(), Utils::TextBlock::position(), and position().

Referenced by blockNumber(), and positionInBlock().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ blockNumber()

int Utils::TextCursor::blockNumber ( ) const

Definition at line 105 of file qtextcursor.cpp.

References block(), and Utils::TextBlock::blockNumber().

Here is the call graph for this function:

◆ clearSelection()

void Utils::TextCursor::clearSelection ( )

Definition at line 70 of file qtextcursor.cpp.

◆ document()

TextDocument * Utils::TextCursor::document ( ) const

Definition at line 75 of file qtextcursor.cpp.

◆ hasSelection()

bool Utils::TextCursor::hasSelection ( ) const

◆ insertText()

void Utils::TextCursor::insertText ( const QString & text)

Definition at line 80 of file qtextcursor.cpp.

◆ isNull()

bool Utils::TextCursor::isNull ( ) const

Definition at line 120 of file qtextcursor.cpp.

◆ movePosition()

bool Utils::TextCursor::movePosition ( TextCursor::MoveOperation op,
TextCursor::MoveMode mode = MoveAnchor,
int n = 1 )

Definition at line 19 of file qtextcursor.cpp.

References Utils::TextDocument::characterCount(), End, MoveAnchor, NextCharacter, NoMove, PreviousCharacter, and Start.

Here is the call graph for this function:

◆ position()

int Utils::TextCursor::position ( ) const

Definition at line 53 of file qtextcursor.cpp.

Referenced by block().

Here is the caller graph for this function:

◆ positionInBlock()

int Utils::TextCursor::positionInBlock ( ) const

Definition at line 100 of file qtextcursor.cpp.

References block(), and Utils::TextBlock::position().

Here is the call graph for this function:

◆ removeSelectedText()

void Utils::TextCursor::removeSelectedText ( )

Definition at line 110 of file qtextcursor.cpp.

◆ select()

void Utils::TextCursor::select ( SelectionType selection)

◆ selectedText()

QString Utils::TextCursor::selectedText ( ) const

Definition at line 65 of file qtextcursor.cpp.

◆ selectionEnd()

int Utils::TextCursor::selectionEnd ( ) const

Definition at line 115 of file qtextcursor.cpp.

◆ setPosition()

void Utils::TextCursor::setPosition ( int pos,
MoveMode mode = MoveAnchor )

Definition at line 58 of file qtextcursor.cpp.

References MoveAnchor.


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