Helpviewer/UrlBar/UrlBar.py

changeset 1170
a3731e520b28
parent 1106
3e57cd52e0f6
child 1233
a376303e0fc0
--- a/Helpviewer/UrlBar/UrlBar.py	Sun Jul 10 16:31:33 2011 +0200
+++ b/Helpviewer/UrlBar/UrlBar.py	Sun Jul 10 19:01:08 2011 +0200
@@ -13,7 +13,7 @@
     from PyQt4.QtNetwork import QSslCertificate
 except ImportError:
     QSslCertificate = None      # __IGNORE_WARNING__
-from PyQt4.QtWebKit import QWebSettings
+from PyQt4.QtWebKit import QWebSettings, QWebPage
 
 from E5Gui.E5LineEdit import E5LineEdit
 from E5Gui.E5LineEditButton import E5LineEditButton
@@ -273,6 +273,19 @@
             self.__browserUrlChanged(self.__browser.url())
         E5LineEdit.focusOutEvent(self, evt)
     
+    def mousePressEvent(self, evt):
+        """
+        Protected method called by a mouse press event.
+        
+        @param evt reference to the mouse event (QMouseEvent)
+        """
+        if evt.button() == Qt.XButton1:
+            self.__mw.currentBrowser().pageAction(QWebPage.Back).trigger()
+        elif evt.button() == Qt.XButton2:
+            self.__mw.currentBrowser().pageAction(QWebPage.Forward).trigger()
+        else:
+            super().mousePressEvent(evt)
+    
     def mouseDoubleClickEvent(self, evt):
         """
         Protected method to handle mouse double click events.

eric ide

mercurial