[Qt-interest] why index for signal/slots?
Luca Ferrari
fluca1978 at infinito.it
Tue May 26 15:58:25 CEST 2009
On Tuesday 26 May 2009 10:51:40 am Arnold Krille's cat walking on the keyboard
wrote:
> On Monday 25 May 2009 07:43:25 Luca Ferrari wrote:
> > is there any technical reason for using numeric indexes to dispatch among
> > signal/slots instead of using function pointers? I mean, in the moc
> > generated code (qt_metacall function).
>
> Probably for speed reasons. Comparing strings is much slower then comparing
> ints...
>
> And maybe also or memory-footprint reasons. And don't tell me that everyone
> today has enough memory but think about mobile / embedded devices.
>
Yes, probably is for memory and speed reason, but also comparing function
pointers could be quick enough.
Luca
More information about the Qt-interest-old
mailing list