src/eric7/Graphics/SvgDiagram.py

branch
eric7
changeset 9482
a2bc06a54d9d
parent 9473
3f23dbf37dbe
child 9653
e67609152c5e
equal deleted inserted replaced
9481:0b936ff1bbb9 9482:a2bc06a54d9d
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:

eric ide

mercurial