Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. how to add automatic correction on QTextEdit
Forum Updated to NodeBB v4.3 + New Features

how to add automatic correction on QTextEdit

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
7 Posts 2 Posters 1.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jacky2580
    wrote on last edited by
    #1

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

    JonBJ 1 Reply Last reply
    0
    • J jacky2580

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

      JonBJ Online
      JonBJ Online
      JonB
      wrote on last edited by JonB
      #2

      @jacky2580
      This post shows someone successfully using your Hunspell with QTextEdit:
      http://www.qtcentre.org/threads/38227-QTextEdit-with-hunspell-spell-checker-and-syntax-highlighter
      There is also:
      https://forum.qt.io/topic/7143/spell-checker

      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:

      1 Reply Last reply
      2
      • J Offline
        J Offline
        jacky2580
        wrote on last edited by
        #3

        Thank you for your reply.
        579/5000
        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.

        JonBJ 1 Reply Last reply
        0
        • J jacky2580

          Thank you for your reply.
          579/5000
          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.

          JonBJ Online
          JonBJ Online
          JonB
          wrote on last edited by JonB
          #4

          @jacky2580
          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.

          1 Reply Last reply
          0
          • J Offline
            J Offline
            jacky2580
            wrote on last edited by jacky2580
            #5

            @JonB
            143/5000
            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
            hunspell/affixmgr.cxx
            hunspell/csutil.cxx
            hunspell/dictmgr.cxx
            hunspell/filemgr.cxx
            hunspell/hashmgr.cxx
            hunspell/hunspell.cxx
            hunspell/hunzip.cxx
            hunspell/phonet.cxx
            hunspell/suggestmgr.cxx
            hunspell/utf_info.cxx
            main.cpp
            dialog.cpp
            spellchecker.cpp
            spellcheckdialog.cpp

            HEADERS = hunspell/affentry.hxx
            hunspell/affixmgr.hxx
            hunspell/atypes.hxx
            hunspell/baseaffix.hxx
            hunspell/csutil.hxx
            hunspell/dictmgr.hxx
            hunspell/filemgr.hxx
            hunspell/hashmgr.hxx
            hunspell/htypes.hxx
            hunspell/hunspell.h
            hunspell/hunspell.hxx
            hunspell/hunzip.hxx
            hunspell/langnum.hxx
            hunspell/phonet.hxx
            hunspell/suggestmgr.hxx
            hunspell/w_char.hxx
            dialog.h
            spellchecker.h
            spellcheckdialog.h

            JonBJ 1 Reply Last reply
            0
            • J jacky2580

              @JonB
              143/5000
              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
              hunspell/affixmgr.cxx
              hunspell/csutil.cxx
              hunspell/dictmgr.cxx
              hunspell/filemgr.cxx
              hunspell/hashmgr.cxx
              hunspell/hunspell.cxx
              hunspell/hunzip.cxx
              hunspell/phonet.cxx
              hunspell/suggestmgr.cxx
              hunspell/utf_info.cxx
              main.cpp
              dialog.cpp
              spellchecker.cpp
              spellcheckdialog.cpp

              HEADERS = hunspell/affentry.hxx
              hunspell/affixmgr.hxx
              hunspell/atypes.hxx
              hunspell/baseaffix.hxx
              hunspell/csutil.hxx
              hunspell/dictmgr.hxx
              hunspell/filemgr.hxx
              hunspell/hashmgr.hxx
              hunspell/htypes.hxx
              hunspell/hunspell.h
              hunspell/hunspell.hxx
              hunspell/hunzip.hxx
              hunspell/langnum.hxx
              hunspell/phonet.hxx
              hunspell/suggestmgr.hxx
              hunspell/w_char.hxx
              dialog.h
              spellchecker.h
              spellcheckdialog.h

              JonBJ Online
              JonBJ Online
              JonB
              wrote on last edited by
              #6

              @jacky2580

              But when I run hunspell

              I presume you mean compile, not run.

              I don't know, maybe the file hunspell/hunspell.hxx does not actually exist there (have you checked?), or it's looking in the wrong place.

              1 Reply Last reply
              0
              • J Offline
                J Offline
                jacky2580
                wrote on last edited by
                #7

                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 .

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved