Programatically generated slot names

Olivier Goffart ogoffart at kde.org
Mon Feb 2 07:25:50 GMT 2009


Le lundi 2 février 2009, Jeff Mitchell a écrit :
> Olivier Goffart wrote:
> >> Yeah, early on I tried removing SLOT from the name and simply prepending
> >> "1" to the function name.
> >
> > That should have worked. (assuming the signature name was correct, with
> > parenthesis and arguments)
>
> So, this is a bit strange:
>
> QString page( QString("1slotPage%1()").arg( m_pageNum ) );
>
> 1) QTimer::singleShot( 0, this, page.toAscii().constData() );
> 2) QMetaObject::invokeMethod( this, page.toAscii().constData() );
>
> Given the above, #1 works, #2 doesn't.  Anyone know why?
>
> Thanks,
> Jeff

Because invokeMethod doesn't need the SLOT code.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20090202/524902ea/attachment.sig>


More information about the kde-core-devel mailing list