<div dir="ltr">On Wed, Aug 7, 2013 at 11:13 AM, Aurélien Gâteau <span dir="ltr"><<a href="mailto:agateau@kde.org" target="_blank">agateau@kde.org</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I'd like to reach a decision regarding spell checking for QTextEdit.<br>
<br>
It was initially a Qt5 task:<br>
<br>
"Allow to register a default syntax highlighter type for QTextEdit, the KDE<br>
backend would register the spell checking one coming from sonnet as default"<br>
<br>
I started working on this task and put together a first patch, but then<br>
realized it would not be enough: in addition to the syntax highlighter,<br>
integration with QTextEdit requires context menu support to be able to provide<br>
suggestions for spelling errors.<br>
<br>
I already have code which integrates Sonnet (our spellchecker component) with<br>
QTextEdit, in the form of a helper class named (for now)<br>
Sonnet::TextEditInstaller:<br>
<br>
<a href="https://git.reviewboard.kde.org/r/111912/" target="_blank">https://git.reviewboard.kde.org/r/111912/</a><br>
<br>
<br>
There was a discussion on IRC two days ago regarding how transparent should<br>
spellcheck integration with QTextEdit be, with two possible positions:<br>
<br>
<br>
A. Find a way to inject spellchecking in all QTextEdit through either QPA or<br>
our style.<br>
<br>
Pros:<br>
- Completely transparent to Qt app developers<br>
- Porting a KDE app to KF5 is only KTextEdit => QTextEdit<br>
<br>
Cons:<br>
- Depends on QPA and/or style, so won't always be available depending on the<br>
platform<br>
- Could cause problems if spellchecking is injected in QTextEdit where it<br>
makes no sense to provide this feature (eg. code editor)<br>
<br>
<br>
B. Only provide Sonnet::TextEditInstaller, which app developers would then<br>
have to explicitly use to add spell checking to QTextEdit in their<br>
applications.<br>
<br>
Pros:<br>
- No under-the-hood hack<br>
- Independant from the platform as long as we have Sonnet plugins for it<br>
- Gives more control to the app developer: for example changing the spelling<br>
language, adding custom words to ignore, or ignoring blocks of text (think<br>
quoted email)<br>
<br>
Cons:<br>
- Requires developers to explicitly use the API, so porting a KDE app to KF5<br>
is KTextEdit => QTextEdit + use Sonnet::TextEditInstaller.<br>
<br>
<br>
I am personnaly in favor of B), but would like to hear others opinions.<br>
<br>
Aurélien<br>
_______________________________________________<br>
Kde-frameworks-devel mailing list<br>
<a href="mailto:Kde-frameworks-devel@kde.org">Kde-frameworks-devel@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/kde-frameworks-devel" target="_blank">https://mail.kde.org/mailman/listinfo/kde-frameworks-devel</a><br>
</blockquote></div><br></div><div class="gmail_extra">I think that for now B is the best. Maybe we can achieve A in the future, but in this case I guess the black magic can wait. :)</div><div class="gmail_extra"><br></div>
<div class="gmail_extra">Aleix</div></div>