# class Highlighter

###

Module | kdeui
Namespace | Sonnet
Class | Highlighter
Inherits | QSyntaxHighlighter

The Sonnet Highlighter

### methods

- Highlighter (textEdit, configFile, col)

  returns ctor
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  textEdit | QTextEdit |
  configFile | QString | QString()
  col | QColor | QColor()

- Highlighter (a0)

  returns ctor
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  a0 | Sonnet.Highlighter |

- Highlighter (a0, a1, a2)

  returns ctor
  before KDE 4.1.0 only

  Argument | Type | Default
  --- | --- | ---
  a0 | QTextEdit |
  a1 | QString | QString()
  a2 | QColor | QColor()

- activeChanged (description)

  returns Nothing
  SIGNAL ("activeChanged (const QString&)")

  Argument | Type | Default
  --- | --- | ---
  description | QString |

  Emitted when as-you-type spell checking is enabled or disabled.

  description - is a i18n description of the new state, with an optional reason

- addWordToDictionary (word)

  returns Nothing
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  word | QString |

  Adds the given word permanently to the dictionary. It will never be marked as misspelled again, even after restarting the application.

  word - the word which will be added to the dictionary @since 4.1

- automatic ( )

  returns bool

- currentLanguage ( )

  returns QString

- eventFilter (o, e)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  o | QObject |
  e | QEvent |

- highlightBlock (text)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  text | QString |

- ignoreWord (word)

  returns Nothing
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  word | QString |

  Ignores the given word. This word will not be marked misspelled for this session. It will again be marked as misspelled when creating new highlighters.

  word - the word which will be ignored @since 4.1

- intraWordEditing ( )

  returns bool

- isActive ( )

  returns bool

  Returns the state of spell checking.

  Returns true if spell checking is active

  See also setActive()

- isWordMisspelled (word)

  returns bool
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  word | QString |

  Checks if a given word is marked as misspelled by the highlighter.

  word - the word to be checked Returns true if the given word is misspelled. @since 4.1

- newSuggestions (originalWord, suggestions)

  returns Nothing
  SIGNAL ("newSuggestions (const QString&, const QStringList&)")

  Argument | Type | Default
  --- | --- | ---
  originalWord | QString |
  suggestions | QStringList |

  originalWord - missspelled word

  suggestions - list of word which can replace missspelled word

  Deprecated use isWordMisspelled() and suggestionsForWord() instead.

- personalWords ( )

  returns QStringList
  static

- setActive (active)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  active | bool |

  Enable/Disable spell checking.

  If active is true then spell checking is enabled; otherwise it is disabled. Note that you have to disable automatic (de)activation with setAutomatic() before you change the state of spell checking if you want to persistently enable/disable spell checking.

  active - if true, then spell checking is enabled

  See also isActive(), setAutomatic()

- setAutomatic (automatic)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  automatic | bool |

- setCurrentLanguage (lang)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  lang | QString |

- setIntraWordEditing (editing)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  editing | bool |

- setMisspelled (start, count)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  start | int |
  count | int |

- slotAutoDetection ( )

  returns Nothing

- slotRehighlight ( )

  returns Nothing

- spellCheckerFound ( )

  returns bool

- suggestionsForWord (word, max)

  returns QStringList
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  word | QString |
  max | int | 10

  Returns a list of suggested replacements for the given misspelled word. If the word is not misspelled, the list will be empty.

  word - the misspelled word

  max - at most this many suggestions will be returned. If this is -1, as many suggestions as the spell backend supports will be returned. Returns a list of suggested replacements for the word @since 4.1

- unsetMisspelled (start, count)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  start | int |
  count | int |