QtSpell 1.0.1
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.
 
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.

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

◆ 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.

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

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

◆ 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.

Referenced by isInsideWord().


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