Roman Belkov - 2017-05-25

Hi,

I have roughly the same code structure:

class BrickInterface : public QObject { 
    public slots:
    BatteryInterface* battery() //just an interface derived from QObject
}

And I have the following code generated by the PythonQt generator:

class PythonQtPublicPromoter__BrickInterface : public BrickInterface
{ public:
    inline BatteryInterface*  py_q_battery() { return this->battery(); }
}

class PythonQtWrapper__BrickInterface : public QObject
{ Q_OBJECT
public:
public slots:
   BatteryInterface* py_q_battery(BrickInterface* theWrappedObject){  return (((PythonQtPublicPromoter__BrickInterface*)theWrappedObject)->py_q_battery());}
}

Now, if I call py_q_battery(), I get the right wrapped instance and am able to access all the methods of BatteryInterface correctly. But if I call battery(), I'll get plain C++ object which has no methods available. What I want is to be able to call battery() and get a correct wrapped instance. I tried messing with generated wrappers, but had no luck. Is there a way to do it nicely?

Many thanks.

 

Last edit: Roman Belkov 2017-05-25