[Qt-interest] "indexOfMethod" always return -1 if it's parameter is not a slot or sigal, why

Yao Huiji spideryao at gmail.com
Tue Aug 18 11:35:21 CEST 2009


thank you very much [?]

2009/8/18 Andre Somers <andre at familiesomers.nl>

> Yao Huiji wrote:
> >  In my class , there is a normal method named "SayHi", when I call
> > "indexOfMethod" ,the return value is -1, but after I use "signals" or
> > "slots" to modify this method , it will return the right method index.
> > I don't know why ?
> >
> Because this is a function of the Qt meta-object system, and that only
> works for classes that:
> 1) inherit QObject, and
> 2) use the Q_OBJECT macro in the class definition, and
> 3) is only available for methods that are invokable: signals, slots, and
> every method you use the Q_INVOKABLE macro on
>
> Qt adds extra functionality to standard C++, but it does not change
> normal C++.
>
> André
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090818/a54ee10f/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 569 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090818/a54ee10f/attachment.png 


More information about the Qt-interest-old mailing list