WebBrowser/WebBrowserView.py

changeset 5532
3a7c5deab9b7
parent 5530
93f95c4b3153
child 5587
ea526b78ee6c
child 5633
1a767ca5bbf3
diff -r 93f95c4b3153 -r 3a7c5deab9b7 WebBrowser/WebBrowserView.py
--- a/WebBrowser/WebBrowserView.py	Sat Feb 18 19:59:14 2017 +0100
+++ b/WebBrowser/WebBrowserView.py	Sun Feb 19 19:23:21 2017 +0100
@@ -517,7 +517,7 @@
                 for suggestion in contextMenuData.spellCheckerSuggestions():
                     act = menu.addAction(
                         suggestion,
-                        lambda: self.page().replaceMisspelledWord(suggestion))
+                        self.__replaceMisspelledWord)
                     act.setFont(boldFont)
                 
                 if bool(menu.actions()):
@@ -929,6 +929,14 @@
             bool(url.scheme()) and \
             "." in url.host()
     
+    def __replaceMisspelledWord(self):
+        """
+        Private slot to replace a misspelled word under the context menu.
+        """
+        act = self.sender()
+        suggestion = act.text()
+        self.page().replaceMisspelledWord(suggestion)
+    
     def __openLinkInNewTab(self):
         """
         Private method called by the context menu to open a link in a new

eric ide

mercurial