[Development] Disabling exception support in QtCore?

Thiago Macieira thiago.macieira at intel.com
Wed Oct 2 18:30:58 CEST 2013


On quarta-feira, 2 de outubro de 2013 07:13:11, Knoll Lars wrote:
> +1. It's our decision not to use exceptions in Qt code, but I see quite a
> bit of value in being able to throw exceptions from a slot if that's the
> pattern a developer chooses to use. We've been doing quite a bit of work
> to allow this in Qt 4, and it's the main place where exception safety in
> Qt Core really makes sense IMO.

Then please clarify the semantics. I really don't see this as a currently-
valid use-case because it's not been specified.

I dislike allowing this via the signal-slot mechanism because I see throwing 
from a slot as incompatible with the connection semantics. That would mean any 
signal could throw ANY exception. It would also preempt the execution of 
further slots, which might be important. 

Usually the person who connects a signal to a slot is a completely different 
developer than who wrote the signal or the slot. That would mean people who do 
connections should have to pay attention to what slots throw and know what 
signals can cope with exceptions being thrown.

I would accept at most exceptions through the invokeMethod mechanism in a 
DirectConnection, since that's a 1:1 relationship and there are no signals.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20131002/5d619cad/attachment.sig>


More information about the Development mailing list