private slots

Simon Hausmann hausmann at kde.org
Thu Jan 4 16:45:13 GMT 2007


On Thursday 04 January 2007 17:24, André Wöbbeking wrote:
> On Wednesday 03 January 2007 16:39, Simon Hausmann wrote:
> > On Wednesday 03 January 2007 16:23, Thomas Zander wrote:
> > > How is this better than the following?
> > >
> > > private slots:
> > >     void slotDateChanged();
> >
> > Because slotDateChanged() is a publically exported symbol. On
> > non-Msvc compilers you can still call it with #define private/public
> > hacks. On Windows you can't remove it at all without breaking binary
> > compatibility (even if no application calls it).
>
> Can you still connect to private slots from "outside"? If so you can
> call every private slot.

Yes, that is correct. That is why (I forgot to mention that) we should use a 
cryptic prefix for our private slots, to stress the fact to anybody trying to 
connect/call them from the outside that they shouldn't do it and that private 
slots may change/disappear any time.

In Qt we use the ugly _q_ prefix. I suggest to use _k_ in KDE ;-) (I've seen 
some people already doing that). So slotDateChanged() becomes 
_k_slotDateChanged().


Simon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070104/15f71fc9/attachment.sig>


More information about the kde-core-devel mailing list