WebBrowser/WebBrowserView.py

changeset 5920
e47dd106c3d6
parent 5867
099008539886
child 5921
d4797da58218
--- a/WebBrowser/WebBrowserView.py	Sat Oct 21 15:18:15 2017 +0200
+++ b/WebBrowser/WebBrowserView.py	Sat Oct 21 19:17:27 2017 +0200
@@ -16,9 +16,9 @@
 
 import os
 
-from PyQt5.QtCore import pyqtSignal, QUrl, QFileInfo, Qt, QTimer, QEvent, \
-    QPoint, QPointF, QDateTime, QStandardPaths, QByteArray, QIODevice, \
-    QDataStream
+from PyQt5.QtCore import pyqtSignal, PYQT_VERSION, Qt, QUrl, QFileInfo, \
+    QTimer, QEvent, QPoint, QPointF, QDateTime, QStandardPaths, QByteArray, \
+    QIODevice, QDataStream
 from PyQt5.QtGui import QDesktopServices, QClipboard, QIcon, \
     QContextMenuEvent, QPixmap
 from PyQt5.QtWidgets import qApp, QStyle, QMenu, QApplication
@@ -549,7 +549,7 @@
             contextMenuData = self.page().contextMenuData()
             hitTest.updateWithContextMenuData(contextMenuData)
             
-            if qVersionTuple() >= (5, 8, 0) and \
+            if qVersionTuple() >= (5, 8, 0) and PYQT_VERSION >= 0x50800 and \
                bool(contextMenuData.misspelledWord()):
                 boldFont = menu.font()
                 boldFont.setBold(True)
@@ -801,7 +801,7 @@
             language = languages[0]
             langCode = language.split("[")[1][:2]
             googleTranslatorUrl = QUrl(
-                "http://translate.google.com/#auto|{0}|{1}".format(
+                "http://translate.google.com/#auto/{0}/{1}".format(
                     langCode, self.selectedText()))
             menu.addAction(
                 UI.PixmapCache.getIcon("translate.png"),
@@ -1723,7 +1723,7 @@
         if url.isEmpty():
             return
         
-        if qVersionTuple() >= (5, 8, 0):
+        if qVersionTuple() >= (5, 8, 0) and PYQT_VERSION >= 0x50800:
             # since Qt 5.8.0
             fileName, savePageFormat = self.__getSavePageFileNameAndFormat()
             if fileName:

eric ide

mercurial