On Saturday, 24 de September de 2011 14:01:35 Peter Kuemmel wrote: > > Fully agree with Thiago. Making signals private would break an awful lot > > of existing code and is in many cases very inconvenient. > > > > I would also prefer if we could continue keeping signals protected, but as > > Olivier pointed out there are lots of advantages with the new connect > > syntax. > > I would add the statically checked connect optionally to the old > connect with protected signals. Then we would need moc generated > headers, but nobody is forced to use them. This would be 100% > backward compatible.
Olivier did the original work.
I like his solution and apparently so does Lars. If you think there's a better
solution, we need to see how it would work. A patch implementing it would be
preferable, but a proof of concept would be enough.
Several people have made suggestions, but all of them have one fatal problem
or another. I don't want to dismiss ideas, but I also don't spend time
pointing out problems that would be found in the first attempt.
Please be sure to check that:
1) it works on at least two compilers
2) you can implement a few parameters or use everything with variadic
templates
3) type promotion happens correctly (QString -> QVariant, int -> long, etc.)
4) pointer promotion happens correctly (QWidget* in a signal connects to a
QObject* in a slot, but not vice-versa)
5) const- and ref-correctness (can't bind a non-const ref to const rvalue,
can't bind lvalue ref to rvalue ref, etc.)
6) provide a good rvalue-ref solution or at least make sure it doesn't compile
until we find one
7) source compatibility with the current solution is kept:
in the .cpp: emit signalName(params...);
in the .h: Q_OBJECT
it's ok to add new things in order to enable the new syntax, but it would
preferable if nothing changed to enable it (aside from C++11). Definitely not
boilerplate code.
8) addition of new signals is binary compatible
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Software Architect - Intel Open Source Technology Center
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Qt5-feedback mailing list [email protected] http://lists.qt.nokia.com/mailman/listinfo/qt5-feedback
