Boost.Python and Qt inheritance

情到浓时终转凉″ 提交于 2019-12-08 06:35:55

问题


I'm want to wrap my C++ code wrote with Qt framework into python with boost.python. But I really can't understand one issue : when I wrapping class, I should also wrap it's base class. So should I wrap QObject, for example, if class which I need to wrap inherits from it? e.g. :

class TRIKCONTROL_EXPORT BatteryInterface : public QObject, public DeviceInterface
{
    Q_OBJECT

public slots:
    /// Returns current battery voltage in volts.
    virtual float readVoltage() = 0;

    /// Returns current raw reading of battery.
    virtual float readRawDataVoltage() = 0;
};

UPD 1 : Now I'm pretty sure that I don't need to wrap c++ QObject, but I don't know, how to tell my wrapped class to inherit from PyQt QObject. Any ideas?

来源:https://stackoverflow.com/questions/37076983/boost-python-and-qt-inheritance

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!