![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include <qtextcursor_p.h>
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 |
TextDocument * | document () 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 |
Definition at line 28 of file qtextcursor_p.h.
Enumerator | |
---|---|
MoveAnchor | |
KeepAnchor |
Definition at line 39 of file qtextcursor_p.h.
Enumerator | |
---|---|
NoMove | |
Start | |
PreviousCharacter | |
End | |
NextCharacter |
Definition at line 31 of file qtextcursor_p.h.
Enumerator | |
---|---|
Document |
Definition at line 41 of file qtextcursor_p.h.
Utils::TextCursor::TextCursor | ( | ) |
Utils::TextCursor::TextCursor | ( | const TextBlock & | block | ) |
Utils::TextCursor::TextCursor | ( | TextDocument * | document | ) |
Definition at line 17 of file qtextcursor.cpp.
int Utils::TextCursor::anchor | ( | ) | const |
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().
int Utils::TextCursor::blockNumber | ( | ) | const |
Definition at line 105 of file qtextcursor.cpp.
References block(), and Utils::TextBlock::blockNumber().
void Utils::TextCursor::clearSelection | ( | ) |
Definition at line 70 of file qtextcursor.cpp.
TextDocument * Utils::TextCursor::document | ( | ) | const |
Definition at line 75 of file qtextcursor.cpp.
bool Utils::TextCursor::hasSelection | ( | ) | const |
Definition at line 80 of file qtextcursor.cpp.
bool Utils::TextCursor::isNull | ( | ) | const |
Definition at line 120 of file qtextcursor.cpp.
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.
int Utils::TextCursor::position | ( | ) | const |
Definition at line 53 of file qtextcursor.cpp.
Referenced by block().
int Utils::TextCursor::positionInBlock | ( | ) | const |
Definition at line 100 of file qtextcursor.cpp.
References block(), and Utils::TextBlock::position().
void Utils::TextCursor::removeSelectedText | ( | ) |
Definition at line 110 of file qtextcursor.cpp.
void Utils::TextCursor::select | ( | SelectionType | selection | ) |
QString Utils::TextCursor::selectedText | ( | ) | const |
Definition at line 65 of file qtextcursor.cpp.
int Utils::TextCursor::selectionEnd | ( | ) | const |
Definition at line 115 of file qtextcursor.cpp.
void Utils::TextCursor::setPosition | ( | int | pos, |
MoveMode | mode = MoveAnchor ) |
Definition at line 58 of file qtextcursor.cpp.
References MoveAnchor.