Hi Dirk,

>>Can anybody reproduce this ? Is this a problem of qt-4 or is it the 
>>same with qt-3 ?

>I can't reproduce it on Linux with the attached code using Qt3. Can
>you try that? It really makes very little sense that the baseclass
>would make a difference...

Yes, it really makes little sense, but i can reproduce the problem with
the example code that you provided (using Qt-4.1.1 again). Again no
problem when i derive from QObject or another class which is not
derived from Qwidget, but fails if i use QWidget.

I stepped through the code in the debugger and found the following problem
which might be a hint for you (it's not one for me :)) ):

In method osgTypedMethodFunctor1ObjPtrCPtrRef() [file osgtypedfunctors.inl]
the OFunctor "returnValue" gets initialized by calling the method
setMethod()
(so returnValue.setMethod()):

template <class Parent, class Params> inline
void TypedStoredObjectFunctorBase<Parent, Params>::setMethod(ObjMethodF
pFunc)
{
    Self::_flags |=  Self::FuncPtrValid;

    *((ObjMethodF *) Self::_data2) = pFunc; 
}

The assignment of pFunc to _data2 "overwrites" the other member variables
like the just set _flags member variable. Before the assignment the _flags
variable has a value of 0x02 and after the assignment it has a value of
0x00.

When afterwards the TypedStoredObjectFunctor1 method is invoked, it tests
the FuncPtrValid-Flag which has been cleared by the assignment and does not
invoke the methode.

if(Self::_flags & Self::FuncPtrValid &&
   Self::_flags & Self::ObjectValid)
{
   //NEVER REACHES THIS ONE
   return TypeTraits::callObjectMethod(Self::_data1, Self::_data2, obj);
}
else
{
   //BUT THIS INSTEAD
   return RetT();
}

Any idea what the problem might be ? Unfortunately i have no Linux box
available right now, so that i can double check the problem with linux
and gcc.

Thanks in advance,

Yuecel



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to