Fixed issues setting the printer margins correctly.

Fri, 01 Jul 2011 19:46:37 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Fri, 01 Jul 2011 19:46:37 +0200
changeset 1155
4cbef040f07e
parent 1153
8fe2e1abd4ea
child 1157
31644008f9b2

Fixed issues setting the printer margins correctly.

Graphics/PixmapDiagram.py file | annotate | diff | comparison | revisions
Graphics/SvgDiagram.py file | annotate | diff | comparison | revisions
Graphics/UMLGraphicsView.py file | annotate | diff | comparison | revisions
Helpviewer/HelpTabWidget.py file | annotate | diff | comparison | revisions
QScintilla/Printer.py file | annotate | diff | comparison | revisions
--- a/Graphics/PixmapDiagram.py	Thu Jun 30 08:23:56 2011 +0200
+++ b/Graphics/PixmapDiagram.py	Fri Jul 01 19:46:37 2011 +0200
@@ -276,6 +276,13 @@
             printer.setPageOrder(QPrinter.FirstPageFirst)
         else:
             printer.setPageOrder(QPrinter.LastPageFirst)
+        printer.setPageMargins(
+            Preferences.getPrinter("LeftMargin") * 10,
+            Preferences.getPrinter("TopMargin") * 10,
+            Preferences.getPrinter("RightMargin") * 10,
+            Preferences.getPrinter("BottomMargin") * 10,
+            QPrinter.Millimeter
+        )
         printer.setPrinterName(Preferences.getPrinter("PrinterName"))
         
         preview = QPrintPreviewDialog(printer, self)
--- a/Graphics/SvgDiagram.py	Thu Jun 30 08:23:56 2011 +0200
+++ b/Graphics/SvgDiagram.py	Fri Jul 01 19:46:37 2011 +0200
@@ -247,6 +247,13 @@
             printer.setPageOrder(QPrinter.FirstPageFirst)
         else:
             printer.setPageOrder(QPrinter.LastPageFirst)
+        printer.setPageMargins(
+            Preferences.getPrinter("LeftMargin") * 10,
+            Preferences.getPrinter("TopMargin") * 10,
+            Preferences.getPrinter("RightMargin") * 10,
+            Preferences.getPrinter("BottomMargin") * 10,
+            QPrinter.Millimeter
+        )
         printer.setPrinterName(Preferences.getPrinter("PrinterName"))
         
         preview = QPrintPreviewDialog(printer, self)
--- a/Graphics/UMLGraphicsView.py	Thu Jun 30 08:23:56 2011 +0200
+++ b/Graphics/UMLGraphicsView.py	Fri Jul 01 19:46:37 2011 +0200
@@ -377,6 +377,13 @@
             printer.setPageOrder(QPrinter.FirstPageFirst)
         else:
             printer.setPageOrder(QPrinter.LastPageFirst)
+        printer.setPageMargins(
+            Preferences.getPrinter("LeftMargin") * 10,
+            Preferences.getPrinter("TopMargin") * 10,
+            Preferences.getPrinter("RightMargin") * 10,
+            Preferences.getPrinter("BottomMargin") * 10,
+            QPrinter.Millimeter
+        )
         printer.setPrinterName(Preferences.getPrinter("PrinterName"))
         
         printDialog = QPrintDialog(printer, self)
@@ -399,6 +406,13 @@
             printer.setPageOrder(QPrinter.FirstPageFirst)
         else:
             printer.setPageOrder(QPrinter.LastPageFirst)
+        printer.setPageMargins(
+            Preferences.getPrinter("LeftMargin") * 10,
+            Preferences.getPrinter("TopMargin") * 10,
+            Preferences.getPrinter("RightMargin") * 10,
+            Preferences.getPrinter("BottomMargin") * 10,
+            QPrinter.Millimeter
+        )
         printer.setPrinterName(Preferences.getPrinter("PrinterName"))
         
         preview = QPrintPreviewDialog(printer, self)
--- a/Helpviewer/HelpTabWidget.py	Thu Jun 30 08:23:56 2011 +0200
+++ b/Helpviewer/HelpTabWidget.py	Fri Jul 01 19:46:37 2011 +0200
@@ -406,6 +406,13 @@
             printer.setPageOrder(QPrinter.FirstPageFirst)
         else:
             printer.setPageOrder(QPrinter.LastPageFirst)
+        printer.setPageMargins(
+            Preferences.getPrinter("LeftMargin") * 10,
+            Preferences.getPrinter("TopMargin") * 10,
+            Preferences.getPrinter("RightMargin") * 10,
+            Preferences.getPrinter("BottomMargin") * 10,
+            QPrinter.Millimeter
+        )
         printer.setPrinterName(Preferences.getPrinter("PrinterName"))
         
         printDialog = QPrintDialog(printer, self)
@@ -480,6 +487,13 @@
             printer.setPageOrder(QPrinter.FirstPageFirst)
         else:
             printer.setPageOrder(QPrinter.LastPageFirst)
+        printer.setPageMargins(
+            Preferences.getPrinter("LeftMargin") * 10,
+            Preferences.getPrinter("TopMargin") * 10,
+            Preferences.getPrinter("RightMargin") * 10,
+            Preferences.getPrinter("BottomMargin") * 10,
+            QPrinter.Millimeter
+        )
         printer.setPrinterName(Preferences.getPrinter("PrinterName"))
         
         self.__printPreviewBrowser = browser
--- a/QScintilla/Printer.py	Thu Jun 30 08:23:56 2011 +0200
+++ b/QScintilla/Printer.py	Fri Jul 01 19:46:37 2011 +0200
@@ -35,6 +35,13 @@
             self.setPageOrder(QPrinter.FirstPageFirst)
         else:
             self.setPageOrder(QPrinter.LastPageFirst)
+        self.setPageMargins(
+            Preferences.getPrinter("LeftMargin") * 10,
+            Preferences.getPrinter("TopMargin") * 10,
+            Preferences.getPrinter("RightMargin") * 10,
+            Preferences.getPrinter("BottomMargin") * 10,
+            QPrinter.Millimeter
+        )
         self.setPrinterName(Preferences.getPrinter("PrinterName"))
         self.time = QTime.currentTime().toString(Qt.LocalDate)
         self.date = QDate.currentDate().toString(Qt.LocalDate)

eric ide

mercurial