[Development] Fixing connecting to private signals
olivier at woboq.com
Wed Jul 11 19:10:59 CEST 2012
On Wednesday 11 July 2012 18:50:15 Stephen Kelly wrote:
> On Wednesday, July 11, 2012 18:40:10 Thiago Macieira wrote:
> > I don't see the point of a private signal.
> > QAbstractitemModel is abusing it. Just make them regular signals.
Do you see the point of the private or protected keyword in C++?
It is just in order to catch a common mistake people do while implementing
models. (As if it was not already hard enough)
> I'm opposed to making those public because users will use
> emit rowsInserted(...);
> in subclasses of QAIM, which might happen to appear to work the first time,
> and therefore will breaking things silently.
> I'm sure the situation is similar for users emitting entered() or exited()
> in QAbstractState subclasses.
> So, either the code should stay as is - leaving the signals private and
> making function pointer connects not work, or the patches should be
> applied, making function pointer connects work.
> Making the signals public is not an option for me.
I personally beleive allowing the new syntax is more important than keeping
those signal private.
Anyway, i'm quite happy with the current implementation in moc.
Then it looks ugly because of the qdoc hack... but that can be fixed later.
Woboq - Qt services and support - http://woboq.com
More information about the Development