[Qt-interest] qobject_cast<> questions

Thiago Macieira thiago.macieira at trolltech.com
Sun May 31 09:40:34 CEST 2009


Ross Bencina wrote:
>>>Also, can I rely on qobject_cast<> to work with null pointers? (ie to
>>> return null if it is passed null?)
>>
>>The source code for Qt is available and writing a test for that is a
>>couple of seconds.
>
>Testing the actual behavior tells me nothing about the specified,
> expected or required behavior. I hope that you guys do more than "check
> the source code" to determine how such fundamental mechanisms as a type
> safe dynamic cast are supposed to behave.

My point was that I didn't know the answer by heart and I would have 
checked the source code. So instead of my checking the source code, I 
recommended you did :-)

>I'll file a documentation bug.

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.

-- 
Thiago Macieira - thiago.macieira (AT) nokia.com
  Senior Product Manager - Nokia, Qt Software
      Sandakerveien 116, NO-0402 Oslo, Norway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090531/b56af3ec/attachment.bin 


More information about the Qt-interest-old mailing list