<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] <<a href="/user/SendEmail.jtp?type=node&node=5087186&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>> 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)">>         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">>         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">     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"> mh</span> </div></div></div></div>
<br>_______________________________________________
<br>PyQt mailing list    <a href="/user/SendEmail.jtp?type=node&node=5087165&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&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=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/>