[Qt-interest] qobject_cast<> questions

Andreas Pakulat apaku at gmx.de
Sun May 31 11:05:07 CEST 2009


On 31.05.09 18:50:01, Ross Bencina wrote:
> Hi Thiago
> 
> >Please bear in mind that we cannot and will not document every single
> >aspect of the behaviour of Qt. There are things that will always be left
> >unexplained and undocumented, as a way of leaving the engineers some
> >manoeuvring room when expanding the API.
> 
> I appreciate that.. but I would think a mechanism as fundamental as 
> qobject_cast<> should be specified with the same rigor as dynamic_cast<> in 
> C++. Even if just to add a line to the docs "if you pass 0 the behavior is 
> undefined, don't do it!" -- at least then I would know to not call it with a 
> 0 parameter (even though I can do that with dynamic_cast).

But that comment would be wrong, qobject_cast does return 0 if its given
a 0-pointer.

Andreas

-- 
Your sister swims out to meet troop ships.



More information about the Qt-interest-old mailing list