[PyQt] QObject confusion
Arve Knudsen
arve.knudsen at gmail.com
Mon Jul 23 17:11:34 BST 2007
On 7/23/07, Jason Hihn <jason at eyemaginations.com> wrote:
>
> Nevermind…I for got to call the base class initializer.
>
> i.e. apply(QObject.__init__, (self, ) + ())
>
Aha, that was the next suggestion on my list :] But it wasn't entirely clear
what was going on ..
Arve
------------------------------
>
> *From:* pyqt-bounces at riverbankcomputing.com [mailto:
> pyqt-bounces at riverbankcomputing.com] *On Behalf Of *Jason Hihn
> *Sent:* Monday, July 23, 2007 11:24 AM
> *To:* pyqt at riverbankcomputing.com
> *Subject:* [PyQt] QObject confusion
>
>
>
> 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…
>
>
>
> Can anyone offer a suggestion?
>
> Thanks!
>
>
>
>
>
>
>
> class Activation(QObject):
>
> …
>
> def login (self, username, password):
>
> …
>
> #self.connect(self.http, SIGNAL('done(bool)'),
> self, SLOT('loginReponseRcvd(bool)'))
>
> self.connect(self.http, SIGNAL('done(bool)'),
> self.loginReponseRcvd)
>
>
>
> self.http.get(getdata)
>
> print 'login'
>
>
>
> def loginReponseRcvd(self, error):
>
> print 'loginReponseRcvd: ', error
>
> if error:
>
> print str(self.http.errorString())
>
> else:
>
> data=str(self.http.readAll())
>
> print 'data:', data
>
> QObject.emit(self,
> SIGNAL('loggedIn(bool)'), data=='1')
>
> QApplication.exit(0)
>
>
>
> ---
>
> Regards,
>
> Jason Hihn
>
> Director of Software Engineering
> Eyemaginations, Inc.
>
> 600 Washington Ave, Suite #100
> Towson, MD 21204
> Domestic: 877.321.5481 ext. 8617
> International: 410.321.5481 ext. 8617
> Fax: 410.616.8657
> jason at eyemaginations.com
> www.eyemaginations.com
> www.3d-eye.com
>
> =================================================
> The information transmitted within this email document or fax is intended
> only for
>
> the person(s) or entity to which it is specifically addressed and may
> contain
>
> confidential and/or privileged material of Eyemaginations. Any
> re-creation, review,
>
> distribution, retransmission, dissemination or other use of, or taking of
> any action
>
> in reliance upon, this information by persons or entities other than the
> intended
>
> parties is completely prohibited. If you have received this email in
> error, please
>
> contact the sender or author and permanently delete and destroy the email
> from
>
> any computer which houses its contents.
>
> =================================================
>
>
>
> _______________________________________________
> PyQt mailing list PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20070723/ace0d927/attachment-0001.html
More information about the PyQt
mailing list