eric7/QScintilla/Printer.py

branch
eric7
changeset 8518
6a3eadfc3fb6
parent 8318
962bce857696
child 8881
54e42bc2437a
--- a/eric7/QScintilla/Printer.py	Thu Aug 19 17:21:03 2021 +0200
+++ b/eric7/QScintilla/Printer.py	Thu Aug 19 18:36:06 2021 +0200
@@ -7,8 +7,8 @@
 Module implementing the printer functionality.
 """
 
-from PyQt6.QtCore import QTime, QDate, Qt, QCoreApplication
-from PyQt6.QtGui import QColor
+from PyQt6.QtCore import QTime, QDate, Qt, QCoreApplication, QMarginsF
+from PyQt6.QtGui import QColor, QPageLayout
 from PyQt6.QtPrintSupport import QPrinter
 from PyQt6.Qsci import QsciPrinter
 
@@ -36,18 +36,18 @@
             self.setPageOrder(QPrinter.PageOrder.FirstPageFirst)
         else:
             self.setPageOrder(QPrinter.PageOrder.LastPageFirst)
-        self.setPageMargins(
+        self.setPageMargins(QMarginsF(
             Preferences.getPrinter("LeftMargin") * 10,
             Preferences.getPrinter("TopMargin") * 10,
             Preferences.getPrinter("RightMargin") * 10,
-            Preferences.getPrinter("BottomMargin") * 10,
-            QPrinter.Unit.Millimeter
+            Preferences.getPrinter("BottomMargin") * 10),
+            QPageLayout.Unit.Millimeter
         )
         printerName = Preferences.getPrinter("PrinterName")
         if printerName:
             self.setPrinterName(printerName)
-        self.time = QTime.currentTime().toString(Qt.DateFormat.LocalDate)
-        self.date = QDate.currentDate().toString(Qt.DateFormat.LocalDate)
+        self.time = QTime.currentTime().toString(Qt.DateFormat.RFC2822Date)
+        self.date = QDate.currentDate().toString(Qt.DateFormat.RFC2822Date)
         self.headerFont = Preferences.getPrinter("HeaderFont")
         
     def formatPage(self, painter, drawing, area, pagenr):

eric ide

mercurial