[PyKDE] mdi example printing
Kenneth Godee
Ken at perfect-image.com
Thu Mar 6 05:35:01 GMT 2003
Phil,
After playing with Kugar, I decided to go ahead and
give PyQt printing a try.
As everyone says take a look at the example code.
The first I tried was "examples3/mdi.py" but the printDoc
method of the MDIWindow class does not work as written in
the example code.
Here's the changes needed to make the sample code work.
I've also attached a diff_mdi.txt file incase the following
gets to jumbled up.
I know it's just a little thing, but can really throw us
newbees.
335c335
<p.setFont(self.e.font())
---
>p.setFont(self.medit.font())
340c340
<for i in range(self.e.numLines):
---
>for i in range(self.medit.lines()):
347c347
<p.drawText(Margin,Margin +
yPos,metrics.width(),fm.lineSpacing(),Qt.ExpandTabs | Qt.DontClip,self.e.textLine(i))
---
>p.drawText(Margin,Margin +
yPos,metrics.width(),fm.lineSpacing(),Qt.ExpandTabs | Qt.DontClip,self.medit.textLine(i))
-------------- next part --------------
335c335
< p.setFont(self.e.font())
---
> p.setFont(self.medit.font())
340c340
< for i in range(self.e.numLines):
---
> for i in range(self.medit.lines()):
347c347
< p.drawText(Margin,Margin + yPos,metrics.width(),fm.lineSpacing(),Qt.ExpandTabs | Qt.DontClip,self.e.textLine(i))
---
> p.drawText(Margin,Margin + yPos,metrics.width(),fm.lineSpacing(),Qt.ExpandTabs | Qt.DontClip,self.medit.textLine(i))
More information about the PyQt
mailing list