[Qt-interest] the method "indexOfMethod" always return "-1", why?

Stephen Jackson spjackson42 at gmail.com
Sun Aug 16 17:25:38 CEST 2009


On Sun, Aug 16, 2009 at 4:10 PM, Yao Huiji wrote:
> Hi,
>
> sorry for my newbie question. when I call "indexOfMethod" ,the return value
> always is "-1",I don't konw why,can you help me?
>
>
> #include <QtCore/QCoreApplication>
>
> int main(int argc, char *argv[])
> {
>     QCoreApplication a(argc, argv);
>
>     QString
> str(QString("%1").arg(a.metaObject()->indexOfMethod("aboutToQuit")));
>
>     printf(str.toStdString().c_str());
>
>     return a.exec();
> }

You want "aboutToQuit()".

-- 
Regards,

Stephen Jackson




More information about the Qt-interest-old mailing list