Proposing the removal of virtual_hooks (or how you can add a virtual method without using "virtual")

Thiago Macieira thiago at kde.org
Sun Mar 5 13:10:14 GMT 2006


Lubos Lunak wrote:
>On Saturday 04 March 2006 12:44, Olivier Goffart wrote:
>> Le Samedi 4 Mars 2006 12:18, Thiago Macieira a écrit :
>> > I'd like to propose a change of policy in the KDE libraries: remove
>> > all virtual_hook functions from QObject-derived classes.
>
> Fine with me.
>
>> I agree.
>> If we want to add a virtual function, the workaround using
>> signals/slots is more intuitive that the one with virtual_hook
>
> Is it :) ? Well, I'd say that they're both pretty ugly (and I'm the
> author of both), but it'd be naive to expect ugly hacks not to be ugly,
> wouldn't it?

Yes, of course. But using qt_metacall as the virtual hook allows us to 
hide from the type-unsafe parameter passing into the void* array.

If moc generates bad code there, we'll have much bigger problems anyways.

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

5. Swa he géanhwearf tó timbran, and hwonne he cóm, lá! Unix cwæð "Hello, 
World". Ǽfre ǽghwilc wæs glæd and seo woruld wæs fréo.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20060305/95d16c72/attachment.sig>


More information about the kde-core-devel mailing list