eric7/Graphics/SvgDiagram.py

branch
eric7
changeset 8518
6a3eadfc3fb6
parent 8358
144a6b854f70
child 8881
54e42bc2437a
equal deleted inserted replaced
8517:639768825569 8518:6a3eadfc3fb6
5 5
6 """ 6 """
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 Qt, QSize, QEvent 10 from PyQt6.QtCore import Qt, QSize, QEvent, QMarginsF
11 from PyQt6.QtGui import QPalette, QPainter, QFont, QColor, QAction 11 from PyQt6.QtGui import QPalette, QPainter, QFont, QColor, QAction, QPageLayout
12 from PyQt6.QtWidgets import QSizePolicy, QScrollArea, QMenu, QToolBar 12 from PyQt6.QtWidgets import QSizePolicy, QScrollArea, QMenu, QToolBar
13 from PyQt6.QtPrintSupport import QPrinter, QPrintDialog 13 from PyQt6.QtPrintSupport import QPrinter, QPrintDialog
14 from PyQt6.QtSvgWidgets import QSvgWidget 14 from PyQt6.QtSvgWidgets import QSvgWidget
15 15
16 from EricWidgets.EricMainWindow import EricMainWindow 16 from EricWidgets.EricMainWindow import EricMainWindow
321 printer.setColorMode(QPrinter.ColorMode.GrayScale) 321 printer.setColorMode(QPrinter.ColorMode.GrayScale)
322 if Preferences.getPrinter("FirstPageFirst"): 322 if Preferences.getPrinter("FirstPageFirst"):
323 printer.setPageOrder(QPrinter.PageOrder.FirstPageFirst) 323 printer.setPageOrder(QPrinter.PageOrder.FirstPageFirst)
324 else: 324 else:
325 printer.setPageOrder(QPrinter.PageOrder.LastPageFirst) 325 printer.setPageOrder(QPrinter.PageOrder.LastPageFirst)
326 printer.setPageMargins( 326 printer.setPageMargins(QMarginsF(
327 Preferences.getPrinter("LeftMargin") * 10, 327 Preferences.getPrinter("LeftMargin") * 10,
328 Preferences.getPrinter("TopMargin") * 10, 328 Preferences.getPrinter("TopMargin") * 10,
329 Preferences.getPrinter("RightMargin") * 10, 329 Preferences.getPrinter("RightMargin") * 10,
330 Preferences.getPrinter("BottomMargin") * 10, 330 Preferences.getPrinter("BottomMargin") * 10),
331 QPrinter.Unit.Millimeter 331 QPageLayout.Unit.Millimeter
332 ) 332 )
333 printerName = Preferences.getPrinter("PrinterName") 333 printerName = Preferences.getPrinter("PrinterName")
334 if printerName: 334 if printerName:
335 printer.setPrinterName(printerName) 335 printer.setPrinterName(printerName)
336 336

eric ide

mercurial