signals and slots vs. virtual_hook (was [PATCH] KFileDialog overwrite confirmation)

Leo Savernik l.savernik at aon.at
Tue Jul 15 17:42:05 BST 2008


Am Dienstag, 15. Juli 2008 schrieb Thiago Macieira:
> Besides, my point is exactly that qt_metacall *is* the same as
> virtual_hook. There's no need to involve signals here. Technically all
> you needed to do was:
>
> void MiddleClass::publicFunction(bool b)
> {
>     void *args[] = { &b };
>     int id = metaObject()->indexOfMethod("privateFunction(bool)");
>     qt_metacall(QMetaObject::InvokeMetaMethod, id, args);
> }
>

Cool, I didn't know that! It's ugly, but it should still be faster than a slot 
invocation.

[Declaration]
> protected:
>     Q_INVOKABLE void privateFunction(bool b);
> };

Say, I don't have a Q_INVOKABLE in release x. Is then adding Q_INVOKABLE in 
release x+1 BIC?

mfg
	Leo





More information about the kde-core-devel mailing list