[PyKDE] SIP and overloaded non-pure virtual functions
    Paul F. Kunz 
    Paul_Kunz at SLAC.Stanford.EDU
       
    Thu May 29 02:16:00 BST 2003
    
    
  
   In my PlotterBase.zip file I have
class PlotterBase
{
public:
  PlotterBase ( const std::string & );
  void setRange ( const std::string &, double, double );
  virtual void setBinWidth ( const std::string &, double );
In the C++ code there's an implementation that is overridden by a
number of derived classes of PlotterBase.   The Python user gets his
handle on them via 
class DisplayController
{
public:
  static DisplayController * instance ();
  PlotterBase * createDisplay ( const std::string &, 
                                const NTuple &, 
                                const std::vector<std::string> & ) const;
Where the Python class will have a pinter to a C++ derived class of
PlotterBase.
The SIP generated code for setBinWidth member function contains...
		PlotterBase *sipCpp;
		if (sipParseArgs(&sipArgsParsed,sipArgs,"mM1d",sipThisObj,sipClass_PlotterBase,&sipCpp,sipConvertTo_std_string,&a0,&a0IsTemp,&a1))
		{
			Py_BEGIN_ALLOW_THREADS
			sipCpp -> PlotterBase::setBinWidth(*a0,a1);
			Py_END_ALLOW_THREADS
The C++ call to setBinWidth is scoped, the the virtual function table
of the derived class is not used.
   Is this a know bug in SIP code generation?
    
    
More information about the PyQt
mailing list