[Development] Q_Q(), static_cast or reinterpret_cast?

Alberto Mardegan mardy at users.sourceforge.net
Fri Jun 29 12:14:07 CEST 2012


On 06/29/2012 01:54 PM, Olivier Goffart wrote:
> On Friday 29 June 2012 13:14:41 Alberto Mardegan wrote:
> <snip>
>> So, it seems that q->geometryChanged() invokes just
>> QDeclarativeItem::geometryChanged(), ignoring the fact that it's a
>> virtual method. That is because the q_func() invoked with the Q_Q()
>> macro uses a static_cast(), which doesn't care about derived classes,
>> opposed to Q_D() which uses a reinterpret_cast().
>
> You are wrong. :-)

You are right. :-)

I recompiled the whole project with -g, and now it's magically working. 
Not sure why, but at this point it's obvious that the problem was on my 
side.
Sorry for the noise!

   Alberto



More information about the Development mailing list