Programatically generated slot names

Thiago Macieira thiago at kde.org
Mon Feb 2 07:19:11 GMT 2009


Jeff Mitchell wrote:
>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?

invokeMethod doesn't take ().

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- 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/21681517/attachment.sig>


More information about the kde-core-devel mailing list