WebBrowser/WebBrowserView.py

branch
maintenance
changeset 5752
1860eca908e4
parent 5730
6422afc7adc4
parent 5740
292538236234
child 5825
9487c08b6a23
--- a/WebBrowser/WebBrowserView.py	Sat May 06 13:44:26 2017 +0200
+++ b/WebBrowser/WebBrowserView.py	Sat Jun 03 13:08:50 2017 +0200
@@ -17,7 +17,7 @@
 import os
 
 from PyQt5.QtCore import pyqtSignal, QUrl, QFileInfo, Qt, QTimer, QEvent, \
-    QPoint, QDateTime, qVersion, QStandardPaths
+    QPoint, QDateTime, QStandardPaths
 from PyQt5.QtGui import QDesktopServices, QClipboard, QIcon, \
     QContextMenuEvent, QPixmap
 from PyQt5.QtWidgets import qApp, QStyle, QMenu, QApplication
@@ -38,6 +38,7 @@
 import Preferences
 import UI.PixmapCache
 import Utilities
+from Globals import qVersionTuple
 
 
 class WebBrowserView(QWebEngineView):
@@ -122,7 +123,7 @@
         self.__inspector = None
         WebInspector.registerView(self)
         
-        if qVersion() >= "5.8.0":
+        if qVersionTuple() >= (5, 8, 0):
             if self.parentWidget() is not None:
                 self.parentWidget().installEventFilter(self)
             
@@ -342,7 +343,7 @@
         """
         Public slot to clear the current selection.
         """
-        if qVersion() >= "5.7.0":
+        if qVersionTuple() >= (5, 7, 0):
             self.triggerPageAction(QWebEnginePage.Unselect)
         else:
             self.page().runJavaScript(
@@ -525,11 +526,11 @@
         @type WebHitTestResult
         """
         spellCheckActionCount = 0
-        if qVersion() >= "5.7.0":
+        if qVersionTuple() >= (5, 7, 0):
             contextMenuData = self.page().contextMenuData()
             hitTest.updateWithContextMenuData(contextMenuData)
             
-            if qVersion() >= "5.8.0" and \
+            if qVersionTuple() >= (5, 8, 0) and \
                bool(contextMenuData.misspelledWord()):
                 boldFont = menu.font()
                 boldFont.setBold(True)
@@ -1287,8 +1288,8 @@
         if self.__mw and self.__mw.isFullScreen():
             if self.__mw.isFullScreenNavigationVisible():
                 self.__mw.hideFullScreenNavigation()
-            elif evt.y() < 5:
-                # mouse is within 5px to the top
+            elif evt.y() < 10:
+                # mouse is within 10px to the top
                 self.__mw.showFullScreenNavigation()
         
         if WebBrowserWindow.autoScroller().mouseMove(evt):
@@ -1391,7 +1392,7 @@
         @rtype bool
         """
         # find the render widget receiving events for the web page
-        if qVersion() < "5.8.0":
+        if qVersionTuple() < (5, 8, 0):
             if obj is self and evt.type() == QEvent.ChildAdded:
                 child = evt.child()
                 if child and child.inherits(
@@ -1704,7 +1705,7 @@
         if url.isEmpty():
             return
         
-        if qVersion() >= "5.8.0":
+        if qVersionTuple() >= (5, 8, 0):
             # since Qt 5.8.0
             fileName, savePageFormat = self.__getSavePageFileNameAndFormat()
             if fileName:

eric ide

mercurial