WebBrowser/WebBrowserView.py

branch
maintenance
changeset 6923
d062df8f1d9f
parent 6826
c6dda2cbe081
parent 6839
4f6234f34dfd
--- a/WebBrowser/WebBrowserView.py	Sat Mar 02 11:17:15 2019 +0100
+++ b/WebBrowser/WebBrowserView.py	Fri Apr 05 19:06:39 2019 +0200
@@ -20,7 +20,7 @@
     QFileInfo, QTimer, QEvent, QPoint, QPointF, QDateTime, QStandardPaths, \
     QByteArray, QIODevice, QDataStream
 from PyQt5.QtGui import QDesktopServices, QClipboard, QIcon, \
-    QContextMenuEvent, QPixmap
+    QContextMenuEvent, QPixmap, QCursor
 from PyQt5.QtWidgets import qApp, QStyle, QMenu, QApplication, QDialog
 from PyQt5.QtWebEngineWidgets import QWebEngineView, QWebEnginePage, \
     QWebEngineDownloadItem
@@ -1475,6 +1475,13 @@
             if evt.modifiers() & Qt.ControlModifier:
                 self.__muteMedia()
                 evt.accept()
+        elif evt.key() == Qt.Key_Backspace:
+            pos = QCursor.pos()
+            pos = self.mapFromGlobal(pos)
+            hitTest = self.page().hitTestContent(pos)
+            if not hitTest.isContentEditable():
+                self.pageAction(QWebEnginePage.Back).trigger()
+                evt.accept()
     
     def _keyReleaseEvent(self, evt):
         """

eric ide

mercurial