QScintilla/Printer.py

branch
Py2 comp.
changeset 3057
10516539f238
parent 2525
8b507a9a2d40
parent 3011
18292228c724
child 3060
5883ce99ee12
equal deleted inserted replaced
3056:9986ec0e559a 3057:10516539f238
58 @param area the drawing area (QRect) 58 @param area the drawing area (QRect)
59 @param pagenr the page number (int) 59 @param pagenr the page number (int)
60 """ 60 """
61 fn = self.docName() 61 fn = self.docName()
62 62
63 header = QApplication.translate('Printer', 63 header = QApplication.translate(
64 '{0} - Printed on {1}, {2} - Page {3}')\ 64 'Printer', '{0} - Printed on {1}, {2} - Page {3}')\
65 .format(fn, self.date, self.time, pagenr) 65 .format(fn, self.date, self.time, pagenr)
66 66
67 painter.save() 67 painter.save()
68 painter.setFont(self.headerFont) # set our header font 68 painter.setFont(self.headerFont) # set our header font
69 painter.setPen(QColor(Qt.black)) # set color 69 painter.setPen(QColor(Qt.black)) # set color
70 if drawing: 70 if drawing:
71 painter.drawText(area.right() - painter.fontMetrics().width(header), 71 painter.drawText(
72 area.right() - painter.fontMetrics().width(header),
72 area.top() + painter.fontMetrics().ascent(), header) 73 area.top() + painter.fontMetrics().ascent(), header)
73 area.setTop(area.top() + painter.fontMetrics().height() + 5) 74 area.setTop(area.top() + painter.fontMetrics().height() + 5)
74 painter.restore() 75 painter.restore()

eric ide

mercurial