---<summary>---
QtWebKit doesn't mark (underline with red wavy line) misspelled words
while in designMode even if spell checking is implemented and works
correctly. Could you please point me what I am doing wrong?
I'm building arora with QtWebKit (actually, entire qt 4.6.0 tp1
downloaded from qt web site as tarball) using Visual Studio 2005 SP1
under English WIndows XP SP3.
---</summary>---
Recently I have been interested in embedding QtWebKit in my project as
webbrowser plugin. I looked around the web and found arora excellent
example for implementing code that covers my needs. But I'm also need
to enable spell checking in QtWebkit. To do so I've taken another look
at Google Chrome source code that might use hunspell to enable
spellchecking in browser and found some clues. I have rewritten
Chromium's code and replaced following functions in
qt-4.6.0-tp1\src\3rdparty\webkit\WebKit\qt\WebCoreSupport\EditorClientQt.cpp
qt-4.6.0-tp1\src\3rdparty\webkit\WebKit\qt\WebCoreSupport\EditorClientQt.cpp
To copy to clipboard, switch view to plain text mode
void EditorClientQt::checkSpellingOfString(const UChar* str, int length,
int* misspellingLocation,
int* misspellingLength)
{
// Original
// notImplemented();
return MySpellChecker::getInstance()->checkSpellingOfString(str,
length, misspellingLocation, misspellingLength);
}
bool EditorClientQt::isContinuousSpellCheckingEnabled()
{
// Original
// return false;
return true;
}
String EditorClientQt::getAutoCorrectSuggestionForMisspelledWord(const
String &word)
{
//Original
//notImplemented();
//return String();
return MySpellChecker::getInstance()->getAutoCorrectSuggestionForMisspelledWord(word);
}
void EditorClientQt::checkSpellingOfString(const UChar* str, int length,
int* misspellingLocation,
int* misspellingLength)
{
// Original
// notImplemented();
return MySpellChecker::getInstance()->checkSpellingOfString(str,
length, misspellingLocation, misspellingLength);
}
bool EditorClientQt::isContinuousSpellCheckingEnabled()
{
// Original
// return false;
return true;
}
String EditorClientQt::getAutoCorrectSuggestionForMisspelledWord(const
String &word)
{
//Original
//notImplemented();
//return String();
return MySpellChecker::getInstance()->getAutoCorrectSuggestionForMisspelledWord(word);
}
To copy to clipboard, switch view to plain text mode
MySpellChecker is spellchecker that using hunspell. I've built
QtWebKit and placed breakpoints inside bodies of functions mentioned
above. As far as I can see functions are being invoked correctly, i.e.
if I, for example, write "cra is moving", it is being corrected by
getAutoCorrectSuggestionForMisspelledWord as "car is moving", but if i
write "car is asdf" then the word "asdf" is just not being marked as
misspelled word. Could you please point me what I am doing wrong?
I'm building arora with QtWebKit (actually, entire qt 4.6.0 tp1
downloaded from qt web site as tarball) using Visual Studio 2005 SP1
under English WIndows XP SP3.
Bookmarks