Image 01
profile-image

jiveaxe

Giuseppe Calí  , Italy
Online spell check editor

Qt Widgets by sunderme 12 comments

Here is a screen:

http://img134.imageshack.us/my.php?image=imgcht3.jpg

The word "dell" (before the apostrophe) is wrong but the spellchecker marks wrong even 'dell' of the word "della" that is a correct word.

Your code, infact, searches all occurrences of str, even if they are substring of other words; with QRegExp is matched only the whole word. - Sep 21 2008
Online spell check editor

Qt Widgets by sunderme 12 comments

Ok, now the spellchecking works right. - Sep 21 2008
Online spell check editor

Qt Widgets by sunderme 12 comments

I use linux (Kubuntu 8.04). I have tryed with the option --encoding=utf-8 in Aspell.cpp but spellchecking doesn't works. - Sep 21 2008
Online spell check editor

Qt Widgets by sunderme 12 comments

Hi,
I'm very very happy when found your code since I need it. Since I need Italian spellchecking, your code, like it is, doesn't works good with my language. I apply some modification to the code:

1) I changed line 77 of highlighter.cpp from

QStringList Checkliste = str.split(QRegExp("([^a-z,^A-Z,^\\\\]|(?=\\\\))+"),

to

QStringList Checkliste = str.split(QRegExp("([^\\w,^\\\\]|(?=\\\\))+")

so now accented letters (very common in Italian language) aren't ignored.

2) I changed line 86 of highlighter.cpp from

number = text.count(str);

to

number = text.count(QRegExp("\\b" + str + "\\b"));

and line 91 from

l = text.indexOf(str,l+1);

to

l = text.indexOf(QRegExp("\\b" + str + "\\b"),l+1);

this because if a word is misspelled and this word is a substring of a longer word than this substring is cheched as misspelled while in the new context is right (hoping I was clear...).

3) I have made the object Highlighter *highlighter a member of SpellTextEdit so the new widget SpellTextEdit is simpler to reuse.

Now I have a problem with accented words which are always checked as misspelled even if they are right. I was unable to find the problem, maybe you can, knowing more deeply the code. Probably you have to install aspell-it; here are some accented Italian words:

qualità
maestà
lealtà

Regards - Sep 21 2008