[PyQt] Printing in PyQt
charlie.hardy at outlook.com
Mon Feb 23 09:35:13 GMT 2015
> On 22 Feb 2015, at 23:44, michael h [via Python] <ml-node+s6n5087165h4 at n6.nabble.com> wrote:
>> Hi michael that solved that one now im getting a error saying that
>> QPainter::begin: A paint device can only be painted by one painter at a
> From the docs:
> QPainter::QPainter(QPaintDevice * device)
> Constructs a painter that begins painting the paint device immediately.
> > painter=QtGui.QPainter(printer)
> So you're calling begin again here.
> > painter.begin(printer)
> So take your own begin() call out.
> As a side note, QPainter can actually be used as a context manager so you could do:
> with QPainter(printer) as painter:
> code with painter
> and it will handle being()/end() for you as needed
> PyQt mailing list [hidden email]
> If you reply to this email, your message will be added to the discussion below:
> To unsubscribe from Printing in PyQt, click here.
View this message in context: http://python.6.x6.nabble.com/Printing-in-PyQt-tp5086981p5087186.html
Sent from the PyQt mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PyQt