diff -r f606dbe20be6 -r 000ea446ff4b WebBrowser/WebBrowserTabWidget.py --- a/WebBrowser/WebBrowserTabWidget.py Sat May 13 13:46:05 2017 +0200 +++ b/WebBrowser/WebBrowserTabWidget.py Sat May 13 16:32:54 2017 +0200 @@ -12,7 +12,7 @@ import os from PyQt5.QtCore import pyqtSignal, pyqtSlot, Qt, QUrl, QDir, QFile, \ - QFileDevice, QTemporaryFile, qVersion + QFileDevice, QTemporaryFile from PyQt5.QtGui import QIcon, QPixmap, QPainter from PyQt5.QtWidgets import QWidget, QHBoxLayout, QMenu, QToolButton, \ QDialog, QApplication @@ -33,6 +33,7 @@ import Utilities import Preferences import Globals +from Globals import qVersionTuple from eric6config import getConfig @@ -185,21 +186,21 @@ self.tr('Close All'), self.closeAllBrowsers) self.__tabContextMenu.addSeparator() # 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.__tabContextMenu.addAction( UI.PixmapCache.getIcon("printPreview.png"), self.tr('Print Preview'), self.__tabContextMenuPrintPreview) # 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.__tabContextMenu.addAction( UI.PixmapCache.getIcon("print.png"), self.tr('Print'), self.__tabContextMenuPrint) - if Globals.isLinuxPlatform() or qVersion() >= "5.7.0": + if Globals.isLinuxPlatform() or qVersionTuple() >= (5, 7, 0): self.__tabContextMenu.addAction( UI.PixmapCache.getIcon("printPdf.png"), self.tr('Print as PDF'), self.__tabContextMenuPrintPdf) @@ -816,7 +817,7 @@ preview = QPrintPreviewDialog(printer, self) preview.resize(800, 750) - if qVersion() >= "5.8.0": + if qVersionTuple() >= (5, 8, 0): preview.paintRequested.connect( lambda p: self.__printPreviewRequested(p, browser)) else: