<br><br><div class="gmail_quote">On Wed, Aug 7, 2013 at 10:13 AM, Aurélien Gâteau <span dir="ltr"><<a href="mailto:agateau@kde.org" target="_blank">agateau@kde.org</a>></span> wrote:<br><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></blockquote><div><br></div><div>I'm not sure that is a real con.</div><div><br></div><div>KTextEdit still exists in KF5 and has been moved to KTextWidgets in tier 2.</div><div><br></div><div>If I've understood correctly, with option B we would only need to port to QTextEdit + use Sonnet::TextEditInstaller for anything inside kdelibs tier 1 and to make it available for any app which only want tier 1 libs.</div>
<div><br></div><div>Porting any KDE apps can just include KTextWidgets and not change anything when porting to KF5. </div><div><br></div><div>David</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

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