RFC: spell checking for QTextEdit

Aurélien Gâteau agateau at kde.org
Wed Aug 7 14:37:48 UTC 2013


Le mercredi 7 août 2013 13:44:19 Kevin Krammer a écrit :
> On Wednesday, 2013-08-07, Aurélien Gâteau wrote:
> > More on this topic, Alex Fiestas suggested a new option:
> > 
> > C) Add spellchecking to QTextEdit itself:
> > - Extend QTextEdit with new properties to enable spellchecking, set
> > spellchecking language...
> > - Add a spellcheck syntax highlighter
> > - Extend QPA to integrate with the platform spellchecking API.
> 
> The main problem is whoever proposes this will be asked to at least
> implement it for Windows and OSX as well, assuming those platforms have
> native spellchecking APIs.

That is what I fear as well.

> > Pros:
> > - Sounds like the proper way to do it in the long run: it provides proper
> > platform integration (Android spellchecking suggestion is not done with a
> > context menu for example)
> > - Could also be used to bring spellchecking to other widgets like
> > QLineEdit? I know KMail could use this for its subject line edit, which is
> > right now a custom one-line KTextEdit.
> 
> The spellchecking itself (minus the UI) might actually be something the
> QTextDocument or a helper class for it would provide. Different paragraphs
> could have different languages, etc.
> 
> > - Less work to port KDE apps to KF5: KTextEdit => QTextEdit + calling
> > QTextEdit::setSpellCheckingEnabled(true)
> > 
> > Cons:
> > - More work, not sure it can be done in time for Qt 5.2.
> > 
> > 
> > I am tempted to say B) in the short term since it's mostly done, then C),
> > but this could mean KDE apps would be first changed to use
> > Sonnet::TextEditInstaller, only to drop it when QTextEdit gains the
> > feature.
> 
> I think we will see things like that anyway, i.e. functionality available in
> KDE Framworks becoming important enought to make it viable for Qt
> upstreaming.

Agreed. If I understand correctly how KF5 is meant to be used when/if Qt gains 
spellchecking support we can deprecate Sonnet and start using the Qt feature, 
no need to keep Sonnet around for ever.

Aurélien


More information about the Kde-frameworks-devel mailing list