Re: qobject_cast

Olivier Goffart <[email protected]> Sun, 13 Nov 2005 00:36:19 +0100
Newsgroups gmane.comp.kde.devel.optimize
Message-ID <[email protected]>
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.

_______________________________________________
Kde-optimize mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kde-optimize
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQBDdnx3z58lY8jWrL0RAoM8AKCI3rhh65oI1L73Rz4d484zuhMMYgCeK9d4
3mlUBTBwk8ioit0ySIK5dPc=
=IHqj
-----END PGP SIGNATURE-----