Hazen Babcock wrote:
> 
> Poking around a little more...
> 
> In the function plD_line_qt we are not getting past this statement:
> 
> #if defined(PLD_qtwidget) || defined(PLD_extqt)
>       if(widget==NULL) widget=dynamic_cast<QtPLWidget*>((QWidget *) pls->dev);
> #endif
>       if(widget==NULL) return;
> 
> So the dynamic cast is not working for some reason?
> 
> printf(" %ld %ld\n", (long)pls->dev, (long)widget);
> 
> Suggests that pls->dev is valid, or at least not zero, but that widget 
> is still zero after the cast.

Hopefully someone can offer a few suggestions here...

So far I have:
(1) The C++ QtExtWidget constructor is called when the corresponding 
python object is created.
(2) The C++ QtExtWidget destructor is called when the program the ends.
(3) The address of the C++ QtExtWidget is not being moved on the Python 
side.
(4) Introspection on the C++ side of the python object says that yes it 
is a QtExtWidget object. eg. calling this function which I added to 
plqt.cpp:
void plprintaddress(QtExtWidget* widget)
{
   printf("PA %x\n", (long)widget);
   std::cout << typeid(widget).name() << std::endl;
}

Gives:
PA 1e0d3f0
P11QtExtWidget

(5) Forcing the cast (rather than using dynamic_cast) seems to make 
things work (i.e.: widget = (QtPLWidget *)pls->dev;).
(6) Introspection in plD_line_qt like this:
std::cout << typeid(pls->dev).name() << std::endl;
Gives "Pv" as the type for both the Python originated QtExtWidget object 
and the C++ originated object (by running the c++/qt_example program).

So, any thoughts as to what might be causing the problem with dynamic_cast?

thanks,
-Hazen


------------------------------------------------------------------------------
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to