WebBrowser/WebBrowserWindow.py

changeset 5736
000ea446ff4b
parent 5734
d8b99b5fa673
child 5738
912d7ba40c26
--- a/WebBrowser/WebBrowserWindow.py	Sat May 13 13:46:05 2017 +0200
+++ b/WebBrowser/WebBrowserWindow.py	Sat May 13 16:32:54 2017 +0200
@@ -18,7 +18,7 @@
 import sys
 
 from PyQt5.QtCore import pyqtSlot, pyqtSignal, Qt, QByteArray, QSize, QTimer, \
-    QUrl, QTextCodec, QProcess, QEvent, qVersion
+    QUrl, QTextCodec, QProcess, QEvent
 from PyQt5.QtGui import QDesktopServices, QKeySequence, QFont, QFontMetrics
 from PyQt5.QtWidgets import QWidget, QVBoxLayout, QSizePolicy, QDockWidget, \
     QComboBox, QLabel, QMenu, QToolButton, QLineEdit, QApplication, \
@@ -44,6 +44,7 @@
 
 import Utilities
 import Globals
+from Globals import qVersionTuple
 
 import UI.PixmapCache
 import UI.Config
@@ -744,9 +745,9 @@
         self.__actions.append(self.exportBookmarksAct)
         
         # TODO: re-check this once printing on Windows is reliable
-##        if qVersion() >= "5.8.0" or (
-##                not Globals.isWindowsPlatform() or qVersion() >= "5.7.0"):
-        if not Globals.isWindowsPlatform() and qVersion() >= "5.7.0":
+##        if qVersionTuple() >= (5, 8, 0) or (
+##            not Globals.isWindowsPlatform() or qVersionTuple() >= (5, 7, 0)):
+        if not Globals.isWindowsPlatform() and qVersionTuple() >= (5, 7, 0):
             self.printAct = E5Action(
                 self.tr('Print'),
                 UI.PixmapCache.getIcon("print.png"),
@@ -764,7 +765,7 @@
         else:
             self.printAct = None
         
-        if Globals.isLinuxPlatform() or qVersion() >= "5.7.0":
+        if Globals.isLinuxPlatform() or qVersionTuple() >= (5, 7, 0):
             self.printPdfAct = E5Action(
                 self.tr('Print as PDF'),
                 UI.PixmapCache.getIcon("printPdf.png"),
@@ -784,10 +785,10 @@
             self.printPdfAct = None
         
         # TODO: re-check this once printing on Windows is reliable
-##        if qVersion() >= "5.8.0" or (
-##                not Globals.isWindowsPlatform() and qVersion() < "5.7.0"):
+##        if qVersionTuple() >= (5, 8, 0) or (
+##            not Globals.isWindowsPlatform() and qVersionTuple() < (5, 7, 0)):
         if not Globals.isWindowsPlatform() and (
-                qVersion() < "5.7.0" or qVersion() >= "5.8.0"):
+                qVersionTuple() < (5, 7, 0) or qVersionTuple() >= (5, 8, 0)):
             self.printPreviewAct = E5Action(
                 self.tr('Print Preview'),
                 UI.PixmapCache.getIcon("printPreview.png"),
@@ -2868,7 +2869,7 @@
                 profile.setHttpCacheType(QWebEngineProfile.MemoryHttpCache)
                 profile.setHttpCacheMaximumSize(0)
         
-        if qVersion() >= "5.8.0":
+        if qVersionTuple() >= (5, 8, 0):
             profile.setSpellCheckEnabled(
                 Preferences.getWebBrowser("SpellCheckEnabled"))
             profile.setSpellCheckLanguages(
@@ -4240,7 +4241,7 @@
                 cls._webProfile.setPersistentCookiesPolicy(
                     QWebEngineProfile.AllowPersistentCookies)
             
-            if qVersion() >= "5.8.0":
+            if qVersionTuple() >= (5, 8, 0):
                 cls._webProfile.setSpellCheckEnabled(
                     Preferences.getWebBrowser("SpellCheckEnabled"))
                 cls._webProfile.setSpellCheckLanguages(

eric ide

mercurial