42 #include "private/textwriter_p.h" 53 static bool overlaps(
int posA,
int lengthA,
int posB,
int lengthB) {
54 return (posA < posB + lengthB && posA + lengthA > posB + lengthB)
55 || (posA < posB && posA + lengthA > posB);
71 const Move &cmd = i.next();
83 const Move &cmd = i.next();
84 if (cmd.
to >= pos && cmd.
to < pos + length)
118 while (i.hasNext()) {
127 QMutableListIterator<Move> i(
moveList);
128 while (i.hasNext()) {
135 if (replace.
pos < c.
to)
void endEditBlock()
Indicates the end of a block of editing operations on the document that should appear as a single ope...
bool hasMoveInto(int pos, int length)
void doMove(const Move &move)
bool hasOverlap(int pos, int length)
void doReplace(const Replace &replace)
The QString class provides a Unicode character string.
QString selectedText() const
Returns the current selection's text (which may be empty).
void insertText(const QString &text)
Inserts text at the current position, using the current character format.
int size() const
Returns the number of characters in this string.
The QTextCursor class offers an API to access and modify QTextDocuments.
void replace(int pos, int length, const QString &replacement)
#define QT_QML_END_NAMESPACE
#define QT_QML_BEGIN_NAMESPACE
QString mid(int position, int n=-1) const Q_REQUIRED_RESULT
Returns a string that contains n characters of this string, starting at the specified position index...
void beginEditBlock()
Indicates the start of a block of editing operations on the document that should appear as a single o...
QList< Replace > replaceList
void move(int pos, int length, int to)
void setPosition(int pos, MoveMode mode=MoveAnchor)
Moves the cursor to the absolute position in the document specified by pos using a MoveMode specified...
static bool overlaps(int posA, int lengthA, int posB, int lengthB)