7 Module implementing a dialog showing a SVG graphic. |
7 Module implementing a dialog showing a SVG graphic. |
8 """ |
8 """ |
9 |
9 |
10 from PyQt6.QtCore import QEvent, QMarginsF, QSize, Qt |
10 from PyQt6.QtCore import QEvent, QMarginsF, QSize, Qt |
11 from PyQt6.QtGui import QAction, QColor, QFont, QPageLayout, QPainter, QPalette |
11 from PyQt6.QtGui import QAction, QColor, QFont, QPageLayout, QPainter, QPalette |
12 from PyQt6.QtPrintSupport import QPrintDialog, QPrinter |
12 from PyQt6.QtPrintSupport import QPrintDialog, QPrinter, QPrintPreviewDialog |
13 from PyQt6.QtSvgWidgets import QSvgWidget |
13 from PyQt6.QtSvgWidgets import QSvgWidget |
14 from PyQt6.QtWidgets import QMenu, QScrollArea, QSizePolicy, QToolBar |
14 from PyQt6.QtWidgets import QMenu, QScrollArea, QSizePolicy, QToolBar |
15 |
15 |
16 from eric7 import Preferences |
16 from eric7 import Preferences |
17 from eric7.EricGui import EricPixmapCache |
17 from eric7.EricGui import EricPixmapCache |
333 |
333 |
334 def __printPreviewDiagram(self): |
334 def __printPreviewDiagram(self): |
335 """ |
335 """ |
336 Private slot called to show a print preview of the diagram. |
336 Private slot called to show a print preview of the diagram. |
337 """ |
337 """ |
338 from PyQt6.QtPrintSupport import QPrintPreviewDialog |
|
339 |
|
340 printer = QPrinter(mode=QPrinter.PrinterMode.ScreenResolution) |
338 printer = QPrinter(mode=QPrinter.PrinterMode.ScreenResolution) |
341 printer.setFullPage(True) |
339 printer.setFullPage(True) |
342 if Preferences.getPrinter("ColorMode"): |
340 if Preferences.getPrinter("ColorMode"): |
343 printer.setColorMode(QPrinter.ColorMode.Color) |
341 printer.setColorMode(QPrinter.ColorMode.Color) |
344 else: |
342 else: |