[Development] Qt5 API change coming up: QObject::connectNotify(const char *) --> connectNotify(QMetaMethod)
thiago.macieira at intel.com
Mon Apr 30 15:16:52 CEST 2012
On segunda-feira, 30 de abril de 2012 14.53.49, Thiago Macieira wrote:
> On segunda-feira, 30 de abril de 2012 14.14.00, Kent Hansen wrote:
> > Yes, it's late, but it's also one of the final nails in the const char
> > *-based Q(Meta)Object introspection API coffin.
> [snip the rest]
> Needless to say, I support this change, even though SIC. So here's my
> maintainer stamp of approval for it.
> This is much cleaner than the previous implementation.
BTW, I was about to suggest that QMetaMethod be passed by value. My
investigations in "the value of passing by value" show that this class benefits
from it. And it does.
However, there's a catch: most QMetaMethod methods are non-inline. In order to
call them, the compiler would need to spill the class to memory anyway. So
there's no gain in passing by value, and it might even be worse because it
needs to use more registers in the function call sequence.
So the recommendation is: keep passing by const-ref.
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center
Intel Sweden AB - Registration Number: 556189-6027
Knarrarnäsgatan 15, 164 40 Kista, Stockholm, Sweden
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 190 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/development/attachments/20120430/5fe23949/attachment.bin
More information about the Development