[Development] [RFC] What to do about overloaded signals/slots?
Olivier Goffart
olivier at woboq.com
Sat Oct 5 20:47:40 CEST 2013
On Saturday 05 October 2013 19:18:29 André Somers wrote:
> > 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?
Yes, that's true.
> 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.
There is the same problem if one use pointer to member function in
QtConcurrent[1] or in other third party API (boost::bind)
Which means adding an overload can be a source incompatible change regardless
if it is used as a slot or not.
[1] https://bugreports.qt-project.org/browse/QTBUG-12897
--
Olivier
Woboq - Qt services and support - http://woboq.com - http://code.woboq.org
More information about the Development
mailing list