QtSpell 1.0.1
Spell checking for Qt text widgets
QtSpell::TextCursor Class Reference

An enhanced QTextCursor. More...

#include <TextEditChecker_p.hpp>

Public Member Functions

QString nextChar (int num=1) const
 Retreive the num-th next character.
 
QString prevChar (int num=1) const
 Retreive the num-th previous character.
 
void moveWordStart (MoveMode moveMode=MoveAnchor)
 Move the cursor to the start of the current word. Cursor must be inside a word. This method correctly honours apostrophes.
 
void moveWordEnd (MoveMode moveMode=MoveAnchor)
 Move the cursor to the end of the current word. Cursor must be inside a word. This method correctly honours apostrophes.
 
bool isInsideWord () const
 Returns whether the cursor is inside a word.
 
bool isWordChar (const QString &character) const
 Returns whether the specified character is a word character.
 

Detailed Description

An enhanced QTextCursor.

Definition at line 59 of file TextEditChecker_p.hpp.

Member Function Documentation

◆ isInsideWord()

bool QtSpell::TextCursor::isInsideWord ( ) const
inline

Returns whether the cursor is inside a word.

Returns
Whether the cursor is inside a word.

Definition at line 103 of file TextEditChecker_p.hpp.

References nextChar(), and prevChar().

◆ isWordChar()

bool QtSpell::TextCursor::isWordChar ( const QString & character) const
inline

Returns whether the specified character is a word character.

Returns
Whether the specified character is a word character.

Definition at line 111 of file TextEditChecker_p.hpp.

Referenced by QtSpell::TextEditChecker::checkSpelling().

◆ moveWordEnd()

void QtSpell::TextCursor::moveWordEnd ( MoveMode moveMode = MoveAnchor)

Move the cursor to the end of the current word. Cursor must be inside a word. This method correctly honours apostrophes.

Parameters
moveModeThe move mode, see QTextCursor::MoveMode.

Definition at line 82 of file TextEditChecker.cpp.

References moveWordEnd(), nextChar(), and prevChar().

Referenced by QtSpell::TextEditChecker::checkSpelling(), QtSpell::TextEditChecker::getWord(), and moveWordEnd().

◆ moveWordStart()

void QtSpell::TextCursor::moveWordStart ( MoveMode moveMode = MoveAnchor)

Move the cursor to the start of the current word. Cursor must be inside a word. This method correctly honours apostrophes.

Parameters
moveModeThe move mode, see QTextCursor::MoveMode.

Definition at line 63 of file TextEditChecker.cpp.

References moveWordStart(), nextChar(), and prevChar().

Referenced by QtSpell::TextEditChecker::getWord(), and moveWordStart().

◆ nextChar()

QString QtSpell::TextCursor::nextChar ( int num = 1) const

Retreive the num-th next character.

Parameters
numWhich character to retreive.
Returns
A string containing the character, might be empty.

Definition at line 41 of file TextEditChecker.cpp.

References nextChar().

Referenced by QtSpell::TextEditChecker::checkSpelling(), isInsideWord(), moveWordEnd(), moveWordStart(), and nextChar().

◆ prevChar()

QString QtSpell::TextCursor::prevChar ( int num = 1) const

Retreive the num-th previous character.

Parameters
numWhich character to retreive.
Returns
A string containing the character, might be empty.

Definition at line 52 of file TextEditChecker.cpp.

References prevChar().

Referenced by isInsideWord(), moveWordEnd(), moveWordStart(), and prevChar().


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