qobject_cast

Olivier Goffart ogoffart at kde.org
Sun Nov 13 00:36:19 CET 2005


Le Dimanche 13 Novembre 2005 00:42, Roger Larsson a écrit :
> On Saturday 12 November 2005 11.18, Olivier Goffart wrote:

> > Of course, I must continue to use static_cast which is still 10 times
> > faster than qobject_cast when i know what my object is.
>
> The question is - how do you know this for sure in real applications.
> (could be true now, but what about early next year)
> A test on a member variable (enum), or?
> How much time would such an test add to the static_cast case?
> (higher optimization levels will probably move that test out of the loop)

Depending the context.

for example, in some case, i'm sure that the sender() of a slot that is only 
connected to one signal of a widget is a QWidget, so in theory, static_cast 
is fine.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-optimize/attachments/20051113/7354c63c/attachment.pgp


More information about the Kde-optimize mailing list