I need help with a PyQt5 tool I created to view and work with a Zendesk form that has a rich text edit widget. My code is quite big, so the code below pretty much does the same as mine.
I need help making the tool recognize the incorrectly spelt words and show suggestions for the correct spelling when right-clicked, as on Chrome or any other browser.
I tried importing the Grammarly web extension but failed. I downloaded the PC version of it, and it's not even working properly with the tool. It's working fine with everything else, though.
Thanks in advance.
Code:
from PyQt5.QtCore import QUrl
from PyQt5.QtWidgets import QApplication, QMainWindow
from PyQt5.QtWebEngineWidgets import QWebEngineView, QWebEngineProfile
class BrowserTool(QMainWindow):
def __init__(self):
super().__init__()
self.resize(800, 600)
# Create the web view
self.web_view = QWebEngineView(self)
# Create a web engine profile
profile = QWebEngineProfile.defaultProfile()
profile.setSpellCheckEnabled(True) # Enable spell check
# Load the URL
self.web_view.setUrl(QUrl('https://onlinehtmleditor.dev/'))
# Set the web view as the central widget
self.setCentralWidget(self.web_view)
if __name__ == '__main__':
app = QApplication([])
browser_tool = BrowserTool()
browser_tool.show()
app.exec_()
I tried using PySpellChecker, Textblob and other libraries but still didn't detect the incorrectly spelt word or showed suggestions when right-clicked.