[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] Printing in PyQt
From:       primalcharlie <charlie.hardy () outlook ! com>
Date:       2015-02-23 9:35:13
Message-ID: COL402-EAS387670E91ED89AFDB3152DCEC290 () phx ! gbl
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Thanks man!

Regards
Charles Hardy

> On 22 Feb 2015, at 23:44, michael h [via Python] <ml-node+s6n5087165h4@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
>> time.
> 
> 
> 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
> 
>  mh 
> 
> _______________________________________________ 
> PyQt mailing list    [hidden email] 
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt 
> 
> If you reply to this email, your message will be added to the discussion below:
> http://python.6.x6.nabble.com/Printing-in-PyQt-tp5086981p5087165.html
> To unsubscribe from Printing in PyQt, click here.
> NAML




--
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.
[Attachment #5 (text/html)]

<meta http-equiv="content-type" content="text/html; charset=utf-8"><div>Thanks \
man!<br><br><div>Regards</div>Charles Hardy</div><div><br>On 22 Feb 2015, at 23:44, \
michael h [via Python] &lt;<a href="/user/SendEmail.jtp?type=node&node=5087186&i=0" \
target="_top" rel="nofollow" link="external">[hidden email]</a>&gt; \
wrote:<br><br></div><blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' \
type="cite"><div>

	<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote \
style='border-left:2px solid #CCCCCC;padding:0 1em' style="border-left:2px solid \
#CCCCCC;padding:0 1em" class="gmail_quote"><br> Hi michael that solved that one now \
im getting a error saying that<br> QPainter::begin: A paint device can only be \
painted by one painter at a<br> \
time.<br></blockquote><div><br></div><div><br></div><div><font color="#500050">From \
the docs:</font></div><div><font color="#500050"><br></font></div><div><font \
color="#500050"><div>QPainter::QPainter(QPaintDevice * device)</div><div>Constructs a \
painter that begins painting the paint device \
immediately.</div></font></div><div><font color="#500050"><br></font></div><span \
style="font-size:13px;color:rgb(80,0,80)">&gt;&nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp;painter=QtGui.QPainter(</span><span \
style="font-size:13px;color:rgb(80,0,80)">printer)</span><div><font \
color="#500050"><br></font></div><div><font color="#500050">So you're calling begin \
again here.<br></font><div><br style="color:rgb(80,0,80);font-size:13px"><span \
style="color:rgb(80,0,80);font-size:13px">&gt;&nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp;painter.begin(printer)</span><br></div></div><div><span \
style="color:rgb(80,0,80);font-size:13px"><br></span></div><div><span \
style="color:rgb(80,0,80);font-size:13px">So take your own begin() call \
out.</span></div><div><span \
style="color:rgb(80,0,80);font-size:13px"><br></span></div><div><span \
style="color:rgb(80,0,80);font-size:13px">As a side note, QPainter can actually be \
used as a context manager so you could do:</span></div><div><span \
style="color:rgb(80,0,80);font-size:13px"><br></span></div><div><span \
style="color:rgb(80,0,80);font-size:13px">with QPainter(printer) as \
painter:</span></div><div><span style="color:rgb(80,0,80);font-size:13px">&nbsp; \
&nbsp; &nbsp;code with painter</span></div><div><span \
style="color:rgb(80,0,80);font-size:13px"><br></span></div><div><span \
style="color:rgb(80,0,80);font-size:13px">and it will handle being()/end() for you as \
needed</span><br></div><div><span \
style="color:rgb(80,0,80);font-size:13px"><br></span></div><div><span \
style="color:rgb(80,0,80);font-size:13px">&nbsp;mh</span>&nbsp;</div></div></div></div>
 <br>_______________________________________________
<br>PyQt mailing list &nbsp; &nbsp;<a \
href="/user/SendEmail.jtp?type=node&amp;node=5087165&amp;i=0" target="_top" \
rel="nofollow" link="external">[hidden email]</a> <br><a \
href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt" target="_top" \
rel="nofollow" link="external">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a>


	
	
	
	<br>
	<br>
	<hr noshade="noshade" size="1" color="#cccccc">
	<div style="color:#444; font: 12px tahoma,geneva,helvetica,arial,sans-serif;">
		<div style="font-weight:bold">If you reply to this email, your message will be \
added to the discussion below:</div>  <a \
href="http://python.6.x6.nabble.com/Printing-in-PyQt-tp5086981p5087165.html" \
target="_top" rel="nofollow" \
link="external">http://python.6.x6.nabble.com/Printing-in-PyQt-tp5086981p5087165.html</a>
  </div>
	<div style="color:#666; font: 11px \
tahoma,geneva,helvetica,arial,sans-serif;margin-top:.4em;line-height:1.5em">  
		To unsubscribe from Printing in PyQt, <a href="" target="_top" rel="nofollow" \
link="external">click here</a>.<br>  <a \
href="http://python.6.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&amp;id \
=instant_html%21nabble%3Aemail.naml&amp;base=nabble.naml.namespaces.BasicNamespace-nab \
ble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&amp;bread \
crumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml" \
rel="nofollow" style="font:9px serif" target="_top" link="external">NAML</a>  \
</div></div></blockquote>

	
	
	
<br/><hr align="left" width="300" />
View this message in context: <a \
href="http://python.6.x6.nabble.com/Printing-in-PyQt-tp5086981p5087186.html">Re: \
Printing in PyQt</a><br/> Sent from the <a \
href="http://python.6.x6.nabble.com/PyQt-f1792048.html">PyQt mailing list archive</a> \
at Nabble.com.<br/>


[Attachment #6 (text/plain)]

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic