12 try: |
12 try: |
13 str = unicode |
13 str = unicode |
14 except NameError: |
14 except NameError: |
15 pass |
15 pass |
16 |
16 |
17 from PyQt4.QtCore import pyqtSlot, pyqtSignal, QObject, QT_TRANSLATE_NOOP, \ |
17 from PyQt5.QtCore import pyqtSlot, pyqtSignal, QObject, QT_TRANSLATE_NOOP, \ |
18 QUrl, QBuffer, QIODevice, QFileInfo, Qt, QTimer, QEvent, QRect, QFile, \ |
18 QUrl, QBuffer, QIODevice, QFileInfo, Qt, QTimer, QEvent, QRect, QFile, \ |
19 QPoint, QByteArray, qVersion |
19 QPoint, QByteArray, qVersion |
20 from PyQt4.QtGui import qApp, QDesktopServices, QStyle, QMenu, QApplication, \ |
20 from PyQt5.QtGui import QDesktopServices, QClipboard, QMouseEvent, QColor, \ |
21 QInputDialog, QLineEdit, QClipboard, QMouseEvent, QLabel, QToolTip, \ |
21 QPalette |
22 QColor, QPalette, QFrame, QPrinter, QPrintDialog, QDialog |
22 from PyQt5.QtWidgets import qApp, QStyle, QMenu, QApplication, QInputDialog, \ |
23 from PyQt4.QtWebKit import QWebView, QWebPage, QWebSettings |
23 QLineEdit, QLabel, QToolTip, QFrame, QDialog |
|
24 from PyQt5.QtPrintSupport import QPrinter, QPrintDialog |
|
25 from PyQt5.QtWebKit import QWebSettings |
|
26 from PyQt5.QtWebKitWidgets import QWebView, QWebPage |
24 try: |
27 try: |
25 from PyQt4.QtWebKit import QWebElement |
28 from PyQt5.QtWebKit import QWebElement |
26 except ImportError: |
29 except ImportError: |
27 pass |
30 pass |
28 from PyQt4.QtNetwork import QNetworkReply, QNetworkRequest |
31 from PyQt5.QtNetwork import QNetworkReply, QNetworkRequest |
29 import sip |
32 import sip |
30 |
33 |
31 from E5Gui import E5MessageBox, E5FileDialog |
34 from E5Gui import E5MessageBox, E5FileDialog |
32 |
35 |
33 import Preferences |
36 import Preferences |
34 import UI.PixmapCache |
37 import UI.PixmapCache |
35 |
38 |
36 try: |
39 try: |
37 from PyQt4.QtNetwork import QSslCertificate |
40 from PyQt5.QtNetwork import QSslCertificate |
38 SSL_AVAILABLE = True |
41 SSL_AVAILABLE = True |
39 except ImportError: |
42 except ImportError: |
40 SSL_AVAILABLE = False |
43 SSL_AVAILABLE = False |
41 |
44 |
42 ############################################################################### |
45 ############################################################################### |
2328 E5MessageBox.critical( |
2331 E5MessageBox.critical( |
2329 self, |
2332 self, |
2330 self.tr("eric5 Web Browser"), |
2333 self.tr("eric5 Web Browser"), |
2331 self.tr( |
2334 self.tr( |
2332 """<p>Printing is not available due to a bug in""" |
2335 """<p>Printing is not available due to a bug in""" |
2333 """ PyQt4. Please upgrade.</p>""")) |
2336 """ PyQt5. Please upgrade.</p>""")) |
2334 |
2337 |
2335 def __printPreviewClickedFrame(self): |
2338 def __printPreviewClickedFrame(self): |
2336 """ |
2339 """ |
2337 Private slot to show a print preview of the clicked frame. |
2340 Private slot to show a print preview of the clicked frame. |
2338 """ |
2341 """ |
2339 from PyQt4.QtGui import QPrintPreviewDialog |
2342 from PyQt5.QtPrintSupport import QPrintPreviewDialog |
2340 |
2343 |
2341 printer = QPrinter(mode=QPrinter.HighResolution) |
2344 printer = QPrinter(mode=QPrinter.HighResolution) |
2342 if Preferences.getPrinter("ColorMode"): |
2345 if Preferences.getPrinter("ColorMode"): |
2343 printer.setColorMode(QPrinter.Color) |
2346 printer.setColorMode(QPrinter.Color) |
2344 else: |
2347 else: |
2373 except AttributeError: |
2376 except AttributeError: |
2374 E5MessageBox.critical( |
2377 E5MessageBox.critical( |
2375 self, |
2378 self, |
2376 self.tr("eric5 Web Browser"), |
2379 self.tr("eric5 Web Browser"), |
2377 self.tr( |
2380 self.tr( |
2378 """<p>Printing is not available due to a bug in PyQt4.""" |
2381 """<p>Printing is not available due to a bug in PyQt5.""" |
2379 """Please upgrade.</p>""")) |
2382 """Please upgrade.</p>""")) |
2380 return |
2383 return |
2381 |
2384 |
2382 def __printPdfClickedFrame(self): |
2385 def __printPdfClickedFrame(self): |
2383 """ |
2386 """ |
2406 E5MessageBox.critical( |
2409 E5MessageBox.critical( |
2407 self, |
2410 self, |
2408 self.tr("eric5 Web Browser"), |
2411 self.tr("eric5 Web Browser"), |
2409 self.tr( |
2412 self.tr( |
2410 """<p>Printing is not available due to a bug in""" |
2413 """<p>Printing is not available due to a bug in""" |
2411 """ PyQt4. Please upgrade.</p>""")) |
2414 """ PyQt5. Please upgrade.</p>""")) |
2412 return |
2415 return |
2413 |
2416 |
2414 def __zoomInClickedFrame(self): |
2417 def __zoomInClickedFrame(self): |
2415 """ |
2418 """ |
2416 Private slot to zoom into the clicked frame. |
2419 Private slot to zoom into the clicked frame. |