Hello Jason<br><br>First of all, is Activation.http a QObject? I think what you want to do is:<br><br>QObject.connect(self.http, SIGNAL('done(bool)'), self.loginResponseCvd)<br><br>QObject.connect is a static class method, so there's no point in calling it on an Activation instance. When it comes to emit however, it should be treated as an instance method (
self.emit).<br><br>Arve<br><br><div><span class="gmail_quote">On 7/23/07, <b class="gmail_sendername">Jason Hihn</b> <<a href="mailto:jason@eyemaginations.com">jason@eyemaginations.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div link="blue" vlink="purple" lang="EN-US">
<div>
<p><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;">In the class below (where I use … for brevity) when I
have the Activation class not as a QObject but as a plain python class, the loginReponseRcvd()
gets called. As soon as I make it a QObject (so I can emit) it stops working. The
commented out line I tried and it told me that the underlining C++ object was
deleted…</span></font></p>
<p><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;"> </span></font></p>
<p><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;">Can anyone offer a suggestion?</span></font></p>
<p><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;">Thanks!</span></font></p>
<p><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;"> </span></font></p>
<p><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;"> </span></font></p>
<p><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;"> </span></font></p>
<p><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;">class Activation(QObject):</span></font></p>
<p><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;">…</span></font></p>
<p><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;"> def
login (self, username, password):</span></font></p>
<p style="margin-left: 0.5in; text-indent: 0.5in;"><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;"> … </span></font></p>
<p><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;"> #self.connect(self.http,
SIGNAL('done(bool)'), self, SLOT('loginReponseRcvd(bool)'))</span></font></p>
<p><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;"> self.connect(self.http,
SIGNAL('done(bool)'), self.loginReponseRcvd)</span></font></p>
<p><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;"> </span></font></p>
<p><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;"> </span></font><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;" lang="DE">self.http.get
(getdata)</span></font></p>
<p><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;" lang="DE"> </span></font><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;">print
'login'</span></font></p>
<p><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;"> </span></font></p>
<p><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;"> def
loginReponseRcvd(self, error):</span></font></p>
<p><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;"> print
'loginReponseRcvd: ', error</span></font></p>
<p><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;"> if
error:</span></font></p>
<p><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;"> </span></font><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;" lang="FR">
print
str(self.http.errorString())</span></font></p>
<p><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;" lang="FR"> else:</span></font></p>
<p><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;" lang="FR"> data=str(self.http.readAll())</span></font></p>
<p><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;" lang="FR"> </span></font><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;">
print
'data:', data</span></font></p>
<p><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;"> QObject.emit(self,
SIGNAL('loggedIn(bool)'), data=='1')</span></font></p>
<p><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;"> QApplication.exit(0)</span></font></p>
<p><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;"> </span></font></p>
<p style="margin: 0in 0in 0.0001pt;"><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;">---</span></font></p>
<p style="margin: 0in 0in 0.0001pt;"><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;">Regards,<br>
<br>
Jason Hihn</span></font></p>
<p style="margin: 0in 0in 0.0001pt;"><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;">Director of Software Engineering<br>
Eyemaginations, Inc.<br>
<br>
600 Washington Ave, Suite #100<br>
Towson, MD
21204<br>
Domestic: 877.321.5481 ext. 8617<br>
International: 410.321.5481 ext. 8617<br>
Fax: 410.616.8657<br>
<a href="mailto:jason@eyemaginations.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">jason@eyemaginations.com</a><br>
<a href="http://www.eyemaginations.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">www.eyemaginations.com</a><br>
<a href="http://www.3d-eye.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">www.3d-eye.com</a><br>
<br>
=================================================<br>
The information transmitted within this email document or fax is intended only
for </span></font></p>
<p style="margin: 0in 0in 0.0001pt;"><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;">the person(s) or entity to which it
is specifically addressed and may contain </span></font></p>
<p style="margin: 0in 0in 0.0001pt;"><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;">confidential and/or privileged
material of Eyemaginations. Any re-creation, review, </span></font></p>
<p style="margin: 0in 0in 0.0001pt;"><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;">distribution, retransmission,
dissemination or other use of, or taking of any action </span></font></p>
<p style="margin: 0in 0in 0.0001pt;"><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;">in reliance upon, this information
by persons or entities other than the intended </span></font></p>
<p style="margin: 0in 0in 0.0001pt;"><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;">parties is completely prohibited.
If you have received this email in error, please </span></font></p>
<p style="margin: 0in 0in 0.0001pt;"><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;">contact the sender or author and
permanently delete and destroy the email from </span></font></p>
<p style="margin: 0in 0in 0.0001pt;"><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;">any computer which houses its
contents. </span></font></p>
<p style="margin: 0in 0in 0.0001pt;"><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;">=================================================</span></font></p>
<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;"> </span></font></p>
</div>
</div>
<br>_______________________________________________<br>PyQt mailing list <a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt" target="_blank">
http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a><br></blockquote></div><br>