Continued porting the web browser. QtWebEngine

Sun, 21 Feb 2016 10:49:54 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 21 Feb 2016 10:49:54 +0100
branch
QtWebEngine
changeset 4760
d053f6655a0f
parent 4759
a60eb8619906
child 4762
ea40955a0937

Continued porting the web browser.

- enabled gesture support on the web view delegate widget (although it does not work yet - Qt Bug)

WebBrowser/WebBrowserView.py file | annotate | diff | comparison | revisions
diff -r a60eb8619906 -r d053f6655a0f WebBrowser/WebBrowserView.py
--- a/WebBrowser/WebBrowserView.py	Sat Feb 20 17:45:40 2016 +0100
+++ b/WebBrowser/WebBrowserView.py	Sun Feb 21 10:49:54 2016 +0100
@@ -1318,18 +1318,18 @@
         super(WebBrowserView, self).focusOutEvent(evt)
     
     # TODO: Gestures: Obsoleted by eventFilter() (?)
-##    def event(self, evt):
-##        """
-##        Public method handling events.
-##        
-##        @param evt reference to the event (QEvent)
-##        @return flag indicating, if the event was handled (boolean)
-##        """
-##        if evt.type() == QEvent.Gesture:
-##            self.gestureEvent(evt)
-##            return True
-##        
-##        return super(WebBrowserView, self).event(evt)
+    def event(self, evt):
+        """
+        Public method handling events.
+        
+        @param evt reference to the event (QEvent)
+        @return flag indicating, if the event was handled (boolean)
+        """
+        if evt.type() == QEvent.Gesture:
+            self._gestureEvent(evt)
+            return True
+        
+        return super(WebBrowserView, self).event(evt)
     
     def _gestureEvent(self, evt):
         """
@@ -1364,6 +1364,7 @@
             if child and child.inherits(
                     "QtWebEngineCore::RenderWidgetHostViewQtDelegateWidget"):
                 self.__rwhvqt = child
+                self.grabGesture(Qt.PinchGesture)
                 self.__rwhvqt.installEventFilter(self)
         
         # forward events to WebBrowserView

eric ide

mercurial