QtSpell  0.8.4
Spell checking for Qt text widgets
Public Member Functions | List of all members
QtSpell::TextCursor Class Reference

An enhanced QTextCursor. More...

#include <TextEditChecker_p.hpp>

Inherits QTextCursor.

Public Member Functions

QString nextChar (int num=1) const
 Retreive the num-th next character. More...
 
QString prevChar (int num=1) const
 Retreive the num-th previous character. More...
 
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. More...
 
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. More...
 
bool isInsideWord () const
 Returns whether the cursor is inside a word. More...
 
bool isWordChar (const QString &character) const
 Returns whether the specified character is a word character. More...
 

Detailed Description

An enhanced QTextCursor.

Definition at line 31 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 75 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 83 of file TextEditChecker_p.hpp.

◆ 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 71 of file TextEditChecker.cpp.

References nextChar(), and prevChar().

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

◆ 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 52 of file TextEditChecker.cpp.

References nextChar(), and prevChar().

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

◆ 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 30 of file TextEditChecker.cpp.

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

◆ 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 41 of file TextEditChecker.cpp.

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


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