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

List:       pykde
Subject:    Re: [PyQt] Roadmap suggestion: raise exception when connect() fails
From:       Phil Thompson <phil () riverbankcomputing ! com>
Date:       2009-01-27 17:07:57
Message-ID: 53bdd7eb86498a5771af0e81bfe8f7e0 () localhost
[Download RAW message or body]

On Wed, 21 Jan 2009 19:58:06 +0100, Giovanni Bajo <rasky@develer.com>
wrote:
> Hello,
> 
> a problem that often arise when programming with PyQt is that 
> QObject.connect() simply returns False when a connection fails. 
> Sometimes you get some debug output on the console (coming from Qt), but 
> this is not true if the reason why the connection fails is a 
> PyQt-specific one.
> 
> An example is signal forwarding when the first signal is a short-circuit 
> signal. This is not supported by PyQt, but what happens is that 
> QObject.connect() simply returns False, and you get no other feedback 
> that your connection is wrong.
> 
> I believe that it would be worth to special-case the binding of 
> QObject.connect() so that, when a connection fails, a RuntimeError is 
> raised. I think it's a function that it is very common *and* it has a 
> deep semantic overloading in PyQt (that is, it's behaviour is much more 
> complex than the basic Qt's connect() because of additional features 
> like PyQt_PyObject, short-circuit signals, etc.).

I will consider this if it can be done very easily after all the other
refactoring has been done. I don't want to risk breaking existing
applications, even though it might highlight bugs in those applications.

> I would of course recommend to do the same for pyqtBoundSignal.connect().

Definately - any failure in a new-style connection will raise an exception.

Phil
_______________________________________________
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