[Development] [RFC] What to do about overloaded signals/slots?

André Somers andre at familiesomers.nl
Sat Oct 5 19:18:29 CEST 2013



> Op 5 okt. 2013 om 18:24 heeft Olivier Goffart <olivier at woboq.com> het volgende geschreven:
> 
> I would also like to remind that adding overloads to functions is not source 
> compatible,  as it may break a connection using the function poitner syntax.
> Overloaded signals and slots should be avoided.
> 
Well, isn't this really the case for _all_ overloads then? As with the new syntax signals can be connected to any method and not only slots, introducing any overload is potentially source incompatible. So, this rule seems rather inadequate. To me, it sounds like the recommended policy should be to *always* specify the type in the new connection syntax instead. Otherwise I don't see how you can ever stay source compatible without limiting the development of the Qt API too much. Forbidding introducing overloads everywhere doesn't sound like a good idea to me, but only guaranteeing source compatibility if you use the full syntax specifying types sounds reasonable. You can choose to omit them, at the cost of having to fix some connects sometimes when changing Qt versions. That would also lift your rule above again. 

André





More information about the Development mailing list