Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
how to add automatic correction on QTextEdit
I would like to know how to add automatic correction on Qt.I found some websites that explain to me but I am a beginner and I don't t understand how to do it.I'm linking to the site I visited . http: //wiki.qt.io/Spell-Checking-with-Hunspell.There is a lot of error when I complicate.For example #include libraries "hunspell / hunspell.hxx".
I downloaded the file from this site http://hunspell.github.io/ MySpell dictionnaries. The only file we could download but it does not work.
Thank you for your help and sorry if I speak a little bad English.
JonB last edited by JonB
This post shows someone successfully using your Hunspell with
There is also:
In your link https://wiki.qt.io/Spell-Checking-with-Hunspell, did you follow the instructions as per:
You also must adapt a few files before everything works:
Thank you for your reply.
I downloaded from this link what you proposed to me https://www.linux-apps.com/content/show.php/Online+spell+check+editor?content=77339. I am under Qt 5 so I changed QtGui to QtWidgets and also the .pro file header but I find the following error: unicode is not a memeber of QApplication "settingAspellClass-> setWindowTitle (QApplication :: translate (" settingAspellClass "," settingAspell ", 0, QApplication :: UnicodeUTF8));
label-> setText (QApplication :: translate ("settingAspellClass", "Dictionary:", 0, QApplication :: UnicodeUTF8)); "
and if I remove this block the applcation starts but there is no correction. What to do ? I also tested the other links without success.
JonB last edited by JonB
If you download code from 7/9 years ago, and it was for Qt 4, you are liable to have to do some work to make it compile for Qt 5. I suspect the compilation error you show is to do with that; doing no more than "I changed QtGui to QtWidgets" is probably not enough, I did more than that to move Qt4 code to Qt5.
The Hunspell at least looks more recent, so that looks a better bet to me.
jacky2580 last edited by jacky2580
But when I run hunspell he can not find hunspell / hunspell.hxx how to do it? And yet I have included this file in the header of .pro
QT += core gui widgets
TARGET = SpellChecker
TEMPLATE = app
SOURCES += hunspell/affentry.cxx
HEADERS = hunspell/affentry.hxx
JonB last edited by
But when I run hunspell
I presume you mean compile, not run.
I don't know, maybe the file
hunspell/hunspell.hxxdoes not actually exist there (have you checked?), or it's looking in the wrong place.
Thank you for helping me and sorry to answer you so late. I tried everything but I can not do it. I have not abandonded but I will try when I have all the necessary knowledge. Thanks a lot for your help .