[Qt-interest] qobject_cast<> questions
Scott Aron Bloom
Scott.Bloom at sabgroup.com
Sun May 31 10:59:03 CEST 2009
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). These kind of
edge cases are where the bugs often happen as you know.
Thanks!
Ross.
============
I tend to agree with Ross here... qobject_cast should be "documented to
behave the way it does now"
I realize, that not everthing will be documented to allow for future
change flexability...
However, something like qobject_cast is now fixed.. why do I say that?
Well... Ive read a lot of the qt code base, I tend to go there first
when I have an issue.. and I have seen too many calls into qobject_cast
without null check first..
So TT would have to change WAY WAY too much code :)
Scott
More information about the Qt-interest-old
mailing list