7 Module implementing a dialog showing a pixmap. |
7 Module implementing a dialog showing a pixmap. |
8 """ |
8 """ |
9 |
9 |
10 from __future__ import unicode_literals |
10 from __future__ import unicode_literals |
11 |
11 |
12 from PyQt4.QtCore import Qt, QSize, QEvent |
12 from PyQt5.QtCore import Qt, QSize, QEvent |
13 from PyQt4.QtGui import QLabel, QPalette, QSizePolicy, QScrollArea, QAction, \ |
13 from PyQt5.QtGui import QPalette, QImage, QPixmap, QPainter, QFont, QColor |
14 QMenu, QToolBar, QImage, QPixmap, QPrinter, QPrintDialog, QPainter, \ |
14 from PyQt5.QtWidgets import QLabel, QSizePolicy, QScrollArea, QAction, QMenu, \ |
15 QFont, QColor |
15 QToolBar |
|
16 from PyQt5.QtPrintSupport import QPrinter, QPrintDialog |
16 |
17 |
17 from E5Gui import E5MessageBox |
18 from E5Gui import E5MessageBox |
18 from E5Gui.E5MainWindow import E5MainWindow |
19 from E5Gui.E5MainWindow import E5MainWindow |
19 from E5Gui.E5ZoomWidget import E5ZoomWidget |
20 from E5Gui.E5ZoomWidget import E5ZoomWidget |
20 |
21 |
323 |
324 |
324 def __printPreviewDiagram(self): |
325 def __printPreviewDiagram(self): |
325 """ |
326 """ |
326 Private slot called to show a print preview of the diagram. |
327 Private slot called to show a print preview of the diagram. |
327 """ |
328 """ |
328 from PyQt4.QtGui import QPrintPreviewDialog |
329 from PyQt5.QtPrintSupport import QPrintPreviewDialog |
329 |
330 |
330 printer = QPrinter(mode=QPrinter.ScreenResolution) |
331 printer = QPrinter(mode=QPrinter.ScreenResolution) |
331 printer.setFullPage(True) |
332 printer.setFullPage(True) |
332 if Preferences.getPrinter("ColorMode"): |
333 if Preferences.getPrinter("ColorMode"): |
333 printer.setColorMode(QPrinter.Color) |
334 printer.setColorMode(QPrinter.Color) |