[Qt-interest] qobject_cast<> questions
Andreas Pakulat
apaku at gmx.de
Mon Jun 1 12:22:46 CEST 2009
On 31.05.09 21:28:04, Ross Bencina wrote:
> Thiago Macieira
> >But I argue that we shouldn't need to document when things work exactly as
> >expected. If qobject_cast is meant to work as a replacement for
> >dynamic_cast, then it should work like it.
>
> Ok, great, that is the most specific description of what qobject_cast is
> supposed to be I have read. That is much clearer than the documentation,
> which says:
>
> """
> The qobject_cast() function behaves similarly to the standard C++
> dynamic_cast()
> """
>
> Note that it does not say "exactly" it says "similarly"
Because "exactly" would not be correct. qobject_cast<> only works on
QObject's and additionally it doesn't need rtti to work (dynamic_cast<>
needs that).
Andreas
--
Don't you feel more like you do now than you did when you came in?
More information about the Qt-interest-old
mailing list