I am writing a program which is mainly in python but some interactive features are done through a web-app that talks to flask. It would be nice to have the web-app inside the python program so I am looking at using PyQtWebEngine.
This works surprisingly well except that I cannot get spell checking to work. I have run
self.page().profile().setSpellCheckEnabled(True)
self.page().profile().setSpellCheckLanguages({"en-GB"})
from inside my child class of QWebEngineView
, and I have checked isSpellCheckEnabled()
is True.
I wonder if it cannot find the languages. No qWarning is detected which I would expect if it cannot find the dictionary. As suggested by the non-python example.
I have an en-GB.bdic
which I copied from the Chromium hunspell git. I have tried putting the file at:
<directory_my_py_file_is_in>/qtwebengine_dictionaries/en-GB.bdic
When I run
app = QApplication(sys.argv)
print(app.applicationDirPath())
the result is
/usr/bin
so I tried
/usr/bin/qtwebengine_dictionaries/en-GB.bdic
This wouldn't have been OK because I cannot edit this location when the program is pip installed, but it was worth a try.
With the .bdic
file in either place I never see any spell check feature.
Has anyone got spellchecking working in PyQtWebEngine? I have not been able to find much in the way of documentation.